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

Function usersQueryOptions

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

Source from the content-addressed store, hash-verified

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

Callers 2

users.tsxFile · 0.90
UsersComponentFunction · 0.90

Calls 4

catchMethod · 0.65
thenMethod · 0.65
getMethod · 0.65
getOriginFunction · 0.50

Tested by

no test coverage detected