Skip to content

Commit 5eaefc1

Browse files
committed
fix(codegen): resolve pnpm phantom dependency issue in typed-queries
- Re-export TypedDocumentNode type from the package - Generated code imports from codegen package instead of @graphql-typed-document-node/core - Works correctly with pnpm's strict dependency resolution
1 parent 4ea4d39 commit 5eaefc1

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@universal-data-layer/codegen-typed-queries': patch
3+
---
4+
5+
Fix pnpm phantom dependency issue with TypedDocumentNode
6+
7+
- Re-export `TypedDocumentNode` type from the package so users don't need to install `@graphql-typed-document-node/core` directly
8+
- Generated code now imports from `@universal-data-layer/codegen-typed-queries` instead of `@graphql-typed-document-node/core`
9+
- Works correctly with pnpm's strict dependency resolution

packages/codegen-typed-queries/src/generator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ export class QueryDocumentGenerator {
174174
// File header
175175
lines.push(this.generateHeader());
176176

177-
// Imports
177+
// Imports - use codegen package to avoid pnpm phantom dependency issues
178178
lines.push(
179-
"import type { TypedDocumentNode } from '@graphql-typed-document-node/core';"
179+
"import type { TypedDocumentNode } from '@universal-data-layer/codegen-typed-queries';"
180180
);
181181
lines.push('');
182182

packages/codegen-typed-queries/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,7 @@ export {
6767
type QueryDocumentGeneratorOptions,
6868
type DiscoveredQuery,
6969
} from './generator.js';
70+
71+
// Re-export TypedDocumentNode so generated code can import from this package
72+
// This avoids pnpm phantom dependency issues
73+
export type { TypedDocumentNode } from '@graphql-typed-document-node/core';

0 commit comments

Comments
 (0)