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

Function postQueryOptions

e2e/solid-start/basic-solid-query/src/utils/posts.tsx:22–33  ·  view source on GitHub ↗
(postId: string)

Source from the content-addressed store, hash-verified

20 })
21
22export const postQueryOptions = (postId: string) =>
23 queryOptions({
24 queryKey: ['posts', postId],
25 queryFn: async () => {
26 console.info(`Fetching post with id ${postId}...`)
27 await new Promise((r) => setTimeout(r, 500))
28
29 return axios
30 .get<PostType>(`https://jsonplaceholder.typicode.com/posts/${postId}`)
31 .then((r) => r.data)
32 },
33 })

Callers 4

posts.$postId.tsxFile · 0.90
PostComponentFunction · 0.90
PostDeepComponentFunction · 0.90

Calls 3

infoMethod · 0.65
thenMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected