MCPcopy Create free account
hub / github.com/TanStack/query / App

Function App

examples/solid/basic-graphql-request/src/index.tsx:23–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23function App() {
24 const [postId, setPostId] = createSignal(-1)
25
26 return (
27 <QueryClientProvider client={queryClient}>
28 <SolidQueryDevtools />
29 <p>
30 As you visit the posts below, you will notice them in a loading state
31 the first time you load them. However, after you return to this list and
32 click on any posts you have already visited again, you will see them
33 load instantly and background refresh right before your eyes!{' '}
34 <strong>
35 (You may need to throttle your network speed to simulate longer
36 loading sequences)
37 </strong>
38 </p>
39 {postId() > -1 ? (
40 <Post postId={postId()} setPostId={setPostId} />
41 ) : (
42 <Posts setPostId={setPostId} />
43 )}
44 </QueryClientProvider>
45 )
46}
47
48function createPosts() {
49 return useQuery(() => ({

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected