Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: gin sample code error in v0.17.22 #2503

Merged
merged 1 commit into from
Jan 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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