Skip to content
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

fix(graphcache): Disregard write-only operation during schema awareness #3621

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lazy-kangaroos-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@urql/exchange-graphcache": patch
---

Disregard write-only operation when fragment-matching with schema awareness
2 changes: 1 addition & 1 deletion exchanges/graphcache/src/operations/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
ctx.store.logger
));

if (isMatching || currentOperation === 'write') {
if (isMatching || (currentOperation === 'write' && !ctx.store.schema)) {

Check failure on line 239 in exchanges/graphcache/src/operations/shared.ts

View workflow job for this annotation

GitHub Actions / Checks

Replace `isMatching·||·(currentOperation·===·'write'·&&·!ctx.store.schema)` with `⏎··············isMatching·||⏎··············(currentOperation·===·'write'·&&·!ctx.store.schema)⏎············`

Check failure on line 239 in exchanges/graphcache/src/operations/shared.ts

View workflow job for this annotation

GitHub Actions / Checks

Replace `isMatching·||·(currentOperation·===·'write'·&&·!ctx.store.schema)` with `⏎··············isMatching·||⏎··············(currentOperation·===·'write'·&&·!ctx.store.schema)⏎············`
if (process.env.NODE_ENV !== 'production')
pushDebugNode(typename, fragment);
const isFragmentOptional = isOptional(select);
Expand Down
Loading