-
Use type imports in generated file (
import type
instead ofimport
). (#2094) by @frandiox -
Import schemas from
@shopify/hydrogen
instead of@shopify/hydrogen-react
to avoid dependency issues in some situations. (#2086) by @frandiox
- Extract Codegen features into an agnostic
@shopify/graphql-codegen
package.@shopify/hydrogen-codegen
now simply wraps this package with a set of Hydrogen defaults. (#1799) by @frandiox
-
Removed the
patchGqlPluck
named export from the main entrypoint. (#1108) by @frandioxAdded
@shopify/hydrogen-codegen/patch
entrypoint that automatically patches the necessary files. This is applied automatically by Hydrogen CLI. If you're using thegraphql-codegen
CLI directly, you can either run it as a Node loader withnode -r @shopify/hydrogen-codegen/patch node_modules/.bin/graphql-codegen
or import it in yourcodegen.ts
file before anything else:import '@shopify/hydrogen-codegen/patch'; import {preset, schema, pluckConfig} from '@shopify/hydrogen-codegen'; export default { overwrite: true, pluckConfig, generates: { 'storefrontapi.generated.d.ts': { preset, schema, documents: ['...'], }, }, };
-
Add support for codegen in JavaScript projects with JSDoc. (#1334) by @frandiox (#1464) by @wizardlyhel
-
Merge equal fragment interfaces in one to avoid adding
| {}
to the Metaobject types. (#978) by @frandiox -
The preset now accepts options to modify the default behavior. (#970) by @frandiox
type HydrogenPresetConfig = { namespacedImportName?: string; importTypesFrom?: string; importTypes?: boolean; skipTypenameInOperations?: boolean; interfaceExtension?: (options) => string; };