apollographql / apollographql/apollo-client-devtools

[Idea] Automatically enable load from cache in explorer if query contains client-only fields

Open
#1,393 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
172
Avg merge
10m
Merged PRs (30d)
8

Description

![CleanShot 2024-05-29 at 15 53 28](https://github.com/apollographql/apollo-client-devtools/assets/5139846/bd44dc84-2551-4dab-92ba-923989be1883)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.