hasura / hasura/graphql-engine

On-conflict support for partial unique indexes

Open
#3,666 26 comments 24 reactions 1 assignee Claimed by @0x777 View on GitHub
a/data/postgres c/server k/enhancement p/medium t/native-dbs
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

I was trying to add Hasura to an existing project and noticed that my Postgresql Unique Indices weren't showing up in the Hasura Console.

These Postgresql Unique Indices are also missing in the **on_conflict constraint enum** in the GraphQL

**NOTE**: I am not using Hasura to manage my db migrations.

Docker Image: **hasura/graphql-engine:v1.0.0.cli-migrations**

GraphQL query:
```gql
mutation {
insert_MyTable(
on_conflict: {
constraint: MyTable_column1_column2_key,
update_columns: [ column3, column4 ]
},
objects: {
column1: "value1",
column2: "value2",
column3: "value3",
column4: "value4"
}
) {
returning {
id
}
}
}
```
Responds with the following error:
```json
{
"errors": [
{
"extensions": {
"path": "$.selectionSet.insert_MyTable.args.on_conflict.constraint",
"code": "validation-failed"
},
"message": "unexpected value \"MyTable_column1_column2_key\" for enum: 'MyTable_constraint'"
}
]
}
```

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.