Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Add skip condition on endpoint definition #4813

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SYoder1
Copy link

@SYoder1 SYoder1 commented Jan 13, 2025

Adds a skip condition function to the endpoint definition to "skip" making the network request when returned true. Instead of needing to set the skip on every query hook it can be applied at a more global layer.

In order to keep isUninitialized set to true, the same way it works with skip on the hook, I needed to add a check for it in the useQuery hook.

Closes #4810

Copy link

codesandbox bot commented Jan 13, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

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 36fde17:

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

Copy link

netlify bot commented Jan 13, 2025

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

Name Link
🔨 Latest commit 36fde17
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/678565f4d5b2c00008b8f917
😎 Deploy Preview https://deploy-preview-4813--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 site configuration.

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: Conditionally skip the query from the endpoints definition for hooks
1 participant