Skip to content

Commit 4e52cf0

Browse files
authored
fix(graphcache): Disregard write-only operation during schema awareness (#3621)
1 parent 1bb05f5 commit 4e52cf0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/lazy-kangaroos-think.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@urql/exchange-graphcache": patch
3+
---
4+
5+
Disregard write-only operation when fragment-matching with schema awareness

exchanges/graphcache/src/operations/shared.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ export function makeSelectionIterator(
236236
ctx.store.logger
237237
));
238238

239-
if (isMatching || currentOperation === 'write') {
239+
if (
240+
isMatching ||
241+
(currentOperation === 'write' && !ctx.store.schema)
242+
) {
240243
if (process.env.NODE_ENV !== 'production')
241244
pushDebugNode(typename, fragment);
242245
const isFragmentOptional = isOptional(select);

0 commit comments

Comments
 (0)