graphql-showcase

command module
v0.0.0-...-d301b43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

README

GraphQL Showcase

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.

Credits

Contents of the static directory are manually vendored from github.com/graphql/graphiql.

Installation

go get github.com/timburks/graphql-showcase

Invocation

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).

Usage

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
  }
}

Go Version Supported

This code was developed with Go 1.12.

Disclaimer

This is not an official Google product.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL