Skip to content

Commit

Permalink
fix: gin sample code error in v0.17.22 (99designs#2503)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam7066 authored Jan 12, 2023
1 parent f5764a8 commit 43c9a1d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docs/content/recipes/gin.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ In your router file, define the handlers for the GraphQL and Playground endpoint
```go
import (
"github.com/[username]/gqlgen-todos/graph" // Replace username with your github username
"github.com/[username]/gqlgen-todos/graph/generated" // Replace username with your github username
"github.com/gin-gonic/gin"

"github.com/99designs/gqlgen/graphql/handler"
Expand All @@ -32,7 +31,7 @@ import (
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{}}))
h := handler.NewDefaultServer(graph.NewExecutableSchema(graph.Config{Resolvers: &graph.Resolver{}}))

return func(c *gin.Context) {
h.ServeHTTP(c.Writer, c.Request)
Expand Down

0 comments on commit 43c9a1d

Please sign in to comment.