apollographql / apollographql/apollo-client-devtools
[Idea] Automatically enable load from cache in explorer if query contains client-only fields
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 172
- Avg merge
- 10m
- Merged PRs (30d)
- 8
Description

The experience of running queries with client-only fields in embedded explorer has some room for improvement:
- field triggers a red squiggle because we're dealing with the introspected schema
- client-only fields can only be fetched from the cache, so by default they won't appear in the response unless you see and then tick the 'load from cache' checkbox
An easy win might just be automatically enabling 'load from cache' for queries with these fields, but there's a tradeoff with potentially stale data being returned for other fields which may not be acceptable if the user is expecting it to hit the network.
Happy to eventually move this issue elsewhere but tracking it here for now.
Contributor guide
Research direction
Start by locating the embedded explorer's handling of client-only fields and the “load from cache” checkbox. Reproduce a query containing a client-only field and examine how cache loading currently affects the response. Done requires an agreed behavior for stale network fields as well as coverage for the selected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100