Skip to content

Latest commit

 

History

History
65 lines (53 loc) · 1.21 KB

README.md

File metadata and controls

65 lines (53 loc) · 1.21 KB

Graphql and playground

Build Status

Usage

$ docker run -d -p 4000:4000 imega/graphql-playground:latest
  1. Open URL http://localhost:4000/graphql in browser
  2. Paste query in editor (left-top)
query getBooks {
    books {
        title
        author
    }
}
  1. Click the play button
  2. The server will response
{
    "data": {
        "books": [
            {
                "title": "Harry Potter and the Chamber of Secrets",
                "author": "J.K. Rowling"
            },
            {
                "title": "Jurassic Park",
                "author": "Michael Crichton"
            }
        ]
    }
}

Your resolver and schema

$ 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