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

Function userQueryOptions

e2e/solid-start/basic-solid-query/src/utils/users.tsx:28–38  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

26 })
27
28export const userQueryOptions = (id: string) =>
29 queryOptions({
30 queryKey: ['users', id],
31 queryFn: () =>
32 axios
33 .get<User>(getOrigin() + '/api/users/' + id)
34 .then((r) => r.data)
35 .catch(() => {
36 throw new Error('Failed to fetch user')
37 }),
38 })

Callers 2

users.$userId.tsxFile · 0.90
UserComponentFunction · 0.90

Calls 4

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

Tested by

no test coverage detected