Skip to content

docs: clarify useLazyQuery data is undefined until trigger - #5348

Open
Hashim1999164 wants to merge 2 commits into
reduxjs:masterfrom
Hashim1999164:docs/clarify-uselazyquery-data-until-trigger
Open

docs: clarify useLazyQuery data is undefined until trigger#5348
Hashim1999164 wants to merge 2 commits into
reduxjs:masterfrom
Hashim1999164:docs/clarify-uselazyquery-data-until-trigger

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • Clarify that useLazyQuery keeps data undefined and the result uninitialized until trigger is called, even when matching cache data already exists.
  • Update the UseLazyQuery JSDoc and the hooks API page Returns section so they match that behavior.

Fixes #4094

Test plan

  • Review the UseLazyQuery summary rendered on the hooks API docs page
  • Confirm the wording matches known lazy-query behavior (no store data until first trigger)

Until trigger runs, the lazy query result stays uninitialized even when
matching cache data already exists. Document that so the JSDoc and hooks
API page match actual behavior.

Fixes reduxjs#4094
@codesandbox

codesandbox Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@netlify

netlify Bot commented Jul 23, 2026

Copy link
Copy Markdown

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit c1f00c1
🔍 Latest deploy log https://app.netlify.com/projects/redux-starter-kit-docs/deploys/6a6a06c5153bbc000803e24e
😎 Deploy Preview https://deploy-preview-5348--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread docs/rtk-query/api/created-api/hooks.mdx Outdated
@aryaemami59 aryaemami59 added Documentation Improvements or additions to documentation RTK-Query Issues related to Redux-Toolkit-Query labels Jul 26, 2026
@aryaemami59 aryaemami59 changed the title docs: clarify useLazyQuery data is undefined until trigger docs: clarify useLazyQuery data is undefined until trigger Jul 26, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

@reduxjs/rtk-codemods

npm i https://pkg.pr.new/@reduxjs/rtk-codemods@c1f00c1 -D
yarn add https://pkg.pr.new/@reduxjs/rtk-codemods@c1f00c1.tgz -D
pnpm add https://pkg.pr.new/@reduxjs/rtk-codemods@c1f00c1.tgz -D
bun add https://pkg.pr.new/@reduxjs/rtk-codemods@c1f00c1.tgz -D

@rtk-query/codegen-openapi

npm i https://pkg.pr.new/@rtk-query/codegen-openapi@c1f00c1 -D
yarn add https://pkg.pr.new/@rtk-query/codegen-openapi@c1f00c1.tgz -D
pnpm add https://pkg.pr.new/@rtk-query/codegen-openapi@c1f00c1.tgz -D
bun add https://pkg.pr.new/@rtk-query/codegen-openapi@c1f00c1.tgz -D

@rtk-query/graphql-request-base-query

npm i https://pkg.pr.new/@rtk-query/graphql-request-base-query@c1f00c1 -D
yarn add https://pkg.pr.new/@rtk-query/graphql-request-base-query@c1f00c1.tgz -D
pnpm add https://pkg.pr.new/@rtk-query/graphql-request-base-query@c1f00c1.tgz -D
bun add https://pkg.pr.new/@rtk-query/graphql-request-base-query@c1f00c1.tgz -D

@reduxjs/toolkit

npm i https://pkg.pr.new/@reduxjs/toolkit@c1f00c1 -D
yarn add https://pkg.pr.new/@reduxjs/toolkit@c1f00c1.tgz -D
pnpm add https://pkg.pr.new/@reduxjs/toolkit@c1f00c1.tgz -D
bun add https://pkg.pr.new/@reduxjs/toolkit@c1f00c1.tgz -D

commit: c1f00c1

@Hashim1999164

Copy link
Copy Markdown
Author

Removed the misleading cache-data clause from both the generated API docs source and the reference docs. The text now states only that the lazy query remains uninitialized with undefined data before the first trigger.

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 RTK-Query Issues related to Redux-Toolkit-Query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RTK Query] Documentation for useLazyQuery's data field

3 participants