diff options
Diffstat (limited to 'graphql/handler.go')
-rw-r--r-- | graphql/handler.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/graphql/handler.go b/graphql/handler.go new file mode 100644 index 00000000..4843fff9 --- /dev/null +++ b/graphql/handler.go @@ -0,0 +1,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 +} |