这是indexloc提供的服务,不要输入任何密码
Skip to content

upsert queries do not work for non admin roles #239

@coco98

Description

@coco98
  1. Create a table user table with types id, name and primary key: id,
  2. Create a permission for the user allowing any insert and allowing upserts too

This query is valid per GraphiQL:

X-Hasura-Role: user
X-Hasura-Role: 1

mutation {
  insert_user(
    objects:[{name:"test"}],
    on_conflict: {
      constraint: user_pkey
      action: update
    }
  ) {
    affected_rows
  }
}

But returns this error from postgres:

{
  "errors": [
    {
      "path": "$",
      "error": "constraint \"user_pkey\" for table \"user__insert__public__user\" does not exist",
      "code": "postgres-error"
    }
  ]
}

Metadata

Metadata

Labels

c/serverRelated to serverk/bugSomething isn't workings/wipStatus: This issue is a work in progress

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions