You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to figure out how to use an existing resolver implementation. But when I run go run github.com/99designs/gqlgen generate, it overwrites the implementation in the schema.resolvers.go file.
I am using this package to add pagination to my GraphQL server.
package graph
//go:generate go run github.com/99designs/gqlgen generate
import (
"github.com/nrfta/go-paging"
"github.com/gobuffalo/pop/v6"
)
// This file will not be regenerated automatically.
//
// It serves as dependency injection for your app, add any dependencies you require here.
type Resolver struct {
db *pop.Connection
}
func (r *Resolver) PageInfo() paging.PageInfoResolver {
return paging.NewPageInfoResolver()
}
When I run go run github.com/99designs/gqlgen generate, I would expect my schema.resolvers.go to not contain the auto-generated pageInfoResolver struct PageInfo() method, since I have already provided an implementation. However, they get generated, and I get the following error:
validation failed: packages.Load: /home/wheeler/Repositories/.../graph/schema.resolvers.go:70:20: method Resolver.PageInfo already declared at /home/wheeler/Repositories/.../graph/resolver.go:18:20
exit status 1
graph/resolver.go:3: running "go": exit status 1
How do I get gqlgen to stop auto-generating the methods that return the sub-resolvers if the methods are already defined?
The text was updated successfully, but these errors were encountered:
I am trying to figure out how to use an existing resolver implementation. But when I run
go run github.com/99designs/gqlgen generate
, it overwrites the implementation in theschema.resolvers.go
file.I am using this package to add pagination to my GraphQL server.
I add the following to my
gqlgen.yaml
file:This is what is inside my
resolver.go
:When I run
go run github.com/99designs/gqlgen generate
, I would expect myschema.resolvers.go
to not contain the auto-generatedpageInfoResolver
structPageInfo()
method, since I have already provided an implementation. However, they get generated, and I get the following error:How do I get gqlgen to stop auto-generating the methods that return the sub-resolvers if the methods are already defined?
The text was updated successfully, but these errors were encountered: