graphql

package
v0.9.11 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 6 Imported by: 0

README

Generate the GraphQL endpoint code

Install dependencies
go get github.com/99designs/gqlgen     
Initialize the code generation
go run github.com/99designs/gqlgen init --schema schema.graphqls
(Re)generate the models
go run github.com/99designs/gqlgen generate
Run the playground

Set environment variables:

export PROJECT_ID=podops
export GOOGLE_APPLICATION_CREDENTIALS=/Users/turing/devel/workspace/podops/google-credentials.json
export API_ENDPOINT=http://localhost:8080

Run the server:

``shell go run server.go


or, in just one line:

```shell
clear && PROJECT_ID=podops GOOGLE_APPLICATION_CREDENTIALS=/Users/turing/devel/workspace/podops/google-credentials.json API_ENDPOINT=http://localhost:8080 go run server.go
References

github.com/99designs/gqlgen v0.13.0 github.com/vektah/gqlparser/v2 v2.1.0

go get github.com/vektah/gqlparser/v2@v2.1.0 go get github.com/vektah/gqlparser/v2/ast@v2.1.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphqlEndpoint

func GraphqlEndpoint() echo.HandlerFunc

GraphqlEndpoint maps the Graphql handler to gin

func GraphqlPlaygroundEndpoint

func GraphqlPlaygroundEndpoint() echo.HandlerFunc

GraphqlPlaygroundEndpoint maps the Playground handler to gin

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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