TanStackT
TanStack4y ago
3 replies
skinny-azure

Query key returning data from a different hashed query key

I have a query key that looks like this

Key #1
[
  {
    "scope": "user",
    "entity": "list",
    "params": {
      "favoriteColor": "red"
    }
  }
]

Then another key that looks like this
Key #2
[
  {
    "scope": "user",
    "entity": "list",
    "params": {
      "favoriteColor": "red"
      "ages": "12,23,45"
    }
  }
]


When there is a cached entry for #2, that data shows up for #1. Its it also worth noting the #1 is disabled. I am reusing the same hook, but disabling it if there is no 'ages' property. Im expecting data to be undefined because the query is disabled
Was this page helpful?