git-bug/graphql/handler.go

18 lines
280 B
Go
Raw Normal View History

2018-07-19 15:15:50 +03:00
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
}