Skip to content

feat(tanstack-query): re-export getQueryKey from all framework entry points#2748

Merged
ymc9 merged 2 commits into
devfrom
feat/export-get-query-key
Jul 4, 2026
Merged

feat(tanstack-query): re-export getQueryKey from all framework entry points#2748
ymc9 merged 2 commits into
devfrom
feat/export-get-query-key

Conversation

@ymc9

@ymc9 ymc9 commented Jul 4, 2026

Copy link
Copy Markdown
Member

Summary

Re-exports the getQueryKey helper from all three framework entry points of @zenstackhq/tanstack-query (/react, /vue, /svelte), so users can compute ZenStack query keys (e.g., for manual cache invalidation or prefetching) without reaching into internal modules.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • getQueryKey is now publicly available through the React, Svelte, and Vue client packages.
    • Helps provide a consistent way to generate query keys across frameworks.
  • Bug Fixes
    • Improved safety when reading optimisticUpdate during query collection by handling cases where related flags may be missing, preventing potential runtime errors.

…points

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 20f416a0-63bd-452e-ac20-73dcfc5b3967

📥 Commits

Reviewing files that changed from the base of the PR and between 3f92bdf and 134ca41.

📒 Files selected for processing (1)
  • packages/clients/tanstack-query/src/common/client.ts

📝 Walkthrough

Walkthrough

This change re-exports getQueryKey from three tanstack-query entry points and updates getAllQueries to handle a missing parsed.flags value safely.

Changes

tanstack-query API surface and client safety

Layer / File(s) Summary
Add getQueryKey re-exports
packages/clients/tanstack-query/src/react.ts, packages/clients/tanstack-query/src/svelte/index.svelte.ts, packages/clients/tanstack-query/src/vue.ts
Each entry point re-exports getQueryKey from ./common/query-key.js or its relative equivalent.
Guard optimisticUpdate flag access
packages/clients/tanstack-query/src/common/client.ts
getAllQueries reads optimisticUpdate with optional chaining on parsed.flags instead of direct property access.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: re-exporting getQueryKey from the React, Vue, and Svelte entry points.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/export-get-query-key

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ymc9 ymc9 merged commit ad4ea73 into dev Jul 4, 2026
8 checks passed
@ymc9 ymc9 deleted the feat/export-get-query-key branch July 4, 2026 21:26
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