TadaDocumentNode
●shopify-graphql · /index·type
Document node type that carries both result and variables type parameters end-to-end.
Use it to type function parameters that accept any graphql()-produced document,
preserving full type inference for both the result and variables at the call site.
Definition
type TadaDocumentNode = GqlTadaDocumentNode<TResult, TVariables, TDecoration>;GqlTadaDocumentNode<TResult, TVariables, TDecoration>
Example
import { TadaDocumentNode } from '@nordcom/commerce-shopify-graphql';
function execute<TResult, TVariables>(
doc: TadaDocumentNode<TResult, TVariables>,
vars: TVariables
): Promise<TResult> {
return client.query(doc, vars).then(({ data }) => data);
}Related
FragmentOf ResultOf VariablesOf
ResultOf
Typed shape returned by an Apollo execution of a graphql() document. Reach for it to type the resolved data of a query or mutation in storefront code, rather th
VariablesOf
Typed variables shape required to execute a given graphql() document. Use it to type the variables object passed to Apollo's useQuery or client.query so argumen