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

Directives do not run on Objects #1120

Closed
seaskyways opened this issue Mar 25, 2020 · 3 comments · Fixed by #1255
Closed

Directives do not run on Objects #1120

seaskyways opened this issue Mar 25, 2020 · 3 comments · Fixed by #1255
Labels

Comments

@seaskyways
Copy link

What happened?

I added a directive that is meant to provide some new values in the context and used this directive on a type for example Query. The directive function did not run.

What did you expect?

The directive function should run and pass the related info in the context.

Minimal graphql.schema and models to reproduce

directive @provideLoaders on OBJECT
type Query @provideLoaders {
  hello: String!
}

provideLoaders will not be run when hello is queried.

versions

  • gqlgen version? 0.11.3
  • go version? 1.14
  • dep or go modules? go modules
@seaskyways seaskyways changed the title Directives have do not run on types Directives have do not run on Objects Mar 25, 2020
@seaskyways seaskyways changed the title Directives have do not run on Objects Directives do not run on Objects Mar 25, 2020
@stale
Copy link

stale bot commented May 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 24, 2020
@stale stale bot closed this as completed May 31, 2020
@dtrckd
Copy link

dtrckd commented Jun 28, 2020

Hey,
the pulled request #1117 seems to have fixed this.

Nevertheless, I observed that the OBJECT directive still doesn't run if it is defined like this:

directive @provideLoaders on OBJECT

But does work when the directive is defined like this:

directive @provideLoaders on OBJECT|FIELD_DEFINITION

go version: 1.14
ggqlgen commit: a3c38c6

@ibantoo
Copy link

ibantoo commented Jul 26, 2020

i cant log the object like your gave example

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

Successfully merging a pull request may close this issue.

3 participants