Skip to content

docs(queries): document the 'cached' result type - #318

Closed
arv wants to merge 1 commit into
mainfrom
arv/docs-cached-result-type
Closed

arv wants to merge 1 commit into
mainfrom
arv/docs-cached-result-type

Conversation

@arv

@arv arv commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Documents the 'cached' result type added in Zero 1.11 (rocicorp/mono#6578). Draft until 1.11 ships, since the feature isn't in a stable release yet.

Changes

  • Partial Data: lists all four values of result.type (unknown, cached, complete, error). The page used to say the only values were complete and unknown.
  • New "Cached Results" subsection:
    • A query whose result the server confirmed during a previous session starts as cached. It becomes complete once the server returns the result in this session, and goes back to unknown if the stored result is evicted first.
    • The section says when a cached result is good enough (showing stored data or an empty state without waiting, including offline) and when to wait for complete.
    • Examples for React, SolidJS and TypeScript.
  • Once: zero.run(query, {type: 'cached'}).
  • For Preloading: what preload() returns (cleanup, complete, cached).
  • assets/search-index.json: regenerated with npm run build:search and Prettier-formatted. The large diff is entries renumbered after the inserted sections.

The behavior follows the commit message and code of rocicorp/mono#6578 (ResultType and RunOptions in zql/src/query, Zero.run and Zero.preload docs).

Checks

  • prettier --check passes on both files.
  • The page compiles as MDX.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RRckJnCeGsYg9nCJSxBgTJ


Generated by Claude Code

Adds a Cached Results section: a query whose result the server confirmed
during a previous session starts as 'cached', becomes 'complete' once the
server returns it in this session, and goes back to 'unknown' if the stored
result is evicted first. Lists all result types, and documents
run({type: 'cached'}) and the cached promise from preload().
@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
zero-docs Ready Ready Preview Oct 14, 2026 2:25pm UTC

Request Review

arv commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

The Verify Signed Commit Authors check fails because of how this PR's only commit (71dfd10) is signed, not because of its content. A cloud Claude Code session signed it with its own SSH key (SHA256:32dP45eSMmVSt/G/CGvcxl/P+MO3Nwj9xeTh/GSA2wc), and that key is not in rocicorp/.github's allowed signers. A re-run won't change the result. The fix is to re-sign the commit with an allowed key:

git fetch origin arv/docs-cached-result-type
git checkout arv/docs-cached-result-type
git commit --amend --no-edit -S
git push --force-with-lease origin arv/docs-cached-result-type

The docs build (Vercel preview) passed.


Generated by Claude Code

@arv arv mentioned this pull request Oct 14, 2026
4 of 7 tasks

arv commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #325, which has all the 1.11 docs and the release notes in one PR. This commit is there unchanged, except that the search index is regenerated once, at the end.


Generated by Claude Code

@arv arv closed this Oct 14, 2026

This branch was successfully deployed

1 active deployment
Preview — 71dfd102 Deployed Oct 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant