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
If the non-root field of a remote schema has an argument, setting remote schema permission for that field does not include the argument. This has the effect that roles other than admin role won't be able to use that argument.
What is the expected behaviour?
Setting permission on a field must include any arguments that field contains similar to how arguments for root fields are handled.
How to reproduce the issue?
Connect a remote schema to Hasura that has the following GraphQL schema:
Add a permission to that remote schema as shown in the image below:
Execute the following GraphQL query for the admin role -
{
authors {
books(category: fiction) {
title
}
}
}
Execute the same GraphQL query for the user role and observer the error -
{
"errors": [
{
"extensions": {
"code": "validation-failed",
"path": "$.selectionSet.authors.selectionSet.books"
},
"message": "'books' has no argument named 'category'"
}
]
}
Any possible solutions?
The issue happens because console does not send the proper schema to the backend. Therefore, the permissions for remote schema in the metadata will have the following GraphQL type -
Version Information
Server Version: 2.11.1
Environment
OSS
What is the current behaviour?
If the non-root field of a remote schema has an argument, setting remote schema permission for that field does not include the argument. This has the effect that roles other than admin role won't be able to use that argument.
What is the expected behaviour?
Setting permission on a field must include any arguments that field contains similar to how arguments for root fields are handled.
How to reproduce the issue?
admin
role -user
role and observer the error -Any possible solutions?
The issue happens because console does not send the proper schema to the backend. Therefore, the permissions for remote schema in the metadata will have the following GraphQL type -
when it should have been -
Sending the proper schema to the backend would fix the problem.
Keywords
remote schema permission
The text was updated successfully, but these errors were encountered: