git-bug/graphql/handler.go
2018-07-19 14:15:50 +02:00

18 lines
280 B
Go

package graphql
import "github.com/graphql-go/handler"
func NewHandler() (*handler.Handler, error) {
schema, err := graphqlSchema()
if err != nil {
return nil, err
}
return handler.New(&handler.Config{
Schema: &schema,
Pretty: true,
GraphiQL: true,
}), nil
}