docs(client): urql client review findings and remediation blueprint - #4437
Draft
gilgardosh wants to merge 24 commits into
Draft
gilgardosh wants to merge 24 commits into
gilgardosh wants to merge 24 commits into
Conversation
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 15:57 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 15:57 — with
GitHub Actions
Inactive
Contributor
|
The latest changes of this PR are not available as |
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 16:03 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 16:04 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new docs include at least one verified incorrect metric (TODO occurrence count) and a small internal inconsistency in Step 0 wording that should be corrected for accuracy.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Documentation-only PR that records an urql usage review for packages/client and a phased remediation blueprint, intended as a single reference point for follow-up implementation PRs.
Changes:
- Added a detailed findings write-up covering current urql client configuration, usage patterns, and observed pain points.
- Added an implementation blueprint with staged steps, verification strategy, and test guidance for the planned remediation sequence.
File summaries
| File | Description |
|---|---|
| docs/urql-client-review/findings.md | Adds the urql client findings report and supporting evidence/metrics. |
| docs/urql-client-review/blueprint.md | Adds a step-by-step remediation plan with sequencing rationale and verification guidance. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+31
to
+32
| entirely, so the app runs with no cache. `TODO: add local data update method after change` appears | ||
| **72 times** in `src/hooks/`. |
|
|
||
| ## Step 0 — Establish a green baseline | ||
|
|
||
| **No source changes.** Purely: can this environment run the suite? |
Comment on lines
+70
to
+72
| The codebase is aware of this: `TODO: add local data update method after change` appears **72 | ||
| times** in `src/hooks/`, and `docs/all-charges-performance-boost/findings.md` already names the | ||
| missing `cacheExchange`. |
Records a review of urql usage across `packages/client` — 127 `useQuery` call sites, 104 `useMutation` call sites, 318 GraphQL documents in 294 files — and the phased plan derived from it. `findings.md` documents the architectural gap underneath most of the issues found: the client is constructed with an explicit `exchanges` array that omits `cacheExchange` (`providers/urql.tsx:230`), and urql installs its defaults only when `exchanges` is omitted entirely. The app therefore runs with no cache, and the hand-rolled substitutes are catalogued — the charge refresh registry, 64 `onChange` prop chains, 25 ceremonial `network-only` policies, and the deep-equality reference shims. `blueprint.md` sequences the mechanical fixes as ten steps with a status table, each with its test anchor identified up front. Documentation only; no package or source changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
gilgardosh
force-pushed
the
claude/urql-review-docs
branch
from
September 10, 2026 16:05
202c649 to
77a2df1
Compare
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 16:05 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 16:06 — with
GitHub Actions
Inactive
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 16:08 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 16:08 — with
GitHub Actions
Inactive
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 16:12 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 16:12 — with
GitHub Actions
Inactive
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 16:15 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 16:15 — with
GitHub Actions
Inactive
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 17:33 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 17:33 — with
GitHub Actions
Inactive
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 17:37 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 17:38 — with
GitHub Actions
Inactive
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 17:45 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
September 10, 2026 17:45 — with
GitHub Actions
Inactive
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
All ten steps merged. Verified on main: 378 tests passing, lint clean, tsc --noEmit clean, production build green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft, for tracking and reference only — not intended to merge.
This PR is not part of the implementation stack. It holds the review and the plan in one place so the per-step PRs have something to link back to.
What's here
docs/urql-client-review/findings.md— the review itself. 127useQuerycall sites, 104useMutationcall sites, 318 GraphQL documents across 294 files.docs/urql-client-review/blueprint.md— the phased remediation plan, with a status table tracking each step's PR.The headline finding
packages/client/src/providers/urql.tsx:230constructs the client with an explicitexchangesarray:urql installs its default
[cacheExchange, fetchExchange]only whenexchangesis omitted entirely. Because an explicit array is supplied andcacheExchangeis absent, the app runs with no document cache and no normalized cache — every mount is a network round-trip.Most other findings are hand-rolled substitutes for that missing cache:
onChangeprop-drillingproviders/charge-refresh.tsxadditionalTypenamesnetwork-onlyre-executionOperationContextinto 3 components' propsuse-stable-value.ts, per-rowJSON.stringifyincharges-row.tsxdataobject per fetchadditionalTypenamesis used 0 times — it does nothing without a cache.TODO: add local data update method after changeappears 72 times insrc/hooks/.What the codebase gets right
Worth recording, because the fundamentals are strong: codegen
client-presetwith fragment masking on and genuinely colocated fragments, 100% mutation-hook discipline (zerouseMutationincomponents/),@deferin production, a real N+1 fix in the charges table, and multipart uploads working with no extra configuration.Planned sequence
Ten steps, each its own PR, stacked while the previous is unmerged. Steps 1–7 change no dependencies and need no
yarn generate. The agreed direction for the follow-up phase is@urql/exchange-graphcache(normalized), not a document cache.Notes
id, andcontracts.tsxhas no loader wired at all.🤖 Generated with Claude Code
https://claude.ai/code/session_01TbrGL3NndzRiEwJkwHxnbm
Generated by Claude Code