diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-29 18:11:33 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-29 18:51:56 +0200 |
commit | 6363518c85cbd8247a5f6507b8a1dd3903cfb71d (patch) | |
tree | aa51652e9881196b3637247988cbd5155f42b5e2 /commands/webui.go | |
parent | ff2fd14e3f10a7206d4ec86f07e524cfa290e0fc (diff) | |
download | git-bug-6363518c85cbd8247a5f6507b8a1dd3903cfb71d.tar.gz |
relay connection working with gqlgen
Diffstat (limited to 'commands/webui.go')
-rw-r--r-- | commands/webui.go | 12 |
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) |