Skip to content

jomoespe/go-graphql-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GrahpQL Go sample

Following the medium article Learn Golang + GraphQL + Relay, with some changes derivated of graphql-go evolution.

Install GraphQL packages

go get github.com/graphql-go/graphql
go get github.com/graphql-go/graphql-go-handler

Test

Start the GraphQL server:

run main.go

Send queries to GraphQL server:

#curl -XPOST http://localhost:8080/graphql -H 'Content-Type: application/graphql' -d 'query Root{ latestPost }'
#curl -XPOST http://localhost:8080/graphql -H 'Content-Type: application/graphql' -d '{ latestPost }'

curl -XPOST http://localhost:8080/graphql -H 'Content-Type: application/graphql' -d '{Vehicle(id:"2") { name, state }}'

Get the schema meta-data

curl -XPOST http://localhost:8080/graphql -H 'Content-Type: application/graphql' -d '{__schema { queryType { name, fields {name, description }}}}'

About

GraphQL proof of concept in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages