aboutsummaryrefslogblamecommitdiffstats
path: root/graphql/handler.go
blob: 7dbb7a0f218aee2132b8fb881a044d8dd4014a94 (plain) (tree)
1
2
3
4
5
6




                                             
                                         










                                           
package graphql

import "github.com/graphql-go/handler"

func NewHandler() (*handler.Handler, error) {
	schema, err := newGraphqlSchema()

	if err != nil {
		return nil, err
	}

	return handler.New(&handler.Config{
		Schema:   &schema,
		Pretty:   true,
		GraphiQL: true,
	}), nil
}