Skip to content

Commit 4433f0a

Browse files
committed
Link docs, update comments
1 parent a07ca68 commit 4433f0a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/relay-runtime/store/__tests__/RelayModernEnvironment-ExecuteWithDefer-test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,13 @@ describe.each(['RelayModernEnvironment', 'MultiActorEnvironment'])(
313313
});
314314

315315
it('processes deferred payloads with deduplicated fields', () => {
316+
// This functionality prevents Relay from throwing an error when missing
317+
// fields are received in a deferred response. This is required for the
318+
// latest `@defer` spec proposal, which does not send duplicate fields
319+
// in deferred responses. While Relay does not yet attempt to support the latest
320+
// spec proposal (https://github.com/graphql/defer-stream-wg/discussions/69),
321+
// this option allows users to transform responses into a format that Relay
322+
// can accept.
316323
environment = new RelayModernEnvironment({
317324
network: RelayNetwork.create(fetch),
318325
store,

website/docs/api-reference/relay-runtime/relay-environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ Notable options include:
4848
* [`missingFieldHandlers`](../../guided-tour/reusing-cached-data/filling-in-missing-data.md) - A list of handlers that will be called when a field is missing from the store. This can be used to enable fulfilling queries to fields like `Query.node` from cache.
4949
* `getDataID` - A function that will be called to generate a unique ID for a given object. This can be used to customize the way that Relay generates IDs for objects if your server does not implement the [Global Object Identification spec](https://graphql.org/learn/global-object-identification/).
5050
* [`relayFieldLogger`](./field-logger.md) - A function that will be called when Relay encounters a field-level error.
51-
* [`_deferDeduplicatedFields`] - Set to true if you are using the latest `@defer` spec proposal, which does not send duplicate fields in deferred responses.
51+
* `deferDeduplicatedFields` - Set to true if you are using the [latest](https://github.com/graphql/defer-stream-wg/discussions/69) `@defer` spec proposal, which does not send duplicate fields in deferred responses.
5252

5353
For a full list of options, inspect the [provided TypeScript types](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/relay-runtime/lib/store/RelayModernEnvironment.d.ts#L26-L43).

0 commit comments

Comments
 (0)