Open History to see the last commit
1import { queryOptions } from '@tanstack/solid-query'
2import { charactersAPI } from './api'
3β
4export const charactersQueries = {
5 all: () => ['characters'] as const,
6 detail: (id: number) =>
7 queryOptions({
8 queryKey: [...charactersQueries.all(), 'detail', id] as const,
9 queryFn: () => charactersAPI.getCharacter(id),
10 staleTime: 60 * 1000,
11 }),
12}