Skip to content

refetchQueries is not respecting the enabled option #3642

@APetrovics

Description

@APetrovics

Describe the bug

I have a query that has the enabled option as false, but when a refetchQueries() is executed, the query with enabled false still gets called.

Your minimal, reproducible example

https://codesandbox.io/s/bold-wood-ds6f12?file=/src/index.js

Steps to reproduce

  1. Create a useQuery with enabled option as false
  2. Execute refetchQueries somewhere
  3. See query gets executed

Expected behavior

Query not get executed per the docs...
Screen Shot 2022-05-23 at 12 44 56 PM

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: [iOS, Android]
  • Browser: [Chrome]

react-query version

3.34.6

TypeScript version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions