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
Server Version: 2.0.10
CLI Version (for CLI related issue): v3
Environment
OSS
What is the expected behaviour?
I write a new mutation in a remote schema and Hasura recognizes the mutation.
I activate remote schema permissions.
The mutation can be executed via Hasura using the admin role.
I can assign remote schema permissions to a new role that allows it to execute the mutation.
What is the current behaviour?
I create a new role.
I try to assign permissions to execute a new mutation.
I receive the following error:
{
"path": "$.args[1].args",
"error": "validation for the given role-based schema failed because expected default value of input value: \"sale_price\"of input object \"upsert_wma_sale_by_metadata_uuid\" to be null but received ",
"code": "validation-failed"
}
Speculation about the source of the problem
If I change sale_price to a required parameter everything works flawlessly. I.e. the fact that sale_price is optional leads to a problem. I assume that the explicit statement of the default value null in the schema causes the error because parameters are nullable by default. However, this should still work because it is valid GraphQL Syntax and the GraphQL Framework Graphene explicitly states the default value in the schema.
I'm hitting this when trying to wrap a strapi GraphQL API in a Remote Schema. By default any collection type in strapi adds this to the schema: pagination: PaginationArg = {}. When this gets read by graphql-engine, it seems to turn into pagination: PaginationArg = undefined, and then saving permissions hits an error.
A solution with strapi is to use patch-package to modify node_modules/@strapi/plugin-graphql/server/services/internals/args/pagination.js and give PaginationArg a non-empty default argument.
Version Information
Server Version: 2.0.10
CLI Version (for CLI related issue): v3
Environment
OSS
What is the expected behaviour?
What is the current behaviour?
Speculation about the source of the problem
If I change sale_price to a required parameter everything works flawlessly. I.e. the fact that sale_price is optional leads to a problem. I assume that the explicit statement of the default value null in the schema causes the error because parameters are nullable by default. However, this should still work because it is valid GraphQL Syntax and the GraphQL Framework Graphene explicitly states the default value in the schema.
The text was updated successfully, but these errors were encountered: