Skip to content

ncostamagna/stack_graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

go get github.com/graphql-go/graphql

Examples

Example 1

Very basic example, is a 'hello world'

Example 2

Is a more complex example, graphql with structs

Example 3

Is an application web with graphQL without any external packages (without gorilla mux and gin)

gplgen

Client

Insomnia

Body: GraphQL

# Get products
URL: http://localhost:8080/products?query={list{id,name,info,price}} 

# Create product
URL: http://localhost:8080/products?query=mutation{create(name:"Inca Kola",info:"Inca Kola is a soft drink that was created in Peru in 1935 by British immigrant Joseph Robinson Lindley using lemon verbena (wiki)",price:1.99){id,name,info,price}}

gplgen

mkdir example
cd example
go mod init example

go get -d github.com/99designs/gqlgen

printf '// +build tools\npackage tools\nimport _ "github.com/99designs/gqlgen"' | gofmt > tools.go
go mod tidy

# create a new project
go run github.com/99designs/gqlgen init

Apollo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published