$ docker run -d -p 4000:4000 imega/graphql-playground:latest
- Open URL http://localhost:4000/graphql in browser
- Paste query in editor (left-top)
query getBooks {
books {
title
author
}
}
- Click the play button
- The server will response
{
"data": {
"books": [
{
"title": "Harry Potter and the Chamber of Secrets",
"author": "J.K. Rowling"
},
{
"title": "Jurassic Park",
"author": "Michael Crichton"
}
]
}
}
$ docker run -d -p 4000:4000 \
-v path/to/my/resolvers:/app/resolvers \
-v path/to/my/schema:/app/schema \
imega/graphql-playground:latest
docker-compose.yml
version: "3.3"
services:
app:
image: imega/graphql-playground:latest
volumes:
- ./resolvers:/app/resolvers
- ./schema:/app/schema
ports:
- 4000:4000