MCPcopy Create free account
hub / github.com/TanStack/router / usersQueryOptions

Function usersQueryOptions

e2e/solid-start/basic-solid-query/src/utils/users.tsx:15–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13export const DEPLOY_URL = `http://localhost:${PORT}`
14
15export const usersQueryOptions = () =>
16 queryOptions({
17 queryKey: ['users'],
18 queryFn: () =>
19 axios
20 .get<Array<User>>(DEPLOY_URL + '/api/users')
21 .then((r) => r.data)
22 .catch(() => {
23 throw new Error('Failed to fetch users')
24 }),
25 })
26
27export const userQueryOptions = (id: string) =>
28 queryOptions({

Callers 2

users.tsxFile · 0.90
UsersComponentFunction · 0.90

Calls 3

catchMethod · 0.65
thenMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected