Commit 98b3652
committed
Don't corrupt type registry with false abstract-type tag under deferDeduplicatedFields
RelayResponseNormalizer's TypeDiscriminator and InlineFragment
normalization paths unconditionally write
'client:__type:<ConcreteType>.__is<Interface>: <hasOwnProperty>'
during payload traversal.
Without deferDeduplicatedFields, this is fine: a missing __isFoo tag
in a normalized payload is a real 'type does not implement Foo'
signal, and the false write is load-bearing so DataChecker can skip
future '... on Foo' selections for that concrete type.
Under Environment({ deferDeduplicatedFields: true }), the same missing
tag can just mean 'delivered earlier in a different chunk of this
operation, dedup'd out of the current chunk'. Writing false in that
case is wrong: it plants a schema-contradicting negative claim in the
type registry, and DataChecker (which treats false as authoritative
non-implementation) then silently skips '... on <Interface>' subtrees
for every future query touching that concrete type — never marking
anything missing, never fetching.
Symptom in our app: after an SSR page load that fetches a defer'd
query, client-navigations to any page that reads a Cloudcast via
'node(id) { ... on Node { ... on Cloudcast ... } }' rendered null for
every field inside — reader saw $isWithinUnmatchedTypeRefinement:true
because DataChecker had marked the query 'available' without ever
fetching, thanks to __type:Cloudcast.__isNode=false written during the
defer'd chunk.
Fix: skip the write when 'hasOwnProperty === false && this
._deferDeduplicatedFields'. When the write is skipped, DataChecker
treats the registry entry as unknown (_implementsInterface == null) →
handles missing → fetches on next check → the response arrives with
the tag → true written normally. Non-dedup environments are
byte-identical to the previous behaviour.
Filed as #5389.1 parent 5bd5328 commit 98b3652
1 file changed
Lines changed: 31 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
292 | 303 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | 304 | | |
299 | 305 | | |
300 | 306 | | |
| |||
402 | 408 | | |
403 | 409 | | |
404 | 410 | | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
411 | 425 | | |
412 | | - | |
413 | 426 | | |
414 | 427 | | |
415 | 428 | | |
| |||
0 commit comments