You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the generated query key functions with an API that has paginated queries. Here's an example of one generated query key function from our project:
As seen above, the query key generated by the functions is an array with two items like ['SecretsServiceGetSecretsByOrganizationId', { limit: 10, offset, 2, organizationId: 7 }].
The situation where this is unwanted is where I often want to invalidate queries using one of the parameters and disregarding all pagination parameters. With the generated query key function, I can't do that as the parameter I want to use for cache invalidation (organizationId) is in the same object as the pagination parameters.
Best format for generated query key for me would be something where the pagination parameters are separated from rest, which for the above query would be something like ['SecretsServiceGetSecretsByOrganizationId', 7, { limit: 10, offset, 2 }]. I believe this would require knowledge of the names of pagination parameters at generation time, so a flat list without objects would also work.
The text was updated successfully, but these errors were encountered:
I'm using the generated query key functions with an API that has paginated queries. Here's an example of one generated query key function from our project:
As seen above, the query key generated by the functions is an array with two items like
['SecretsServiceGetSecretsByOrganizationId', { limit: 10, offset, 2, organizationId: 7 }]
.The situation where this is unwanted is where I often want to invalidate queries using one of the parameters and disregarding all pagination parameters. With the generated query key function, I can't do that as the parameter I want to use for cache invalidation (
organizationId
) is in the same object as the pagination parameters.Best format for generated query key for me would be something where the pagination parameters are separated from rest, which for the above query would be something like
['SecretsServiceGetSecretsByOrganizationId', 7, { limit: 10, offset, 2 }]
. I believe this would require knowledge of the names of pagination parameters at generation time, so a flat list without objects would also work.The text was updated successfully, but these errors were encountered: