Skip to content

Some experiments with wiring up Vert.x, Guice and GraphQL together

License

Notifications You must be signed in to change notification settings

spodin/graphql-vertx-demo-library

Repository files navigation

Build Status

Some experiments with wiring up Vert.x, Guice and GraphQL together.

Build and Run

  1. Execute: ./gradlew vertxRun
  2. Point your browser to: http://localhost:8080/graphql

Using Docker

./gradlew clean shadowJar
docker build -t spodin/library .
docker run -t -d --name library -p 8080:8080 spodin/library

Discovering the GraphQL API

Queries Execution

Send POST to /graphql with JSON body.

Example:

{
	"query":"query{books{id,name,author{id,name}}}",
	"variables":{}
}

Currently, only one query per call is supported due to limitations of GraphQL Java implementation.

Mutations

{
	"query":"mutation{changeBookName(id: 1, name: \"New Book Name\")}",
	"variables":{}
}

same, but with variables:

{
	"query":"mutation($bookId: Int!, $newBookName: String!){changeBookName(id: $bookId, name: $newBookName)}",
	"variables":{"bookId":1, "newBookName":"New Book Name"}
}

Introspection

Execute your introspection query (as described above), or get full schema declaration via GET request to /graphql.

Developer Tools

About

Some experiments with wiring up Vert.x, Guice and GraphQL together

Topics

Resources

License

Stars

Watchers

Forks

Languages