+ {data?.pages.map((page, i) => (
+
+ {page.users.map(user => (
+
{user.name}
+ ))}
+
+ ))}
+
+
+ {isFetchingNextPage && 'Loading more...'}
+
+
+ )
+}
+```
+
+### **Dependent Queries**
+
+```tsx
+function UserPosts({ userId }: { userId: string }) {
+ // First, fetch the user
+ const { data: user } = queryClient.useQuery(
+ 'get',
+ '/users/{id}',
+ { params: { id: userId } }
+ )
+
+ // Then fetch posts, but only if user is loaded
+ const { data: posts } = queryClient.useQuery(
+ 'get',
+ '/posts',
+ { query: { userId } },
+ {
+ enabled: !!user, // Only run this query if user exists
+ }
+ )
+
+ return (
+