Fix optimistic effect for implicit and filters (#9935)

The optimistic effect for record creations and updates wasn't working
properly for `and filters` without explicit `and`.
The problem was located inside `isRecordMatchingFilter` which didn't
consider implicit `and filters` as `and filters`. This caused queries to
be updated by the optimistic effect even if they didn't match the root
query filter.

I also removed `fetchPolicy: 'cache-and-network'` from a query. This was
a temporary fix for this issue.

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Raphaël Bosi
2025-01-30 17:31:02 +01:00
committed by GitHub
parent 460253ab98
commit 625466f38d
2 changed files with 13 additions and 1 deletions

View File

@ -53,7 +53,6 @@ export const useFindManyRecordsSelectedInContextStore = ({
contextStoreTargetedRecordsRule.mode === 'selection' &&
contextStoreTargetedRecordsRule.selectedRecordIds.length === 0,
limit,
fetchPolicy: 'cache-and-network',
});
return {