Skip to content

invalidateQueries doesn't work when enabled attribute is set to false #947

Closed
@sayinserdar

Description

@sayinserdar

queryCache.invalidateQueries() function doesn't work if the related useQuery definition has { enabled: false } configuration.

Here is the definition of my 'menus'
Screen Shot 2020-09-01 at 12 49 46 PM

If I try to create a new 'menu', invalidateQueries works as expected
Screen Shot 2020-09-01 at 12 51 13 PM

But if I add a configuration as { enabled: false} as in the below image invalidateQueries function doesn't work
Screen Shot 2020-09-01 at 12 50 01 PM

I've spent too many hours on this issue. I changed every other details/configuration but nothing helped. I also tried my other queryKeys other than 'menus' but the problem remains. In my case, it's not a big deal to remove the { enable: false } configuration but is this the expected output ?

  • OS: macOS
  • Browser: Any browser
  • 10.15.3

React Query - v2.12.1
React Query Developer Tools - v2.3.2

Apart from this issue React Query has been smooth and wonderful. Thanks everyone who contributes this project.
Peace

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