Skip to content

Only run transformResponse when a query is used#5049

Merged
markerikson merged 1 commit into
masterfrom
bugfix/4940-transformresponse
Aug 2, 2025
Merged

Only run transformResponse when a query is used#5049
markerikson merged 1 commit into
masterfrom
bugfix/4940-transformresponse

Conversation

@markerikson

Copy link
Copy Markdown
Collaborator

This PR:

  • Fixes the logic in executeEndpoint to only run a provided transformResponse callback when the endpoint's query method is used, not when there's an upsertQueryData call or a queryFn field.

This fixes a regression introduced in #4738 as part of the thunk restructuring to enable infinite queries.

Fixes #4940

@codesandbox

codesandbox Bot commented Aug 2, 2025

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@codesandbox-ci

codesandbox-ci Bot commented Aug 2, 2025

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d075d6c:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

@markerikson markerikson force-pushed the bugfix/4940-transformresponse branch from 5353807 to d075d6c Compare August 2, 2025 18:38
@github-actions

github-actions Bot commented Aug 2, 2025

Copy link
Copy Markdown

size-limit report 📦

Path Size
1. entry point: @reduxjs/toolkit/query/react (modern.mjs) 15.05 KB (+0.04% 🔺)
1. entry point: @reduxjs/toolkit/query (cjs, production.min.cjs) 24.08 KB (+0.17% 🔺)
1. entry point: @reduxjs/toolkit/query/react (cjs, production.min.cjs) 26.44 KB (+0.08% 🔺)
2. entry point: @reduxjs/toolkit/query (without dependencies) (cjs, production.min.cjs) 10.77 KB (+0.1% 🔺)
3. createApi (.modern.mjs) 15.46 KB (+0.01% 🔺)
3. createApi (react) (.modern.mjs) 17.46 KB (+0.04% 🔺)

@netlify

netlify Bot commented Aug 2, 2025

Copy link
Copy Markdown

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

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

QR Code

Use your smartphone camera to open QR code link.

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

@netlify

netlify Bot commented Aug 2, 2025

Copy link
Copy Markdown

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

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

QR Code

Use your smartphone camera to open QR code link.

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

@markerikson markerikson merged commit d8190e3 into master Aug 2, 2025
163 of 164 checks passed
@aryaemami59 aryaemami59 deleted the bugfix/4940-transformresponse branch March 18, 2026 07:55
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.

[RTK Query] api.util.upsertQueryData not work correctly when has transformResponse

1 participant