Tracks

useAllTracksQuery(params?: IApiListQueryParams, queryOptions?: UseQueryOptions): {tracks: ITrack[], ...UseQueryResult}

Used for querying list of all tracks. If no params are provided, it will return list of all tracks existing in the database, which will result in huge request. For pagination/infinite scroll queries, usePaginatedTracksQuery is recommended.

usePaginatedTracksQuery(pageSize? = 20, params?: Pick<IApiListQueryParams, 'filter' | 'orderBy'>, queryOptions?: UseInfiniteQueryOptions): {tracks: ITrack[], totalCount: number | null, ...UseInfiniteQueryResult}

Used for querying list of all tracks in chunks, e.g. for infinity lists. Returns flat tracks array with all fetched items, totalCount and all UseInfiniteQueryResult properties, including fetchNextPage and hasNextPage properties for pagination.

useTrackQuery(idOrSlug: string, queryOptions?: UseQueryOptions): {track: ITrack | null, ...UseQueryResult}

Used for querying details of specific track based on provided id or slug.

Last updated