MCPcopy
hub / github.com/TanStack/query / createPost

Function createPost

examples/solid/basic/src/index.tsx:90–96  ·  view source on GitHub ↗
(postId: number)

Source from the content-addressed store, hash-verified

88}
89
90function createPost(postId: number) {
91 return useQuery(() => ({
92 queryKey: ['post', postId],
93 queryFn: () => getPostById(postId),
94 enabled: !!postId,
95 }))
96}
97
98function Post(props: { postId: number; setPostId: Setter<number> }) {
99 const state = createPost(props.postId)

Callers 1

PostFunction · 0.70

Calls 2

useQueryFunction · 0.90
getPostByIdFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…