@eastsideco/shopify-graphql-schema
v1.0.2
Published
Generated GraphQL Schema files for Shopify's GraphQL APIs.
Readme
@eastsideco/shopify-graphql-schema
Generated GraphQL Schema files for Shopify's GraphQL APIs.
Useful for running codegen against Shopify's GraphQL schema without needing live app credentials to run introspection queries.
Usage
All versions since 2020-01 are supported.
Each version of the Admin API schema is provided under node_modules/@eastsideco/shopify-graphql-schemas/versions/admin/.
Version|Import
-|-
Admin API 2023-01|@eastsideco/shopify-graphql-schema/versions/admin/2023-01.graphql
Admin API 2023-04|@eastsideco/shopify-graphql-schema/versions/admin/2023-04.graphql
Admin API 2023-07|@eastsideco/shopify-graphql-schema/versions/admin/2023-07.graphql
The Storefront API and Payments Apps API are also supported:
Version|Import
-|-
Storefront API 2023-01|@eastsideco/shopify-graphql-schema/versions/storefront/2023-01.graphql
Payments Apps API 2023-01|@eastsideco/shopify-graphql-schema/versions/payments_apps/2023-01.graphql
JSON versions of the schemas (JSON introspection responses) are also available - just change .graphql to .json.
Example using @graphql-codegen/cli
// codegen.ts
import { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: `node_modules/@eastsideco/shopify-graphql-schema/versions/admin/2023-07.graphql`,
documents: ['src/**/*.tsx'],
ignoreNoDocuments: true,
generates: {
'./src/gql/': {
preset: 'client'
}
}
};
export default config;You may need to adjust the schema path to reflect the location of your node_modules folder compared to your codegen.ts.
