When there is a defaultOptions.watchQuery.fetchPolicy
defined, useQuery
doesn't return data
when skip
changes from true
to false
#9717
Labels
Intended outcome:
When toggling the
skip
option fromtrue
tofalse
inuseQuery
it returnsdata
with content.Actual outcome:
After setting the option
skip: true
, the query is skipped forever, even if we update skip tofalse
and change the query variables.Not sure if it is related, but by logging what we receive on
nextFetchPolicy
theinitialFetchPolicy
andlastFetchPolicy
are set asstandby
and notcache-and-network
orcache-first
which were the configured options in the client.How to reproduce the issue:
defaultOptions.watchQuery.fetchPolicy
when creating theApolloClient
skip: false
skip: true
undefined
as expectedskip: false
undefined
I've created an reproduction example in codesandbox:
https://codesandbox.io/s/apollo-client-3-6-2-usequery-doesnt-return-data-when-skip-changes-from-true-to-false-vz14mp?file=/src/index.js
Versions
In the codesandbox
In my local reproduction
The text was updated successfully, but these errors were encountered: