Closed SangJunBak closed 10 months ago
Hi @SangJunBak, from what I can see this should be already possible with the current API:
const keys = createQueryKeys('region', {
todos: {
queryKey: null,
contextQueries: {
detail: (id) => ({
queryKey: [id],
{...}
}),
list: (filters) => {...}
}
},
}
LMK if I'm missing something
Ah I didn't realize you can next context queries within context queries. Thanks for the help!
It seems like the current API exposes only three levels of nesting (the definition for createQueryKeys, the sub-queries defined in createQueryKeys's schema, and the contextQueries property).
Assuming I want to generate the following nested query key structure:
And I want to compose
todos
andusers
using createQueryKey. Is it possible to do something like:?
Ideally I want the API when getting the keys to look like: