VariablesOf
●shopify-graphql · /index·type
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 argument mismatches are caught at compile time.
Definition
type VariablesOf = GqlVariablesOf<TDoc>;GqlVariablesOf<TDoc>
Example
import { graphql, VariablesOf } from '@nordcom/commerce-shopify-graphql';
const PRODUCT_QUERY = graphql(`
query product($handle: String!) {
product(handle: $handle) { id title }
}
`);
type ProductVars = VariablesOf<typeof PRODUCT_QUERY>;
// { handle: string }Related
FragmentOf ResultOf TadaDocumentNode