A GraphQL wrapper for (parts of) the GAPIC Showcase API.
This project contains a simple and rough wrapper for a few methods of the GAPIC Showcase API, and is intended to provide an example of manual integration of a gRPC API into a GraphQL service.
It uses the graphql-go package.
This repository is temporary.
This code is published to support the workshop
Implementing OpenAPI and GraphQL Services with gRPC
at the 2019 API Specifications Conference.
It is intended for submission later into an experimental
subdirectory of GAPIC Showcase.
Contents of the static
directory are manually vendored from
github.com/graphql/graphiql.
go get github.com/timburks/graphql-showcase
Just run the graphql-showcase
program. It currently takes no options
and expects a GAPIC Showcase server to be running locally on port 7469
(the default).
After you've started the graphql-showcase
server, visit http://localhost:8080
to open the GraphiQL browser. Then use standard GraphQL to explore the schema
and make queries. For example, to create a new user, enter:
mutation {
createUser(display_name:"me", email:"me@example.com") {
id
display_name
email
}
}
To see a list of users, enter:
{
users {
id
display_name
email
}
}
To delete a user, enter:
mutation {
deleteUser(id:"users/10") {
id
}
}
This code was developed with Go 1.12.
This is not an official Google product.