Created
April 5, 2019 10:09
-
-
Save michaljemala/c6d2d38652d70b4ed563313f74092876 to your computer and use it in GitHub Desktop.
Descriptions not properly set
This file contains 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 characters
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!" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment