hasura / hasura/graphql-engine
Feature Request: Option to return a type for single entity mutations as opposed to just the entity itself
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
Hi Hasura team,
At the moment the single entity mutations do not return an object with a typename:
```graphql
mutation($object: tests_insert_input!) {
insert_tests_one(object: $object){
id
}
}
```
Feature request: ability to return an object with a typename of e.g., `__insert_tests_one_response` (as opposed to something that does not describe the type of mutation like `tests_mutation_response`)
```graphql
mutation($object: tests_insert_input!) {
insert_tests_one(object: $object){
__typename
node {
id
}
}
}
```
Use case: client cache invalidation based on types :)
I know that just returning the type itself is useful, so maybe this could be an option?
Thanks for considering!
Lydia
Contributor guide
Assessment
This issue has not been assessed yet.