From 8e9b678c285850b3a4e733b36ead7b1c11af4fa8 Mon Sep 17 00:00:00 2001 From: Igor Kusakov Date: Fri, 29 May 2026 08:40:32 -0400 Subject: [PATCH 1/2] Docs update for apollo-tooling migration: package versions updated + minor improvements (#10857) * docs update for apollo-tooling migration * prettier --------- Co-authored-by: Igor Kusakov --- .../pages/docs/migration/apollo-tooling.mdx | 74 +++++++++++-------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/website/src/pages/docs/migration/apollo-tooling.mdx b/website/src/pages/docs/migration/apollo-tooling.mdx index 02f1ed4c72a..797a0b7fc44 100644 --- a/website/src/pages/docs/migration/apollo-tooling.mdx +++ b/website/src/pages/docs/migration/apollo-tooling.mdx @@ -1,14 +1,14 @@ --- description: - Migrating from Apollo Tooling (apollo client:codegen) to GraphQL Code Generator. What has changed? - How to migrate? What configuration options replace Apollo Tooling's behaviour? + Migrating from Apollo-tooling (apollo client:codegen) to GraphQL Code Generator. What has changed? + How to migrate? What configuration options replace apollo-tooling's behaviour? --- import { Callout, Tabs } from '@theguild/components' -# Migrating from Apollo Tooling to GraphQL Code Generator +# Migrating from Apollo-tooling to GraphQL Code Generator -[Apollo Tooling](https://github.com/apollographql/apollo-tooling) (the `apollo` CLI, specifically +[Apollo-tooling](https://github.com/apollographql/apollo-tooling) (the `apollo` CLI, specifically `apollo client:codegen`) is a code generation tool that generates TypeScript types from GraphQL operations for use with Apollo Client. @@ -22,7 +22,7 @@ of GraphQL Codegen. ## Installation -Remove Apollo Tooling and install GraphQL Code Generator: +Remove apollo-tooling and install GraphQL Code Generator: @@ -50,9 +50,9 @@ npm i -D @graphql-codegen/cli @graphql-codegen/typescript-operations @graphql-co { "devDependencies": { ... - "@graphql-codegen/cli": "7.0.1", - "@graphql-codegen/near-operation-file-preset": "5.2.0", - "@graphql-codegen/typescript-operations": "6.0.0", + "@graphql-codegen/cli": "^7.0.0", + "@graphql-codegen/near-operation-file-preset": "^5.2.0", + "@graphql-codegen/typescript-operations": "^6.0.0", ... } } @@ -60,9 +60,9 @@ npm i -D @graphql-codegen/cli @graphql-codegen/typescript-operations @graphql-co ## Configuration -Apollo Tooling is configured via `apollo.config.js` (or `apollo.config.ts`) and invoked with +Apollo-tooling is configured via `apollo.config.js` (or `apollo.config.ts`) and invoked with `apollo client:codegen`. GraphQL Code Generator uses a `codegen.ts` file and is invoked with -`graphql-codegen`. +`graphql-codegen` cli command or programmatically. @@ -118,9 +118,9 @@ export default config ## Per-operation file generation with `near-operation-file` -Apollo Tooling's default behaviour is to generate one TypeScript file per graphql operation, placed +Apollo-tooling's default behaviour is to generate one TypeScript file per graphql operation, placed in a `__generated__` folder next to the source. For example, given `src/Component.ts` containing a -query `GetUser`, Apollo Tooling produces `src/__generated__/GetUser.ts`. +query `GetUser`, apollo-tooling produces `src/__generated__/GetUser.ts`. GraphQL Code Generator replicates this with the `filePerOperation: true` parameter of the [`near-operation-file` preset](https://the-guild.dev/graphql/codegen/plugins/presets/near-operation-file-preset). @@ -136,7 +136,7 @@ const config: CodegenConfig = { presetConfig: { extension: '.ts', folder: '__generated__', - filePerOperation: true // Generate type files per-operation (not per-component) + filePerOperation: true // Generate type files per-operation (not per-source file) }, ... } @@ -150,23 +150,33 @@ export default config With this configuration: `src/Component.ts` → `src/__generated__/GetUser.ts`, matching Apollo Tooling's output structure exactly. -If you need to generate files per-component (default to GraphQL Codegen), remove the following +If you need to generate files per-source file (default to GraphQL Codegen), remove the following config option: `filePerOperation: true` (or set it to `false`). Then, the output will be: `src/Component.ts` → `src/__generated__/Component.ts` -## Type naming conventions +## Nested field types naming conventions -Apollo Tooling generates type names using **only field names**, omitting the GraphQL object type -name: +Nested fields are the fields inside operation result object. + +Apollo-tooling generates nested field type names using **only field names**, omitting the GraphQL +object type name: ```ts -// Apollo Tooling output +// Apollo-tooling output export type GetUserQuery_user = { ... }; export type GetUserQuery_user_address = { ... }; ``` -To achieve similar naming with GraphQL Codegen use the `extractAllFieldsToTypesCompact: true` -configuration option: +By default GraphQL Codegen always adds field types: + +```ts +// GraphQL Codegen output +export type GetUserQuery_user_User = { ... }; +export type GetUserQuery_user_User_address_Address = { ... }; +``` + +To achieve naming similar to apollo-tooling with GraphQL Codegen use the +`extractAllFieldsToTypesCompact: true` configuration option: ```ts filename="codegen.ts" const config: CodegenConfig = { @@ -183,11 +193,11 @@ const config: CodegenConfig = { ## Enum types -Apollo Tooling generates enums as native TypeScript `enum` declarations and references them directly +Apollo-tooling generates enums as native TypeScript `enum` declarations and references them directly by name (without any namespace prefix): ```ts -// Apollo Tooling output +// Apollo-tooling output export enum UserManagerRoleType { ROLE_TYPE_1 = 'ROLE_TYPE_1', ROLE_TYPE_2 = 'ROLE_TYPE_2', @@ -200,7 +210,7 @@ export type GetUserQuery_user_manager = { ``` GraphQL Code Generator generates string literal union types by default. To produce native `enum` -declarations matching Apollo Tooling's output, set `enumType: 'native'`: +declarations matching apollo-tooling's output, set `enumType: 'native'`: ```ts filename="codegen.ts" const config: CodegenConfig = { @@ -233,7 +243,7 @@ for all available enum type options. ## Recommended configuration -Below is a configuration that produces output closely matching Apollo Tooling's behaviour, including +Below is a configuration that produces output closely matching apollo-tooling's behaviour, including per-file generation, enum output, and type naming: ```ts filename="codegen.ts" @@ -243,7 +253,7 @@ const config: CodegenConfig = { // since codegen 6.0, we can also pass pre-parsed GraphQLSchema here (for caching - when running codegen in a loop on a monorepo with many packages) schema: './schema.graphql', documents: ['./src/**/*.{ts,tsx}', '!./src/**/__generated__/**'], - // `externalDocuments` are read-only documents that are loaded but do not generate output. + // `externalDocuments` are read-only documents that are loaded but no output is generated for them. // They are used to include fragments from another package in a monorepo without generating unnecessary files. externalDocuments: [ '../other-package/src/**/*.{ts,tsx}', @@ -262,13 +272,13 @@ const config: CodegenConfig = { } }, config: { - // Extract nested field types to named types (matches Apollo Tooling naming) + // Extract nested field types to named types (matches apollo-tooling naming) extractAllFieldsToTypesCompact: true, // Keep original naming as-is (no camelCase conversion) namingConvention: 'keep', // Print each field on its own line for readability printFieldsOnNewLines: true, - // Use native TypeScript enums (matches Apollo Tooling enum output) + // Use native TypeScript enums (matches apollo-tooling enum output) enumType: 'native', // Always include __typename in result types nonOptionalTypename: true, @@ -278,7 +288,7 @@ const config: CodegenConfig = { omitOperationSuffix: true, // Don't add 'Fragment' suffix to fragment result types fragmentSuffix: '', - // Default is 'unknown'; to match Apollo tooling we need to put 'any' + // Default is 'unknown'; to match apollo-tooling we need to put 'any' defaultScalarType: 'any' } } @@ -288,17 +298,17 @@ export default config ## Manual changes -The setup above closely mimics Apollo Tooling but isn’t an exact match. The following items may -require manual fixes: +The setup above closely mimics apollo-tooling (99.98% similarity in our tests) but isn’t an exact +match. The following items may require manual fixes: #### 1. Nested field types naming. -In very rare cases, the field names generated by GraphQL Codegen don’t match Apollo Tooling’s. +In very rare cases, the field names generated by GraphQL Codegen don’t match apollo-tooling’s. Update these cases manually. #### 2. Enum file location. -Occasionally, GraphQL Codegen places enums in a different file then Apollo Tooling. If an enum is +Occasionally, GraphQL Codegen places enums in a different file then apollo-tooling. If an enum is missing, check nearby generated files and adjust your imports accordingly. #### 3. `is possibly null` and `has any type` typecheck bugs. From db2c90c3a41073d65f21df397082bc595d2b3a28 Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Fri, 29 May 2026 23:10:09 +1000 Subject: [PATCH 2/2] Fix Examples CI step: target non-rust examples with pnpm filter (#10856) * Update to target non-rust examples * Try one example test * Add missing devDeps * Remove old cmd --- .github/workflows/main.yml | 6 +- .../package.json | 1 + .../react/apollo-client-defer/package.json | 2 + .../apollo-client-swc-plugin/package.json | 2 +- examples/react/apollo-client/package.json | 1 + examples/react/http-executor/package.json | 1 + examples/react/nextjs-swr/package.json | 2 +- .../react/tanstack-react-query/package.json | 1 + examples/react/urql/package.json | 1 + examples/typescript-esm/package.json | 3 +- .../typescript-graphql-request/package.json | 1 + examples/vite/vite-react-cts/package.json | 1 + examples/vite/vite-react-mts/package.json | 1 + examples/vite/vite-react-ts/package.json | 1 + examples/vue/apollo-composable/package.json | 1 + examples/vue/urql/package.json | 1 + examples/vue/villus/package.json | 1 + examples/yoga-tests/package.json | 1 + package.json | 6 +- pnpm-lock.yaml | 56 +++++++++++++++++-- scripts/print-example-ci-command.js | 45 --------------- 21 files changed, 77 insertions(+), 58 deletions(-) delete mode 100644 scripts/print-example-ci-command.js diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5860884a25..8cf96480f46 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -107,14 +107,14 @@ jobs: CI: true - name: Generate and Diff Codegen Artifacts run: | - EXAMPLE_TYPE=normal pnpm examples:codegen + pnpm examples:codegen git diff --exit-code -- examples/ - name: Build Examples run: | - EXAMPLE_TYPE=normal pnpm examples:build + pnpm examples:build - name: End2End Test Examples run: | - EXAMPLE_TYPE=normal pnpm examples:test:end2end + pnpm examples:test:end2end # TODO: Remove all SWC test setup and references as that has been moved to https://github.com/swc-project/plugins/tree/main/contrib/graphql-codegen-client-preset # dev-tests-swc: diff --git a/examples/persisted-documents-string-mode/package.json b/examples/persisted-documents-string-mode/package.json index 4942cefaae4..f7818c1ed19 100644 --- a/examples/persisted-documents-string-mode/package.json +++ b/examples/persisted-documents-string-mode/package.json @@ -17,6 +17,7 @@ "@babel/preset-env": "7.29.5", "@babel/preset-typescript": "7.28.5", "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@graphql-typed-document-node/core": "3.2.0" }, "bob": false diff --git a/examples/react/apollo-client-defer/package.json b/examples/react/apollo-client-defer/package.json index fecb7530cab..7ccbf07e667 100644 --- a/examples/react/apollo-client-defer/package.json +++ b/examples/react/apollo-client-defer/package.json @@ -13,6 +13,7 @@ }, "dependencies": { "@apollo/client": "3.14.1", + "@graphql-typed-document-node/core": "3.2.0", "@graphql-yoga/plugin-defer-stream": "3.21.0", "graphql": "16.14.0", "graphql-yoga": "5.21.0", @@ -21,6 +22,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@types/node": "24.12.4", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", diff --git a/examples/react/apollo-client-swc-plugin/package.json b/examples/react/apollo-client-swc-plugin/package.json index 961673655c6..dbca497f3ca 100644 --- a/examples/react/apollo-client-swc-plugin/package.json +++ b/examples/react/apollo-client-swc-plugin/package.json @@ -1,5 +1,5 @@ { - "name": "example-apollo-client-swc-plugin", + "name": "rust-example-apollo-client-swc-plugin", "version": "0.1.0", "private": true, "scripts": { diff --git a/examples/react/apollo-client/package.json b/examples/react/apollo-client/package.json index a427cfa6a0f..a3dd70eeba1 100644 --- a/examples/react/apollo-client/package.json +++ b/examples/react/apollo-client/package.json @@ -18,6 +18,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@types/node": "24.12.4", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", diff --git a/examples/react/http-executor/package.json b/examples/react/http-executor/package.json index f419aa1a6db..45a58e770f2 100644 --- a/examples/react/http-executor/package.json +++ b/examples/react/http-executor/package.json @@ -17,6 +17,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@types/node": "24.12.4", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", diff --git a/examples/react/nextjs-swr/package.json b/examples/react/nextjs-swr/package.json index 7de696d0aad..c4acf369313 100644 --- a/examples/react/nextjs-swr/package.json +++ b/examples/react/nextjs-swr/package.json @@ -1,5 +1,5 @@ { - "name": "example-react-nextjs-swr", + "name": "rust-example-react-nextjs-swr", "version": "0.1.0", "private": true, "scripts": { diff --git a/examples/react/tanstack-react-query/package.json b/examples/react/tanstack-react-query/package.json index ec287d223f3..71e10a5db0e 100644 --- a/examples/react/tanstack-react-query/package.json +++ b/examples/react/tanstack-react-query/package.json @@ -17,6 +17,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@types/node": "24.12.4", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", diff --git a/examples/react/urql/package.json b/examples/react/urql/package.json index 989955a67bd..3950005ab78 100644 --- a/examples/react/urql/package.json +++ b/examples/react/urql/package.json @@ -17,6 +17,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", "@vitejs/plugin-react": "6.0.2", diff --git a/examples/typescript-esm/package.json b/examples/typescript-esm/package.json index 31eb9468ff2..12b6d21277d 100644 --- a/examples/typescript-esm/package.json +++ b/examples/typescript-esm/package.json @@ -14,7 +14,8 @@ "graphql": "16.14.0" }, "devDependencies": { - "@graphql-codegen/cli": "workspace:*" + "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*" }, "bob": false } diff --git a/examples/typescript-graphql-request/package.json b/examples/typescript-graphql-request/package.json index 0f2d655c934..764d14f00ee 100644 --- a/examples/typescript-graphql-request/package.json +++ b/examples/typescript-graphql-request/package.json @@ -17,6 +17,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "tsx": "4.22.0" }, "bob": false diff --git a/examples/vite/vite-react-cts/package.json b/examples/vite/vite-react-cts/package.json index d7ae1d447e2..0e7efd202bd 100644 --- a/examples/vite/vite-react-cts/package.json +++ b/examples/vite/vite-react-cts/package.json @@ -22,6 +22,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", "cypress": "15.15.0", diff --git a/examples/vite/vite-react-mts/package.json b/examples/vite/vite-react-mts/package.json index c6ac751a1a5..827d9a6dcb5 100644 --- a/examples/vite/vite-react-mts/package.json +++ b/examples/vite/vite-react-mts/package.json @@ -22,6 +22,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", "cypress": "15.15.0", diff --git a/examples/vite/vite-react-ts/package.json b/examples/vite/vite-react-ts/package.json index f0596f8900c..e7651cd2cf0 100644 --- a/examples/vite/vite-react-ts/package.json +++ b/examples/vite/vite-react-ts/package.json @@ -22,6 +22,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@types/react": "19.2.14", "@types/react-dom": "19.2.3", "cypress": "15.15.0", diff --git a/examples/vue/apollo-composable/package.json b/examples/vue/apollo-composable/package.json index 9dd5caaad76..19414be70b1 100644 --- a/examples/vue/apollo-composable/package.json +++ b/examples/vue/apollo-composable/package.json @@ -18,6 +18,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@vitejs/plugin-vue": "6.0.7", "cypress": "15.15.0", "serve": "14.2.6", diff --git a/examples/vue/urql/package.json b/examples/vue/urql/package.json index 82bd5986cd4..e5e39f54640 100644 --- a/examples/vue/urql/package.json +++ b/examples/vue/urql/package.json @@ -17,6 +17,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@vitejs/plugin-vue": "6.0.7", "cypress": "15.15.0", "serve": "14.2.6", diff --git a/examples/vue/villus/package.json b/examples/vue/villus/package.json index 1228c765622..6144d096403 100644 --- a/examples/vue/villus/package.json +++ b/examples/vue/villus/package.json @@ -17,6 +17,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@vitejs/plugin-vue": "6.0.7", "cypress": "15.15.0", "serve": "14.2.6", diff --git a/examples/yoga-tests/package.json b/examples/yoga-tests/package.json index d693adeeed9..40d125dce59 100644 --- a/examples/yoga-tests/package.json +++ b/examples/yoga-tests/package.json @@ -16,6 +16,7 @@ "@babel/preset-env": "7.29.5", "@babel/preset-typescript": "7.28.5", "@graphql-codegen/cli": "workspace:*", + "@graphql-codegen/client-preset": "workspace:*", "@graphql-typed-document-node/core": "3.2.0" }, "bob": false diff --git a/package.json b/package.json index e6a412a6523..a36c4948121 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,9 @@ "dev-test:watch": "pnpm --filter=\"dev-test*\" watch", "dev-test:watch:cjs": "pnpm --filter=\"dev-test*\" watch:cjs", "dev-test:watch:esm": "pnpm --filter=\"dev-test*\" watch:esm", - "examples:build": "set -o xtrace && eval $(node scripts/print-example-ci-command.js build)", - "examples:codegen": "set -o xtrace && eval $(node scripts/print-example-ci-command.js codegen)", - "examples:test:end2end": "set -o xtrace && eval $(node scripts/print-example-ci-command.js test:end2end)", + "examples:build": "pnpm --filter=\"example-*\" build", + "examples:codegen": "pnpm --filter=\"example-*\" codegen", + "examples:test:end2end": "pnpm --filter=\"example-*\" --workspace-concurrency=1 test:end2end", "fix-bins": "node scripts/fix-bin.js", "postinstall": "husky install", "lint": "eslint --cache .", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index adc8f861e0c..678cabf1c39 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,7 +63,7 @@ importers: version: 10.4.0(jiti@2.7.0) eslint-plugin-import: specifier: 2.32.0 - version: 2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.0(jiti@2.7.0)))(eslint@10.4.0(jiti@2.7.0)))(eslint@10.4.0(jiti@2.7.0)) + version: 2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint-import-resolver-typescript@3.10.1)(eslint@10.4.0(jiti@2.7.0)) eslint-plugin-tailwindcss: specifier: npm:@hasparus/eslint-plugin-tailwindcss@3.17.5 version: '@hasparus/eslint-plugin-tailwindcss@3.17.5(tailwindcss@3.4.19(tsx@4.22.0)(yaml@2.9.0))' @@ -238,6 +238,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../packages/presets/client/dist '@graphql-typed-document-node/core': specifier: 3.2.0 version: 3.2.0(graphql@16.14.0) @@ -306,6 +309,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../../packages/presets/client/dist '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -339,6 +345,9 @@ importers: '@apollo/client': specifier: 3.14.1 version: 3.14.1(@types/react@19.2.14)(graphql-ws@6.0.8(graphql@16.14.0)(ws@8.20.1))(graphql@16.14.0)(react-dom@19.2.6(react@19.2.6))(react@19.2.6) + '@graphql-typed-document-node/core': + specifier: 3.2.0 + version: 3.2.0(graphql@16.14.0) '@graphql-yoga/plugin-defer-stream': specifier: 3.21.0 version: 3.21.0(graphql-yoga@5.21.0(graphql@16.14.0))(graphql@16.14.0) @@ -358,6 +367,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../../packages/presets/client/dist '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -435,6 +447,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../../packages/presets/client/dist '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -524,6 +539,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../../packages/presets/client/dist '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -567,6 +585,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../../packages/presets/client/dist '@types/react': specifier: 19.2.14 version: 19.2.14 @@ -604,6 +625,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../packages/presets/client/dist examples/typescript-graphql-request: dependencies: @@ -623,6 +647,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../packages/presets/client/dist tsx: specifier: 4.22.0 version: 4.22.0 @@ -676,6 +703,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../../packages/presets/client/dist '@types/react': specifier: 19.2.14 version: 19.2.14 @@ -719,6 +749,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../../packages/presets/client/dist '@types/react': specifier: 19.2.14 version: 19.2.14 @@ -762,6 +795,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../../packages/presets/client/dist '@types/react': specifier: 19.2.14 version: 19.2.14 @@ -796,6 +832,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../../packages/presets/client/dist '@vitejs/plugin-vue': specifier: 6.0.7 version: 6.0.7(vite@8.0.13(@types/node@24.12.4)(esbuild@0.28.0)(jiti@2.7.0)(tsx@4.22.0)(yaml@2.9.0))(vue@3.5.34(typescript@6.0.3)) @@ -833,6 +872,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../../packages/presets/client/dist '@vitejs/plugin-vue': specifier: 6.0.7 version: 6.0.7(vite@8.0.13(@types/node@24.12.4)(esbuild@0.28.0)(jiti@2.7.0)(tsx@4.22.0)(yaml@2.9.0))(vue@3.5.34(typescript@6.0.3)) @@ -870,6 +912,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../../packages/presets/client/dist '@vitejs/plugin-vue': specifier: 6.0.7 version: 6.0.7(vite@8.0.13(@types/node@24.12.4)(esbuild@0.28.0)(jiti@2.7.0)(tsx@4.22.0)(yaml@2.9.0))(vue@3.5.34(typescript@6.0.3)) @@ -910,6 +955,9 @@ importers: '@graphql-codegen/cli': specifier: workspace:* version: link:../../packages/graphql-codegen-cli/dist + '@graphql-codegen/client-preset': + specifier: workspace:* + version: link:../../packages/presets/client/dist '@graphql-typed-document-node/core': specifier: 3.2.0 version: 3.2.0(graphql@16.14.0) @@ -18688,7 +18736,7 @@ snapshots: eslint: 10.4.0(jiti@2.7.0) eslint-import-resolver-node: 0.3.10 eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.0(jiti@2.7.0)))(eslint@10.4.0(jiti@2.7.0)) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.0(jiti@2.7.0)))(eslint@10.4.0(jiti@2.7.0)))(eslint@10.4.0(jiti@2.7.0)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint-import-resolver-typescript@3.10.1)(eslint@10.4.0(jiti@2.7.0)) eslint-plugin-jsx-a11y: 6.10.2(eslint@10.4.0(jiti@2.7.0)) eslint-plugin-react: 7.37.5(eslint@10.4.0(jiti@2.7.0)) eslint-plugin-react-hooks: 5.0.0-canary-7118f5dd7-20230705(eslint@10.4.0(jiti@2.7.0)) @@ -18722,7 +18770,7 @@ snapshots: tinyglobby: 0.2.16 unrs-resolver: 1.11.1 optionalDependencies: - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.0(jiti@2.7.0)))(eslint@10.4.0(jiti@2.7.0)))(eslint@10.4.0(jiti@2.7.0)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint-import-resolver-typescript@3.10.1)(eslint@10.4.0(jiti@2.7.0)) transitivePeerDependencies: - supports-color @@ -18823,7 +18871,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.0(jiti@2.7.0)))(eslint@10.4.0(jiti@2.7.0)))(eslint@10.4.0(jiti@2.7.0)): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.3(eslint@10.4.0(jiti@2.7.0))(typescript@6.0.3))(eslint-import-resolver-typescript@3.10.1)(eslint@10.4.0(jiti@2.7.0)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 diff --git a/scripts/print-example-ci-command.js b/scripts/print-example-ci-command.js deleted file mode 100644 index dd6b52d9374..00000000000 --- a/scripts/print-example-ci-command.js +++ /dev/null @@ -1,45 +0,0 @@ -/* eslint-disable import/no-extraneous-dependencies, no-console */ -const fs = require('fs-extra'); -const fg = require('fast-glob'); - -const packageJSON = fg.sync(['examples/**/package.json'], { - ignore: ['**/node_modules/**'], -}); - -const ignoredPackages = []; - -const exampleTypeMap = { - all: 'all', - swc: 'swc', - normal: 'normal', -}; -const exampleType = exampleTypeMap[process.env.EXAMPLE_TYPE] || 'all'; - -const result = packageJSON.reduce( - (res, packageJSONPath) => { - const { name, devDependencies } = fs.readJSONSync(packageJSONPath); - - if (ignoredPackages.includes(name)) { - res.ignored.push(name); - return res; - } - - if ( - (exampleType === 'swc' && !devDependencies['@graphql-codegen/client-preset-swc-plugin']) || - (exampleType === 'normal' && devDependencies['@graphql-codegen/client-preset-swc-plugin']) - ) { - res.ignored.push(name); - return res; - } - - res.commands.push(`pnpm --filter=${name} run ${process.argv[2]}`); - return res; - }, - { ignored: [], commands: [] }, -); - -if (result.ignored.length > 0) { - result.commands.push(`echo "Ignored packages: ${result.ignored.join(',')}"`); -} - -console.log(result.commands.join(' && '));