-
Notifications
You must be signed in to change notification settings - Fork 10
Filter is mandatory for update und delete mutation #73
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
| ne: [Decimal] | ||
| } | ||
|
|
||
| """ |
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.
@schwma I am not sure why npm run test:generate-schemas changed this. May be I should revert it manually ?
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.
Yes, could you please revert bookshop-graphql.gql entirely? The schema has been adjusted to use the upcoming minorUnit from the not yet released cds@6.8.0. (see #70)
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.
The schema generation test currently skips bookshop-graphql.gql for cds<6.8.0
| ne: [Decimal] | ||
| } | ||
|
|
||
| """ |
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.
The schema generation test currently skips bookshop-graphql.gql for cds<6.8.0
Co-authored-by: Marcel Schwarz <marcel.schwarz@sap.com>
| AdminService { | ||
| Books { | ||
| update(input: $input) { | ||
| update(filter: {}, input: $input) { |
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.
But isn't it required to include the keys in the filter?
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.
No, filters are basically where conditions with limited operators. Keys don't necessarily need to be specified.
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.
According to the Changelog :
Empty filter lists resolve to false and empty filter objects resolve to true
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.
So in this case it would update all entries in the database, do we really want to allow that? Or are there checks in our runtime?
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.
Yes it would update all entries and there are no checks in the runtime. We discussed this with @ralfhandl and determined that there will always be ways to cause a filter to affect most/all entries, since it is essentially a where condition. Making the filter argument mandatory is a step against accidentally affecting all entries by forgetting the argument.
…ap-js/graphql into mandatory-filter-update-delete
No description provided.