-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Set loading: false
with cache-only
queries with no data in the cache
#12705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: b1e1358 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized we should probably test a cache-only
query with a local resolver. Local resolvers are async so that might be the only case where we see a loading: true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! Generally I'm pretty sure it wouldn't cause a loading state, since we only take link/network asynchronity into account for the loading state, but please go ahead and add a test to document that :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. cache-only
will only return cached data for local fields, so local resolvers are never run. This is at least now documented in a test! This means that cache-only
queries will never return a loading: true
state. I'm happy with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! Generally I'm pretty sure it wouldn't cause a loading state, since we only take link/network asynchronity into account for the loading state, but please go ahead and add a test to document that :)
a10a9a2
to
9775f78
Compare
Supersedes #12021
Sets the initial
loading
state tofalse
for acache-only
query when no data is in the cache.