A GraphQL wrapper for the Star Wars REST API
10K+
A GraphQL wrapper for the SWAPI REST API.
This repo is a proxy GraphQL wrapper service for the SWAPI REST API enabling the community to access their Star War trivia in GraphQL format. It is written in Go and has an associated Docker image for people to pull and run on their own platforms.
Now there is no need to access multiple endpoints and synthesise your Star Wars data. SWAPIQL has you covered. Just ask it what data you want and off it will go to get it for you.
The container exposes port 3000 and the GraphQL endpoint is at the root (i.e. localhost:3000/graphql). The server also provides GraphQL Playground and Voyager at localhost:3000/playground and localhost:3000/voyager, respectively. These are pre-configured to work with the container's GraphQL endpoint.

If you want to use a different endpoint other than the root endpoint then you can create a environment variable called GQL_PREFIX and add the prefix that appends to the root. E.g. localhost:3000/swapiql/[graphql|playground|voyager] will use GQL_PREFIX=/swapiql.
Zerolog is used for logging in the code and defaults to logging info information. This can be changed to log debug information using the GQL_DEBUG=true environment variable.
Go-cache is used to provide url response caching to reduce the number of repeated calls to the REST API.
docker run -p 3000:3000 jgopsill/swapiql
go run main.go
GQL_DEUBUG=true go run main.go
DOCKER_BUILDKIT=1 docker build --tag swapiql .
N.b. DOCKER_BUILDKIT env var removes the intermediate images after build.
Content type
Image
Digest
Size
16.7 MB
Last updated
almost 6 years ago
docker pull jgopsill/swapiql