Open History to see the last commit
1import { queryOptions } from '@tanstack/react-query'
2import { locationsAPI } from './api'
3β
4export const locationsQueries = {
5 all: () => ['locations'] as const,
6 detail: (locationId: string) =>
7 queryOptions({
8 queryKey: [...locationsQueries.all(), 'detail', locationId] as const,
9 queryFn: () => locationsAPI.getLocation(locationId),
10 }),
11}