Skip to main content
Version: 2.x ๐Ÿšง

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 the QueryKey

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