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

Function App

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

Source from the content-addressed store, hash-verified

13const queryClient = new QueryClient()
14
15function App() {
16 const [postId, setPostId] = createSignal<string | null>(null)
17
18 return (
19 <QueryClientProvider client={queryClient}>
20 <SolidQueryDevtools />
21 <p>
22 As you visit the posts below, you will notice them in a loading state
23 the first time you load them. However, after you return to this list and
24 click on any posts you have already visited again, you will see them
25 load instantly and background refresh right before your eyes!{' '}
26 <strong>
27 (You may need to throttle your network speed to simulate longer
28 loading sequences)
29 </strong>
30 </p>
31 <Show when={postId()} fallback={<Posts setPostId={setPostId} />}>
32 {(id) => <Post postId={id()} setPostId={setPostId} />}
33 </Show>
34 </QueryClientProvider>
35 )
36}
37
38function Posts(props: { setPostId: Setter<string | null> }) {
39 const state = useQuery(() => postsQueries.list())

Callers

nothing calls this directly

Calls 1

idFunction · 0.85

Tested by

no test coverage detected