Minor Changes
- Improve the Suspense implementation, which fixes edge-cases when Suspense is used with subscriptions, partially disabled, or used on the client-side. It has now been ensured that client-side suspense functions without the deprecated
suspenseExchange
and uncached results are loaded consistently. As part of this work, theClient
itself does now never throw Suspense promises anymore, which is functionality that either way has no place outside of the React/Preact bindings, by @kitten (See #1123)
Patch Changes
- Use
Record
overobject
type for subscription operation variables. Theobject
type is currently hard to use (see this issue), by @enisdenjo (See #1119) - Add support for
TypedDocumentNode
to infer the type of theOperationResult
andOperation
for all methods, functions, and hooks that either directly or indirectly accept aDocumentNode
. Seegraphql-typed-document-node
and the corresponding blog post for more information., by @kitten (See #1113) - Refactor
useSource
hooks which powersuseQuery
anduseSubscription
to improve various edge case behaviour. This will not change the behaviour of these hooks dramatically but avoid unnecessary state updates when any updates are obviously equivalent and the hook will furthermore improve continuation from mount to effects, which will fix cases where the state between the mounting and effect phase may slightly change, by @kitten (See #1104)