getInfiniteQueryKey(...)
The method provides a standardized way to generate QueryKey
the Infinite Queries.
See TanStack Query Keys ๐ด
guide for more information.
const queryKey = qraft.<service>.<operation>.getInfiniteQueryKey(parameters);
Argumentsโ
-
parameters: { path, query, header } | QueryKey | {}
- Required, OpenAPI request parameters for the query, strictly-typed โจ
parameters
will be used to generate theQueryKey
- If operation does not require parameters, you must pass an empty object
{}
for strictness
Returnsโ
QueryKey
- a query key for the Infinite Queries
Exampleโ
const queryKey = qraft.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'] }
}
]);