Skip to content

Commit

Permalink
fix(graphcache): Disregard write-only operation during schema awarene…
Browse files Browse the repository at this point in the history
…ss (#3621)
  • Loading branch information
JoviDeCroock authored Jun 24, 2024
1 parent 1bb05f5 commit 4e52cf0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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
5 changes: 4 additions & 1 deletion exchanges/graphcache/src/operations/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ export function makeSelectionIterator(
ctx.store.logger
));

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

0 comments on commit 4e52cf0

Please sign in to comment.