docs/framework/solid/guides/query-keys.md
// A list of todos
useQuery(() => ({ queryKey: ['todos'], ... }))
// Something else, whatever!
useQuery(() => ({ queryKey: ['something', 'special'], ... }))
// An individual todo
useQuery(() => ({ queryKey: ['todo', 5], ... }))
// An individual todo in a "preview" format
useQuery(() => ({ queryKey: ['todo', 5, { preview: true }], ...}))
// A list of todos that are "done"
useQuery(() => ({ queryKey: ['todos', { type: 'done' }], ... }))
useQuery(() => ({ queryKey: ['todos', { status, page }], ... }))
useQuery(() => ({ queryKey: ['todos', { page, status }], ...}))
useQuery(() => ({ queryKey: ['todos', { page, status, other: undefined }], ... }))
useQuery(() => ({ queryKey: ['todos', status, page], ... }))
useQuery(() => ({ queryKey: ['todos', page, status], ...}))
useQuery(() => ({ queryKey: ['todos', undefined, page, status], ...}))
function Todos(props) {
const todosQuery = useQuery(() => ({
queryKey: ['todos', props.todoId],
queryFn: () => fetchTodoById(props.todoId),
}))
}