import { gql, type TypedDocumentNode } from "@apollo/client"; import { useQuery } from "@apollo/client/react"; interface Data { user: { address: string; fullName: string; }; } const PRIVATE_QUERY: TypedDocumentNode> = gql` "Returns private user information" query Private @tool { user @private { fullName address } } `; export function Private() { const { data, dataState } = useQuery(PRIVATE_QUERY); if (dataState !== "complete") { return
Loading...
; } return (
{data.user.fullName}
{data.user.address}
); }