Files
test/app/queries/todos.ts
AlucardDev 7d4ff5962c
Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
first commit
2026-08-28 23:32:07 +03:00

11 lines
396 B
TypeScript

import { defineQueryOptions } from '@pinia/colada'
export const todosQuery = defineQueryOptions({
key: ['todos'],
// NOTE: the cast sometimes avoids an "Excessive depth check" TS error
// using $fetch directly doesn't avoid the round trip to the server
// when doing SSR
// https://github.com/nuxt/nuxt/issues/24813
query: () => useRequestFetch()('/api/todos') as Promise<Todo[]>
})