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

Function getPostById

examples/solid/basic/src/index.tsx:83–88  ·  view source on GitHub ↗
(id: number)

Source from the content-addressed store, hash-verified

81}
82
83const getPostById = async (id: number): Promise<Post> => {
84 const response = await fetch(
85 `https://jsonplaceholder.typicode.com/posts/${id}`,
86 )
87 return await response.json()
88}
89
90function createPost(postId: number) {
91 return useQuery(() => ({

Callers 1

createPostFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…