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

What is __DirectiveResolver? #154

Closed
tcastelly opened this issue Apr 13, 2021 · 8 comments
Closed

What is __DirectiveResolver? #154

tcastelly opened this issue Apr 13, 2021 · 8 comments

Comments

@tcastelly
Copy link

Hello,

Just by updating from v2.1.0 to v2.2.0 I noticed in my generated code I have now a new resolver:

__DirectiveResolver

I guess it's linked to: graphql/graphql-spec#510

I don't now if it's a bug, or if I have to implement something :)

type ResolverRoot interface {
       // ...
	__Directive() __DirectiveResolver
}


type __DirectiveResolver interface {
	IsRepeatable(ctx context.Context, obj *introspection.Directive) (bool, error)
}
@tcastelly tcastelly changed the title What is __DirectiveResolver What is __DirectiveResolver? Apr 13, 2021
@lwc
Copy link
Collaborator

lwc commented Apr 14, 2021

Yep correct - 99designs/gqlgen#1514 will be required to support v2.2.0 in gqlgen

@AubSs
Copy link

AubSs commented Apr 14, 2021

@lwc Hello, the underscore block the import when the generate file server is outside the resolver package

@AubSs
Copy link

AubSs commented Apr 14, 2021

What should we do with this new thing ?

@lwc
Copy link
Collaborator

lwc commented Apr 14, 2021

Hello, if you update gqlgen to the latest master and remove prelude.resolvers.go does the problem persist?

@AubSs
Copy link

AubSs commented Apr 15, 2021

Yes. Weird behaviour. Thank you !

@tcastelly
Copy link
Author

In my gqlgen.yml I removed:

# resolver:
#   layout: follow-schema
#   dir: graphql
#   package: graphql

And maybe because of this I don't have this prelude.resolvers.go. I'm a bit lost, what I have to do?

Thank you for your help :)

@orsenkucher
Copy link

orsenkucher commented Apr 15, 2021

@lwc
protoc required

git clone -n https://github.com/orsenkucher/cocopuff.git 
git checkout f706e7b
make generate
go get -u github.com/vektah/gqlparser/[email protected]
make generate
validation failed: packages.Load: C:\Users\beeff\go\src\github.com\orsenkucher\cocopuff\graphql\resolver\prelude.go:19:38: __DirectiveResolver not exported by package gql
graphql\client.go:1: running "gqlgen": exit status 1

To have something reproducible)
I have __DirectiveResolver in package gql
But prelude.go is in package resolver

#154 (comment) Or was it fixed in master?

@tcastelly
Copy link
Author

I've no problem anymore using:

github.com/99designs/gqlgen v0.14.0
github.com/vektah/gqlparser/v2 v2.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants