Skip to content

Conversation

@mariayord
Copy link
Contributor

No description provided.

@mariayord mariayord requested a review from schwma April 28, 2023 09:34
@mariayord mariayord requested a review from a team as a code owner April 28, 2023 09:34
ne: [Decimal]
}

"""
Copy link
Contributor Author

@mariayord mariayord Apr 28, 2023

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 ?

Copy link
Member

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)

Copy link
Member

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]
}

"""
Copy link
Member

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

mariayord and others added 2 commits April 28, 2023 11:45
Co-authored-by: Marcel Schwarz <marcel.schwarz@sap.com>
AdminService {
Books {
update(input: $input) {
update(filter: {}, input: $input) {
Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Contributor Author

@mariayord mariayord Apr 28, 2023

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

Copy link
Contributor

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?

Copy link
Member

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.

@mariayord mariayord merged commit c5ae273 into main Apr 28, 2023
@mariayord mariayord deleted the mandatory-filter-update-delete branch April 28, 2023 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants