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

@nordcom/commerce-shopify-graphql
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);
}

FragmentOf ResultOf VariablesOf

Sourcegraphql.ts:156Edit the JSDoc directly
Metadata@nordcom/commerce-shopify-graphql@0.0.0Open in GitHub ↗

On this page