TanStackT
TanStack2y ago
2 replies
brilliant-lime

Query invalidation problem

I have an (infinite) query with the key: ["structure", "detail", projectId, parentFolderId, searchParams] where parentFolderId can be string or undefined.

One example of such a query key that's stored in the cache is:
[
  "structure",
  "detail",
  "73f3037b-bad3-47df-9f03-aa207164c2df",
  null,
  {}
]


I do query invalidation with this exact same key after some mutation succeds, but for some reason this query doesn't get invalidated. Is the problem possibly with the
null
value?

(oh also one more question while I'm at it, it appears that the optional parameter, parentFolderId automatically gets converted to null when I don't pass anything)
Was this page helpful?