diff --git a/.changeset/@graphql-codegen_cli-9601-dependencies.md b/.changeset/@graphql-codegen_cli-9601-dependencies.md new file mode 100644 index 00000000000..4ca82209663 --- /dev/null +++ b/.changeset/@graphql-codegen_cli-9601-dependencies.md @@ -0,0 +1,5 @@ +--- +"@graphql-codegen/cli": patch +--- +dependencies updates: + - Added dependency [`@graphql-codegen/client-preset@^4.1.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/client-preset/v/4.1.0) (to `dependencies`) diff --git a/.changeset/quiet-flies-perform.md b/.changeset/quiet-flies-perform.md new file mode 100644 index 00000000000..0ade50eb7c6 --- /dev/null +++ b/.changeset/quiet-flies-perform.md @@ -0,0 +1,5 @@ +--- +'@graphql-codegen/cli': patch +--- + +Include @graphql-codegen/client-preset in @graphql-codegen/cli by default diff --git a/examples/persisted-documents-string-mode/package.json b/examples/persisted-documents-string-mode/package.json index e690c11c32d..7108c344240 100644 --- a/examples/persisted-documents-string-mode/package.json +++ b/examples/persisted-documents-string-mode/package.json @@ -11,7 +11,6 @@ "jest": "28.1.3", "babel-jest": "29.6.4", "@graphql-codegen/cli": "5.0.0", - "@graphql-codegen/client-preset": "4.1.0", "@babel/core": "7.22.11", "@babel/preset-env": "7.22.10", "@babel/preset-typescript": "7.22.11" diff --git a/examples/persisted-documents/package.json b/examples/persisted-documents/package.json index e936e3775fc..4c7ece6b5ca 100644 --- a/examples/persisted-documents/package.json +++ b/examples/persisted-documents/package.json @@ -11,7 +11,6 @@ "jest": "28.1.3", "babel-jest": "29.6.4", "@graphql-codegen/cli": "5.0.0", - "@graphql-codegen/client-preset": "4.1.0", "@babel/core": "7.22.11", "@babel/preset-env": "7.22.10", "@babel/preset-typescript": "7.22.11" diff --git a/examples/react/apollo-client-defer/package.json b/examples/react/apollo-client-defer/package.json index e86492d34ef..afc8151e0c4 100644 --- a/examples/react/apollo-client-defer/package.json +++ b/examples/react/apollo-client-defer/package.json @@ -12,7 +12,6 @@ }, "devDependencies": { "@graphql-codegen/cli": "^5.0.0", - "@graphql-codegen/client-preset": "^4.1.0", "@types/jest": "^27.5.2", "@types/node": "^18.11.18", "@types/react": "^18.0.15", diff --git a/examples/react/apollo-client-swc-plugin/package.json b/examples/react/apollo-client-swc-plugin/package.json index 26d084fee26..e0137880f35 100644 --- a/examples/react/apollo-client-swc-plugin/package.json +++ b/examples/react/apollo-client-swc-plugin/package.json @@ -9,7 +9,6 @@ }, "devDependencies": { "@graphql-codegen/client-preset-swc-plugin": "0.2.0", - "@graphql-codegen/client-preset": "^4.1.0", "@graphql-codegen/cli": "^5.0.0", "@vitejs/plugin-react-swc": "^3.3.0", "@types/react": "18.2.21", diff --git a/examples/react/apollo-client/package.json b/examples/react/apollo-client/package.json index a534329b4e8..2e238e9ff27 100644 --- a/examples/react/apollo-client/package.json +++ b/examples/react/apollo-client/package.json @@ -10,7 +10,6 @@ }, "devDependencies": { "@graphql-codegen/cli": "^5.0.0", - "@graphql-codegen/client-preset": "^4.1.0", "@vitejs/plugin-react": "^3.1.0", "@types/jest": "^27.5.2", "@types/node": "^18.11.18", diff --git a/examples/react/http-executor/package.json b/examples/react/http-executor/package.json index 528b659d8a2..2458ee29496 100644 --- a/examples/react/http-executor/package.json +++ b/examples/react/http-executor/package.json @@ -9,7 +9,6 @@ }, "devDependencies": { "@graphql-codegen/cli": "^5.0.0", - "@graphql-codegen/client-preset": "^4.1.0", "@vitejs/plugin-react": "^3.1.0", "@types/jest": "^27.5.2", "@types/node": "^18.11.18", diff --git a/examples/react/nextjs-swr/hooks/use-query.ts b/examples/react/nextjs-swr/hooks/use-query.ts index a9b7970b788..3723b6a981b 100644 --- a/examples/react/nextjs-swr/hooks/use-query.ts +++ b/examples/react/nextjs-swr/hooks/use-query.ts @@ -20,10 +20,10 @@ export function useGraphQL( document.definitions.find(isOperationDefinition)?.name, variables, ] as const, - async (_key, variables) => + async (_key: string, variables: any) => executor({ - document: document as any, - variables: variables as any, + document, + variables, }) as Promise> ); } diff --git a/examples/react/nextjs-swr/package.json b/examples/react/nextjs-swr/package.json index bbc30c52271..ce8422de906 100644 --- a/examples/react/nextjs-swr/package.json +++ b/examples/react/nextjs-swr/package.json @@ -20,7 +20,6 @@ }, "devDependencies": { "@graphql-codegen/cli": "^5.0.0", - "@graphql-codegen/client-preset": "^4.1.0", "@graphql-codegen/schema-ast": "4.0.0", "@graphql-codegen/client-preset-swc-plugin": "0.2.0", "@types/node": "^18.11.18", diff --git a/examples/react/tanstack-react-query/package.json b/examples/react/tanstack-react-query/package.json index f29bc5df27b..4a44112ffcd 100644 --- a/examples/react/tanstack-react-query/package.json +++ b/examples/react/tanstack-react-query/package.json @@ -9,7 +9,6 @@ }, "devDependencies": { "@graphql-codegen/cli": "^5.0.0", - "@graphql-codegen/client-preset": "^4.1.0", "@vitejs/plugin-react": "^3.1.0", "@types/jest": "^27.5.2", "@types/node": "^18.11.18", diff --git a/examples/react/urql/package.json b/examples/react/urql/package.json index 77f8955f318..b998dc044e0 100644 --- a/examples/react/urql/package.json +++ b/examples/react/urql/package.json @@ -11,7 +11,6 @@ "@types/react": "^18.0.17", "@types/react-dom": "^18.0.10", "@graphql-codegen/cli": "^5.0.0", - "@graphql-codegen/client-preset": "^4.1.0", "@vitejs/plugin-react": "^3.1.0", "typescript": "5.2.2", "serve": "14.2.1", diff --git a/examples/typescript-esm/package.json b/examples/typescript-esm/package.json index 0b85df7c487..dc01394db50 100644 --- a/examples/typescript-esm/package.json +++ b/examples/typescript-esm/package.json @@ -3,8 +3,7 @@ "version": "0.0.0", "private": true, "devDependencies": { - "@graphql-codegen/cli": "5.0.0", - "@graphql-codegen/client-preset": "4.1.0" + "@graphql-codegen/cli": "5.0.0" }, "dependencies": { "@graphql-typed-document-node/core": "3.2.0", diff --git a/examples/typescript-graphql-request/package.json b/examples/typescript-graphql-request/package.json index 4efd09876e0..77b45b65591 100644 --- a/examples/typescript-graphql-request/package.json +++ b/examples/typescript-graphql-request/package.json @@ -4,7 +4,6 @@ "private": true, "devDependencies": { "@graphql-codegen/cli": "5.0.0", - "@graphql-codegen/client-preset": "4.1.0", "babel-jest": "29.6.4", "jest": "28.1.3" }, diff --git a/examples/vite/vite-react-cts/package.json b/examples/vite/vite-react-cts/package.json index e7c2547fb87..49117686220 100644 --- a/examples/vite/vite-react-cts/package.json +++ b/examples/vite/vite-react-cts/package.json @@ -22,7 +22,6 @@ }, "devDependencies": { "@graphql-codegen/cli": "5.0.0", - "@graphql-codegen/client-preset": "4.1.0", "@types/react": "^18.0.27", "@types/react-dom": "^18.0.10", "cypress": "12.17.4", diff --git a/examples/vite/vite-react-mts/package.json b/examples/vite/vite-react-mts/package.json index 97906ac50ff..85bd616dea5 100644 --- a/examples/vite/vite-react-mts/package.json +++ b/examples/vite/vite-react-mts/package.json @@ -22,7 +22,6 @@ }, "devDependencies": { "@graphql-codegen/cli": "5.0.0", - "@graphql-codegen/client-preset": "4.1.0", "@types/react": "^18.0.27", "@types/react-dom": "^18.0.10", "cypress": "12.17.4", diff --git a/examples/vite/vite-react-ts/package.json b/examples/vite/vite-react-ts/package.json index f4dfb461222..8504dac80ec 100644 --- a/examples/vite/vite-react-ts/package.json +++ b/examples/vite/vite-react-ts/package.json @@ -22,7 +22,6 @@ }, "devDependencies": { "@graphql-codegen/cli": "5.0.0", - "@graphql-codegen/client-preset": "4.1.0", "@types/react": "^18.0.27", "@types/react-dom": "^18.0.10", "cypress": "12.17.4", diff --git a/examples/vue/apollo-composable/package.json b/examples/vue/apollo-composable/package.json index ce58389cfeb..42c782aa6ae 100644 --- a/examples/vue/apollo-composable/package.json +++ b/examples/vue/apollo-composable/package.json @@ -18,7 +18,6 @@ }, "devDependencies": { "@graphql-codegen/cli": "^5.0.0", - "@graphql-codegen/client-preset": "^4.1.0", "@vitejs/plugin-vue": "^4.0.0", "typescript": "^5.0.0", "vite": "^4.1.0", diff --git a/examples/vue/urql/package.json b/examples/vue/urql/package.json index 36020268b34..aa0264b0b0b 100644 --- a/examples/vue/urql/package.json +++ b/examples/vue/urql/package.json @@ -17,7 +17,6 @@ }, "devDependencies": { "@graphql-codegen/cli": "^5.0.0", - "@graphql-codegen/client-preset": "^4.1.0", "@vitejs/plugin-vue": "^4.0.0", "typescript": "^5.0.0", "vite": "^4.1.0", diff --git a/examples/vue/villus/package.json b/examples/vue/villus/package.json index 0294dc9d955..661a09cf1d9 100644 --- a/examples/vue/villus/package.json +++ b/examples/vue/villus/package.json @@ -17,7 +17,6 @@ }, "devDependencies": { "@graphql-codegen/cli": "^5.0.0", - "@graphql-codegen/client-preset": "^4.1.0", "@vitejs/plugin-vue": "^4.0.0", "typescript": "^5.0.0", "vite": "^4.1.0", diff --git a/examples/yoga-tests/package.json b/examples/yoga-tests/package.json index 1513c69e8fd..cf0e34cfafd 100644 --- a/examples/yoga-tests/package.json +++ b/examples/yoga-tests/package.json @@ -10,7 +10,6 @@ "jest": "28.1.3", "babel-jest": "29.6.4", "@graphql-codegen/cli": "5.0.0", - "@graphql-codegen/client-preset": "4.1.0", "@babel/core": "7.22.11", "@babel/preset-env": "7.22.10", "@babel/preset-typescript": "7.22.11" diff --git a/packages/graphql-codegen-cli/package.json b/packages/graphql-codegen-cli/package.json index 86128832f71..b3b3180bd4b 100644 --- a/packages/graphql-codegen-cli/package.json +++ b/packages/graphql-codegen-cli/package.json @@ -43,6 +43,7 @@ "@babel/generator": "^7.18.13", "@babel/template": "^7.18.10", "@babel/types": "^7.18.13", + "@graphql-codegen/client-preset": "^4.1.0", "@graphql-codegen/core": "^4.0.0", "@graphql-codegen/plugin-helpers": "^5.0.1", "@graphql-tools/apollo-engine-loader": "^8.0.0", diff --git a/website/src/pages/docs/getting-started/index.mdx b/website/src/pages/docs/getting-started/index.mdx index 45e5d8e4277..442c0d59c16 100644 --- a/website/src/pages/docs/getting-started/index.mdx +++ b/website/src/pages/docs/getting-started/index.mdx @@ -260,7 +260,7 @@ After installing 3 packages: ```sh npm2yarn npm i graphql -npm i -D typescript @graphql-codegen/cli @graphql-codegen/client-preset +npm i -D typescript @graphql-codegen/cli ``` and providing a simple configuration: diff --git a/website/src/pages/docs/getting-started/installation.mdx b/website/src/pages/docs/getting-started/installation.mdx index 057c77f76ac..fc893159aa2 100644 --- a/website/src/pages/docs/getting-started/installation.mdx +++ b/website/src/pages/docs/getting-started/installation.mdx @@ -64,7 +64,7 @@ If you are looking for the **best way to leverage GraphQL Code Generator on your #### Client -We recommend using [a `client` preset](/plugins/presets/preset-client) that has a recommended configuration for the client applications. You can follow one of the following guides: +We recommend using [a `client` preset](/plugins/presets/preset-client) that has a recommended configuration for the client applications. It's included in the `@graphql-codegen/cli` package by default. Follow one of the following guides to learn more: - [React](/docs/guides/react-vue) - [Vue](/docs/guides/react-vue) diff --git a/website/src/pages/docs/guides/api-testing.mdx b/website/src/pages/docs/guides/api-testing.mdx index 59ab7e076b8..54022717959 100644 --- a/website/src/pages/docs/guides/api-testing.mdx +++ b/website/src/pages/docs/guides/api-testing.mdx @@ -29,7 +29,7 @@ npm i graphql-yoga Install the following development dependencies: ```sh npm2yarn -npm i -D typescript ts-node @graphql-codegen/cli @graphql-codegen/client-preset jest @babel/core @babel/preset-env @babel/preset-typescript babel-jest @graphql-typed-document-node/core +npm i -D typescript ts-node @graphql-codegen/cli jest @babel/core @babel/preset-env @babel/preset-typescript babel-jest @graphql-typed-document-node/core ``` ## Setup diff --git a/website/src/pages/docs/guides/react-vue.mdx b/website/src/pages/docs/guides/react-vue.mdx index e98eaa04b93..ef7f7aca877 100644 --- a/website/src/pages/docs/guides/react-vue.mdx +++ b/website/src/pages/docs/guides/react-vue.mdx @@ -49,21 +49,21 @@ For most GraphQL clients and frameworks (React, Vue), install the following pack ```bash yarn add graphql -yarn add -D typescript ts-node @graphql-codegen/cli @graphql-codegen/client-preset +yarn add -D typescript ts-node @graphql-codegen/cli ``` **For npm:** ```bash npm i -S graphql -npm i -D typescript ts-node @graphql-codegen/cli @graphql-codegen/client-preset +npm i -D typescript ts-node @graphql-codegen/cli ``` **For pnpm:** ```bash pnpm i graphql @graphql-typed-document-node/core -pnpm i -D typescript ts-node @graphql-codegen/cli @graphql-codegen/client-preset +pnpm i -D typescript ts-node @graphql-codegen/cli ```
diff --git a/yarn.lock b/yarn.lock index 1b4d04991a1..3fa1bd3662b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4513,16 +4513,16 @@ resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756" integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg== -"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" - integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== - -"@types/unist@^3.0.0": +"@types/unist@*", "@types/unist@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.0.tgz#988ae8af1e5239e89f9fbb1ade4c935f4eeedf9a" integrity sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w== +"@types/unist@^2.0.0", "@types/unist@^2.0.2": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" + integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== + "@types/ws@^8.0.0": version "8.5.4" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.4.tgz#bb10e36116d6e570dd943735f86c933c1587b8a5"