Created
April 5, 2019 10:09
-
-
Save michaljemala/c6d2d38652d70b4ed563313f74092876 to your computer and use it in GitHub Desktop.
Revisions
-
michaljemala created this gist
Apr 5, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ package main import ( "log" "net/http" "github.com/graph-gophers/graphql-go" "github.com/graph-gophers/graphql-go/relay" ) func main() { http.Handle("/query", &relay.Handler{ Schema: graphql.MustParseSchema( `schema { query: Query } " This is a described type. " type Query { hello: String! } type NonDescribed {} `, new(resolver), graphql.UseStringDescriptions(), ), }) log.Fatal(http.ListenAndServe(":8080", nil)) } type resolver struct{} func (*resolver) Hello() string { return "Hello, world!" }