-
Notifications
You must be signed in to change notification settings - Fork 223
Closed
Labels
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Version/Branch | 0.11.1 |
I am declaring my schema in yaml like so:
Organization:
type: object
config:
resolveField: '@=resolver("App\\GraphQL\\Resolver\\OrganizationResolver", [value, args, context, info])'
fields:
# ... more fields
route:
type: "Route!"
access: "@=hasPermission(value, 'route_view')"
args:
id:
type: "ID!"
The Organization
has a resolveField
The route
field has an access
rule.
If I then make the following request:
query {
organization(id: 1) {
route(id: "xxui") {
id
}
}
}
I get the following error:
Argument 1 passed to Overblog\\GraphQLBundle\\Definition\\Argument::__construct() must be of the type array or null, object given, called in /var/www/projects/strollplanner-flex/vendor/overblog/graphql-bundle/Resolver/Resolver.php on line 53
But if I use the following configuration:
Organization:
type: object
config:
resolveField: '@=resolver("App\\GraphQL\\Resolver\\OrganizationResolver", [value, args, context, info])'
fields:
# ... more fields
route:
type: "Route!"
### \/ This has been added ###
resolve: '@=resolver("App\\GraphQL\\Resolver\\OrganizationResolver", [value, args, context, info])'
access: "@=hasPermission(value, 'route_view')"
args:
id:
type: "ID!"
It works perfectly fine.
If I remove the access rule in the first example it works perfectly fine as well.