aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-29 18:11:33 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-29 18:51:56 +0200
commit6363518c85cbd8247a5f6507b8a1dd3903cfb71d (patch)
treeaa51652e9881196b3637247988cbd5155f42b5e2 /commands
parentff2fd14e3f10a7206d4ec86f07e524cfa290e0fc (diff)
downloadgit-bug-6363518c85cbd8247a5f6507b8a1dd3903cfb71d.tar.gz
relay connection working with gqlgen
Diffstat (limited to 'commands')
-rw-r--r--commands/webui.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/commands/webui.go b/commands/webui.go
index 802fc5df..80bda980 100644
--- a/commands/webui.go
+++ b/commands/webui.go
@@ -2,12 +2,13 @@ package commands
import (
"fmt"
- "github.com/MichaelMure/git-bug/graphql"
+ "github.com/MichaelMure/git-bug/graphql2"
"github.com/MichaelMure/git-bug/webui"
"github.com/gorilla/mux"
"github.com/phayes/freeport"
"github.com/skratchdot/open-golang/open"
"github.com/spf13/cobra"
+ "github.com/vektah/gqlgen/handler"
"log"
"net/http"
)
@@ -28,16 +29,11 @@ func runWebUI(cmd *cobra.Command, args []string) error {
fmt.Printf("Web UI available at %s\n", webUiAddr)
- graphqlHandler, err := graphql.NewHandler(repo)
-
- if err != nil {
- return err
- }
-
router := mux.NewRouter()
// Routes
- router.Path("/graphql").Handler(graphqlHandler)
+ router.Path("/playground").Handler(handler.Playground("git-bug", "/graphql"))
+ router.Path("/graphql").Handler(graphql2.NewHandler(repo))
router.PathPrefix("/").Handler(http.FileServer(webui.WebUIAssets))
open.Run(webUiAddr)