rename handler files

This commit is contained in:
Lakhan Samani
2021-07-23 14:22:46 +05:30
parent efce3337ec
commit 58b0dced7a
5 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package handlers
import (
"github.com/99designs/gqlgen/graphql/handler"
"github.com/gin-gonic/gin"
"github.com/yauthdev/yauth/server/graph"
"github.com/yauthdev/yauth/server/graph/generated"
)
// Defining the Graphql handler
func GraphqlHandler() gin.HandlerFunc {
// NewExecutableSchema and Config are in the generated.go file
// Resolver is in the resolver.go file
h := handler.NewDefaultServer(generated.NewExecutableSchema(generated.Config{Resolvers: &graph.Resolver{}}))
return func(c *gin.Context) {
h.ServeHTTP(c.Writer, c.Request)
}
}