GraphQL
GraphQL
Hooks
Hook
Query
Quick example
import {
useGraphqlGetEscrow,
useGraphqlListEscrows,
} from "@trustless-work/escrow/hooks/graphql";
import { useQuery } from "@tanstack/react-query";
const { getEscrow } = useGraphqlGetEscrow();
const { listEscrows } = useGraphqlListEscrows();
useQuery({
queryKey: ["gql-escrow", contractId],
queryFn: () => getEscrow({ contractId, eventsLimit: 20 }),
enabled: !!contractId,
});
useQuery({
queryKey: ["gql-escrows", "mine"],
queryFn: () => listEscrows({ scope: "mine", limit: 20 }),
});