Skip to content

Instantly share code, notes, and snippets.

@michaljemala
Created April 5, 2019 10:09
Show Gist options
  • Save michaljemala/c6d2d38652d70b4ed563313f74092876 to your computer and use it in GitHub Desktop.
Save michaljemala/c6d2d38652d70b4ed563313f74092876 to your computer and use it in GitHub Desktop.
Descriptions not properly set
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