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

Function userQueryOptions

e2e/react-start/basic-react-query/src/utils/users.tsx:27–37  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

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

Callers 2

users.$userId.tsxFile · 0.90
UserComponentFunction · 0.90

Calls 3

catchMethod · 0.65
thenMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected