```js // YourPage.js|jsx import { useQuery, gql } from '@apollo/client'; import { PageLayout } from './PageLayout'; import { DocumentHeader } from './DocumentHeader'; import { DocumentList } from './DocumentList'; const AllInfoQuery = gql` query AllInfo { user { userID name } document { id userID title brief status } subdocuments { id userID title content status } } `; function useFetchInfo() { const { loading, error, data } = useQuery(AllInfoQuery); return { loading, error, data }; } export function DocumentScreen() { const { loading, error, data } = useFetchInfo(); if (loading) { return
Loading...
; } if (error) { returnThere was an error fetching the data!
; } return (