aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/handler.go
blob: 4843fff9527a3917e04d223db5b5df0abc9e802e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
}