Skip to content

docs(angular-query): fix error in code snippet#9645

Merged
arnoud-dv merged 1 commit intoTanStack:mainfrom
arnoud-dv:docs/fix-missing-this
Sep 11, 2025
Merged

docs(angular-query): fix error in code snippet#9645
arnoud-dv merged 1 commit intoTanStack:mainfrom
arnoud-dv:docs/fix-missing-this

Conversation

@arnoud-dv
Copy link
Copy Markdown
Collaborator

@arnoud-dv arnoud-dv commented Sep 11, 2025

Summary by CodeRabbit

  • Documentation
    • Corrected the Angular guide example for placeholder data to properly reference the injected client, resolving a scoping issue and ensuring the snippet works as intended.
    • Clarified the steps for retrieving cached blog posts and selecting by post ID.
    • No changes to public APIs.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 11, 2025

Walkthrough

Updated an Angular docs snippet to use the class-injected QueryClient via this.queryClient in BlogPostComponent’s placeholderData function, ensuring correct property access while keeping the existing logic for getQueryData(['blogPosts']) and matching by this.postId().

Changes

Cohort / File(s) Summary
Docs update
docs/framework/angular/guides/placeholder-query-data.md
Adjusted code snippet to reference this.queryClient instead of queryClient in placeholderData, preserving the rest of the logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

documentation

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "docs(angular-query): fix error in code snippet" succinctly and accurately captures the PR's primary change—correcting a scoping/availability bug in an Angular documentation code snippet. It is concise, scoped to the docs package, and clear enough for a reviewer scanning history to understand the main intent.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

A nibble of docs, a hop through the code,
I twitched my whiskers, found the proper node.
this.queryClient, neat and tight,
Now the posts appear just right.
Thump-thump—approved! 🥕✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f0e716 and 1599366.

📒 Files selected for processing (1)
  • docs/framework/angular/guides/placeholder-query-data.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Preview
  • GitHub Check: Test
🔇 Additional comments (1)
docs/framework/angular/guides/placeholder-query-data.md (1)

48-51: Correct fix: use this.queryClient

Using this.queryClient ensures proper instance property access inside the class method. Looks good.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 11, 2025
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Sep 11, 2025

View your CI Pipeline Execution ↗ for commit 1599366

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 48s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-11 23:27:40 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Sep 11, 2025

More templates

@tanstack/angular-query-devtools-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@9645

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@9645

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@9645

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@9645

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@9645

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@9645

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@9645

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@9645

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@9645

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@9645

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@9645

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@9645

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@9645

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@9645

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@9645

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@9645

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@9645

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@9645

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@9645

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@9645

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@9645

commit: 1599366

@arnoud-dv arnoud-dv merged commit 2492ed1 into TanStack:main Sep 11, 2025
6 checks passed
@arnoud-dv arnoud-dv deleted the docs/fix-missing-this branch September 11, 2025 23:31
Hellol77 pushed a commit to Hellol77/query that referenced this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant