Skip to main content
Version: 1.x

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 the QueryKey
      • 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'] }
}
]);