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
You can now see createBlogPost is underlined and red in intellij with this error: 'createBlogPost' uses an illegal value for the argument 'args' on directive 'can'. Argument value is of type 'ArrayValue', expected a scalar
Output/Logs
Click to expand
# Add in log output/error messages here
Lighthouse Version : v5.67.0
The text was updated successfully, but these errors were encountered:
Field and directive arguments accept input values of various literal primitives; input values can be scalars, enumeration values, lists, or input objects.
Since input types can not be polymorphic, I believe it is impossible to express that the type of args can be any input value.
In your specific case, the plugin would probably be fine when defining the directive as args: [CanArgs] - but that would then break use cases where any other value such as args: "foo" is passed.
Field and directive arguments accept input values of various literal primitives; input values can be scalars, enumeration values, lists, or input objects.
Since input types can not be polymorphic, I believe it is impossible to express that the type of args can be any input value.
In your specific case, the plugin would probably be fine when defining the directive as args: [CanArgs] - but that would then break use cases where any other value such as args: "foo" is passed.
Thanks for responding can't we use Unions though?
Update: input values can't be unioned I guess that's impossible then....
I use the GraphQL plugin for intellij suggested by the official docs, but it gives me an error when adding an array to args of
@can
The message is:
Describe the bug
So the
args
with[1,2]
is the problem.This is the defined type at
schema-directives.graphql
which comes from/vendor/nuwave/lighthouse/src/Auth/CanDirective.php
Shouldn't that be something like instead?
Expected behavior/Solution
Steps to reproduce
createBlogPost
is underlined and red in intellij with this error:'createBlogPost' uses an illegal value for the argument 'args' on directive 'can'. Argument value is of type 'ArrayValue', expected a scalar
Output/Logs
Click to expand
Lighthouse Version : v5.67.0
The text was updated successfully, but these errors were encountered: