Major Changes
-
#12478
5ea6a45
Thanks @jerelmiller! - Removevariables
from the result returned fromuseSubscription
. -
#12476
6afff60
Thanks @jerelmiller! - Subscriptions now emit aSubscribeResult
instead of aFetchResult
. As a result, theerrors
field has been removed in favor oferror
. -
#12475
3de63eb
Thanks @jerelmiller! - Unify error behavior on mutations for GraphQL errors and network errors by ensuring network errors are subject to theerrorPolicy
. Network errors created when using anerrorPolicy
ofall
will now resolve the promise and be returned on theerror
property of the result, or stripped away when theerrorPolicy
isnone
. -
#12475
3de63eb
Thanks @jerelmiller! -client.mutate
now returns aMutateResult
instead ofFetchResult
. As a result, theerrors
property has been removed in favor oferror
which is set if either a network error occured or GraphQL errors are returned from the server.useMutation
now also returns aMutateResult
instead of aFetchResult
. -
#12475
3de63eb
Thanks @jerelmiller! - Mutations no longer report errors if the GraphQL result from the server contains an empty array of errors. -
#12476
6afff60
Thanks @jerelmiller! - Unify error behavior on subscriptions for GraphQL errors and network errors by ensuring network errors are subject to theerrorPolicy
. Network errors that terminate the connection will now be emitted on theerror
property passed to thenext
callback followed by a call to thecomplete
callback. -
#12478
5ea6a45
Thanks @jerelmiller! - Remove deprecatedonSubscriptionData
andonSubscriptionComplete
callbacks fromuseSubscription
. UseonData
andonComplete
instead. -
#12476
6afff60
Thanks @jerelmiller! - GraphQL errors or network errors emitted while using anerrorPolicy
ofignore
in subscriptions will no longer emit a result if there is nodata
emitted along with the error. -
#12476
6afff60
Thanks @jerelmiller! - Subscriptions no longer emit errors in theerror
callback and instead provide errors on theerror
property on the result passed to thenext
callback. As a result, errors will no longer automatically terminate the connection allowing additional results to be emitted when the connection stays open.When an error terminates the downstream connection, a
next
event will be emitted with anerror
property followed by acomplete
event instead.
Minor Changes
- #12487
b695e5e
Thanks @phryneas! - Split out SSR-specific code from useQuery hook, remove RenderPromises
Patch Changes
-
#12487
b695e5e
Thanks @phryneas! -useQuery
withssr: false
- previously,skip
had a higher priortity thanssr: false
whilessr: false
had a higher priority thanfetchPolicy: "standby"
(which is roughly equivalent toskip
).This priority has been adjusted so now both
skip
andfetchPolicy: "standby"
have a higher priority thanssr: false
and will returnloading: false
, whilessr: false
will only come after those and will returnloading: true
if those are not set. -
#12475
3de63eb
Thanks @jerelmiller! - Fix an issue where passingonError
touseMutation
would resolve the promise returned by themutate
function instead of rejecting when using anerrorPolicy
ofnone
. -
#12475
3de63eb
Thanks @jerelmiller! - Fix an issue where additional response properties were returned on the result returned fromclient.mutate
, such as@defer
payload fields. These properties are now stripped out to correspond to the TypeScript type.