hasura / hasura/graphql-engine

Unique index constraint appears in studio but fails when used in query, both by admin and user

Open
#3,981 13 comments 2 reactions 0 assignees View on GitHub
c/server support/needs-action
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

Example query:

```
mutation {
insert_table(
objects: [{
key: "test",
product_id: 1,
value: "test",
}],
on_conflict: {
constraint: unique_index_name_as_appear_in_mutation_root,
update_columns: value
}
) {
affected_rows
}
}
```
Error:
```
{
"errors": [
{
"extensions": {
"path": "$.selectionSet.insert_table.args.objects",
"code": "constraint-error"
},
"message": "constraint \"unique_index_name_as_appear_in_mutation_root\" for table \"insert_table\" does not exist"
}
]
}
```

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.