Skip to content

Instantly share code, notes, and snippets.

@liamgriffin
Created July 19, 2023 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save liamgriffin/9a705fdeffff2cefdb1985d209b7eff0 to your computer and use it in GitHub Desktop.
Save liamgriffin/9a705fdeffff2cefdb1985d209b7eff0 to your computer and use it in GitHub Desktop.
Example of how to configure the generator for codegen
// <root>/codegen.ts
import type {CodegenConfig} from '@graphql-codegen/cli';
import {preset, pluckConfig, schema} from '@shopify/hydrogen-codegen';
export default <CodegenConfig>{
overwrite: true,
pluckConfig,
generates: {
['storefrontapi.d.ts']: {
schema,
preset,
documents: ['app/**/*.{ts,tsx}', 'server.ts'],
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment