getInfiniteQueryKey(...)
The method provides a standardized way to generate QueryKey
the Infinite Queries.
See TanStack Query Keys ๐ด
guide for more information.
const queryKey = api.<service>.<operation>.getInfiniteQueryKey(parameters);
Argumentsโ
-
parameters: { path, query, header } | QueryKey | void
- Required, OpenAPI request parameters for the query, strictly-typed โจ
parameters
will be used to generate theQueryKey
Returnsโ
QueryKey
- a query key for the Infinite Queries
Exampleโ
const queryKey = api.files.getFiles.getInfiniteQueryKey({
header: { 'x-monite-version': '1.0.0' },
query: { id__in: ['1', '2'] },
});
expect(queryKey).toEqual([
{
method: 'get',
url: '/files',
infinite: true // โฌ
๏ธ this is the only difference from the `getQueryKey` method result
},
{
header: { 'x-monite-version': '1.0.0' },
query: { id__in: ['1', '2'] }
}
]);