ResultOf

shopify-graphql · /index·type

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 than manually spelling out the response shape.

Definition

@nordcom/commerce-shopify-graphql
type ResultOf = GqlResultOf<TDoc>;

GqlResultOf<TDoc>

Example

import { graphql, ResultOf } from '@nordcom/commerce-shopify-graphql';

const PRODUCT_QUERY = graphql(`
  query product($handle: String!) {
    product(handle: $handle) { id title }
  }
`);

type ProductResult = ResultOf<typeof PRODUCT_QUERY>;
// { product: { id: string; title: string } | null }

FragmentOf TadaDocumentNode VariablesOf

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

On this page