hasura / hasura/graphql-engine
Remote Schema Permissions Default Value Null leads to Validation Error
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Version Information
Server Version: 2.0.10
CLI Version (for CLI related issue): v3
### Environment
OSS
### What is the expected behaviour?
1. I write a new mutation in a remote schema and Hasura recognizes the mutation.
2. I activate remote schema permissions.
3. The mutation can be executed via Hasura using the admin role.
4. I can assign remote schema permissions to a new role that allows it to execute the mutation.
### What is the current behaviour?
1. I create a new role.
2. I try to assign permissions to execute a new mutation.
3. 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.
```
upsert_wma_sale_by_metadata_uuid(is_sold: Boolean!, metadata_uuid: uuid!, sale_price: Float = null): UpsertWmaSaleByMetadataUuid
```
Contributor guide
Assessment
This issue has not been assessed yet.