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