From 56d1dd92fee79d4c4e641ea0c91a1e5c5610ced4 Mon Sep 17 00:00:00 2001 From: piyushjha0409 Date: Wed, 13 Nov 2024 22:20:27 +0530 Subject: [PATCH] Fix: HTTP Handler route GET and POST --- modules/graph/graph.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/graph/graph.go b/modules/graph/graph.go index be0059e..8308400 100644 --- a/modules/graph/graph.go +++ b/modules/graph/graph.go @@ -32,9 +32,9 @@ const defaultPort = "8080" func (g *graph) Init() error { g.server = handler.NewDefaultServer(NewExecutableSchema(Config{Resolvers: &Resolver{}})) - http.Handle("/", playground.ApolloSandboxHandler("GraphQL Playground", "/api/v1/graphql")) + http.Handle("GET /api/v1/graphql", playground.ApolloSandboxHandler("GraphQL Playground", "/api/v1/graphql")) - http.Handle("/api/v1/graphql", g.server) + http.Handle("POST /api/v1/graphql", g.server) return nil }