-
Notifications
You must be signed in to change notification settings - Fork 2.8k
apply update permissions for upsert mutations #628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
-> if `on_conflict` clause results in `DO UPDATE ..` then use update permission filter in `WHERE` clause -> validate input columns against columna specified in update permission
Resolve Conflicts: server/src-lib/Hasura/RQL/DML/Insert.hs server/tests-py/queries/graphql_mutation/insert/permissions/author_user_role_insert_check_perm_success.yaml server/tests-py/queries/graphql_mutation/insert/permissions/company_user_role_on_conflict.yaml
|
Review app available at: https://hge-ci-pull-628.herokuapp.com |
Resolve Conflicts: server/src-lib/Hasura/GraphQL/Resolve.hs server/src-lib/Hasura/GraphQL/Resolve/Mutation.hs server/src-lib/Hasura/GraphQL/Schema.hs server/src-lib/Hasura/RQL/DML/Insert.hs server/src-lib/Hasura/SQL/DML.hs
|
Review app available at: https://hge-ci-pull-628.herokuapp.com |
|
@0x777 @rakeshkky What is the status on this PR? |
Resolve Conflicts: server/src-lib/Hasura/GraphQL/Resolve/Insert.hs server/src-lib/Hasura/GraphQL/Schema.hs server/src-lib/Hasura/RQL/DDL/Permission.hs
|
Review app available at: https://hge-ci-pull-628.herokuapp.com |
|
@karthikvt26 We are removing 'allow upsert queries' from insert permissions. They are automatically determined from update permissions. |
Automatically determine upsert permission from update permission
|
@rakeshkky @0x777 Do we need to make the console changes before this is merged/released? Also, how is the upgrade going to be handled for people who are currently using this config? |
|
@dsandip rishi is taking a look at it. Console tests are failing due to this change. |
@dsandip Console changes are required. Existing users have to define update permissions on tables to enable upsert. |
Explicitly compute `isUpsertable` during schema generation
|
Review app available at: https://hge-ci-pull-628.herokuapp.com |
karthikvt26
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested console and it looks fine.
|
Review app for commit 5ba6e6b deployed to Heroku: https://hge-ci-pull-628.herokuapp.com |
'update_columns' argument is mandatory
…ne into internal-issue-36
|
Review app for commit eedf22a deployed to Heroku: https://hge-ci-pull-628.herokuapp.com |
Resolve Conflicts: docs/graphql/manual/mutations/upsert.rst server/tests-py/queries/graphql_mutation/insert/nested/articles_with_author_author_id_fail.yaml server/tests-py/queries/graphql_mutation/insert/nested/author_with_articles_author_id_fail.yaml
|
Review app for commit c8c9868 deployed to Heroku: https://hge-ci-pull-628.herokuapp.com |
Resolve Conflicts: server/src-lib/Hasura/GraphQL/Resolve/Context.hs server/src-lib/Hasura/Prelude.hs
|
@rikinsk You'll need to review the docs. |
|
Review app for commit 4f34a97 deployed to Heroku: https://hge-ci-pull-628.herokuapp.com |
rikinsk-zz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs approved
|
Review app for commit 2e72d0b deployed to Heroku: https://hge-ci-pull-628.herokuapp.com |
|
Review app for commit d5f547e deployed to Heroku: https://hge-ci-pull-628.herokuapp.com |
|
Review app for commit a6c981a deployed to Heroku: https://hge-ci-pull-628.herokuapp.com |
|
Review app https://hge-ci-pull-628.herokuapp.com is deleted |
<!-- Thank you for submitting this PR! :) --> ## Description In hasura/v3-engine#599 we added new `BooleanExpressionType` to OpenDD. It included a number of helpful newtypes such as `DataConnectorScalarType` that replace uses of raw string and make intent inside engine code easier to follow. This change uses that newtype everywhere in `metadata-resolve`. <!-- Questions to consider answering: 1. What user-facing changes are being made? 2. What are issues related to this PR? (Consider adding `(close #<issue-no>)` to the PR title) 3. What is the conceptual design behind this PR? 4. How can this PR be tested/verified? 5. Does the PR have limitations? 6. Does the PR introduce breaking changes? --> ## Changelog - Add a changelog entry (in the "Changelog entry" section below) if the changes in this PR have any user-facing impact. See [changelog guide](https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide). - If no changelog is required ignore/remove this section and add a `no-changelog-required` label to the PR. ### Product _(Select all products this will be available in)_ - [X] community-edition - [X] cloud <!-- product : end : DO NOT REMOVE --> ### Type <!-- See changelog structure: https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide#structure-of-our-changelog --> _(Select only one. In case of multiple, choose the most appropriate)_ - [ ] highlight - [X] enhancement - [ ] bugfix - [ ] behaviour-change - [ ] performance-enhancement - [ ] security-fix <!-- type : end : DO NOT REMOVE --> ### Changelog entry <!-- - Add a user understandable changelog entry - Include all details needed to understand the change. Try including links to docs or issues if relevant - For Highlights start with a H4 heading (#### <entry title>) - Get the changelog entry reviewed by your team --> Use `DataConnectorScalarType` string newtype internallly and in OpenDD types. <!-- changelog-entry : end : DO NOT REMOVE --> <!-- changelog : end : DO NOT REMOVE --> V3_GIT_ORIGIN_REV_ID: b44709f39b30f25908106110f62c72e3d13b4eb6
Description
What component does this PR affect?
Requires changes from other components? If yes, please mark the components:
Solution and Design
on_conflictclause results inDO UPDATE ..then use updatepermission
filterexpression inWHEREclauseactionargument inon_conflictinput object.update_columnsargument is mandatory.Type
Checklist: