useGraphqlGetEscrow
useGraphqlGetEscrow
Import
import { useGraphqlGetEscrow } from "@trustless-work/escrow/hooks/graphql";Signature
function useGraphqlGetEscrow(): {
getEscrow: (variables: GraphqlGetEscrowVariables) => Promise</* GraphqlEscrow */>;
};{
contractId: string;
eventsLimit?: number;
eventsCursor?: string;
eventsOrder?: "asc" | "desc";
}Example
import { useGraphqlGetEscrow } from "@trustless-work/escrow/hooks/graphql";
import { useQuery } from "@tanstack/react-query";
const { getEscrow } = useGraphqlGetEscrow();
const { data } = useQuery({
queryKey: ["gql-escrow", contractId, { eventsLimit: 20 }],
queryFn: () =>
getEscrow({
contractId,
eventsLimit: 20,
eventsOrder: "desc",
}),
enabled: !!contractId,
});