-
Notifications
You must be signed in to change notification settings - Fork 1.2k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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 execution order #1398
Comments
Additionally, is the right to left order intended? Can find anything on it in the official gql spec.
will execute generated.go:
|
Directive order is significant, but the specification does not specify how. There should be a clarification in the new spec |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
What happened?
Directives execution order is not logical.
Directives for input are executed before directives for mutation/query itself
In my case, this behavior leads to that input validation occurs in any case, even if the user does not have a role to execute mutation.
What did you expect?
The order of calling directives should be from "general" to "specific". That is, first for the query / mutation, and then for its arguments.
See schema for example.
expected: hasRole, canEdit
actial: canEdit, hasRole
Minimal graphql.schema and models to reproduce
versions
gqlgen version
?v0.11.3-dev
go version
?go version go1.13.4 windows/amd64
dep or go modules?
go modules
The text was updated successfully, but these errors were encountered: