hasura / hasura/graphql-engine

Feature Request: Option to return a type for single entity mutations as opposed to just the entity itself

Open
#6,547 1 comment 3 reactions 1 assignee Claimed by @0x777 View on GitHub
a/api/graphql k/bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.