hasura / hasura/graphql-engine

Update mutation without columns

Open
#7,406 0 comments 0 reactions 0 assignees View on GitHub
c/server k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

In Hasura 1.3.2 we configured a update mutation for a table with only one column with a preset. It's a way for the client to tell us everything is finished. It's just possible to change the state to 8.

![grafik](https://user-images.githubusercontent.com/6802580/129746479-ae60e5f6-4b68-42e4-9ec3-dc7ac9e5deb2.png)

The mutation with an empty set:
```
mutation {
update_insp_inspections(where: {id: {_eq: "b84ddb1b-96d8-45cc-a195-6c2a125ed336"}}, _set: {}) {
affected_rows
}
}
```

Since we upgraded from 1.3.2 to 2.0.6 it doesn't work anymore. The mutation doesn't appear in the schema.
```
{
"errors": [
{
"extensions": {
"path": "$.selectionSet.update_insp_inspections",
"code": "validation-failed"
},
"message": "field \"update_insp_inspections\" not found in type: 'mutation_root'"
}
]
}
```

Now we need to add a dummy column with update permission without preset. Then the mutations appears again in schema.

Is this change intended or is it a bug?

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported update_insp_inspections mutation on Hasura 2.0.6, using the empty _set object and the update permission with a preset described in the issue. Compare the generated mutation_root schema with 1.3.2 and determine whether the missing mutation is intended; done means the behavior is clarified or corrected with coverage for this permission configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql
Domain
api, authorization, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.