summaryrefslogtreecommitdiffstatshomepage
path: root/graphql/handler.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-19 14:15:50 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-19 14:15:50 +0200
commita2a50f3de0c428c5a61e6a449191be3c4ded86ac (patch)
tree5ecf4f5f1f26933b42a606b741963fa5f66c85aa /graphql/handler.go
parent25fb88d7497b00bbe3dda540efde22ffd3de6e49 (diff)
downloadgit-bug-a2a50f3de0c428c5a61e6a449191be3c4ded86ac.tar.gz
git-bug-a2a50f3de0c428c5a61e6a449191be3c4ded86ac.zip
webui: add a primitive graphql handler
Diffstat (limited to 'graphql/handler.go')
-rw-r--r--graphql/handler.go17
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
+}