From cff2a7e66270659407530893a04c03d1ea6ef6a5 Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Tue, 20 May 2025 22:40:07 +1000 Subject: [PATCH 1/8] Allow graphql-request v7 as peerDep for @graphql-codegen/typescript-graphql-request --- .../typescript/graphql-request/package.json | 4 +- yarn.lock | 155 +++++++++++++++++- 2 files changed, 155 insertions(+), 4 deletions(-) diff --git a/packages/plugins/typescript/graphql-request/package.json b/packages/plugins/typescript/graphql-request/package.json index 7900fedc2b..de29fe08ce 100644 --- a/packages/plugins/typescript/graphql-request/package.json +++ b/packages/plugins/typescript/graphql-request/package.json @@ -38,7 +38,7 @@ }, "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0", - "graphql-request": "^6.0.0", + "graphql-request": "^6.0.0 || ^7.0.0", "graphql-tag": "^2.0.0" }, "dependencies": { @@ -50,7 +50,7 @@ "devDependencies": { "@graphql-codegen/testing": "1.18.3", "@graphql-tools/schema": "10.0.23", - "graphql-request": "6.0.0" + "graphql-request": "7.0.0" }, "publishConfig": { "directory": "dist", diff --git a/yarn.lock b/yarn.lock index 4505204a34..592436a3e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1257,6 +1257,51 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" +"@dprint/darwin-arm64@0.45.1": + version "0.45.1" + resolved "https://registry.yarnpkg.com/@dprint/darwin-arm64/-/darwin-arm64-0.45.1.tgz#3c989b5fd7122a61f20ec95db1a3e6f020634a90" + integrity sha512-pH0/uKLJ5SJPoHhOwLWFMhCmL0BY3FzWQbull8OGMK/FRkIPgOl2adZSovtUZpUMGWyDOzIWH1fW9X2DuMhnEg== + +"@dprint/darwin-x64@0.45.1": + version "0.45.1" + resolved "https://registry.yarnpkg.com/@dprint/darwin-x64/-/darwin-x64-0.45.1.tgz#f024fa56804ecdb7b52e31e698b95c5f8fc9e8d1" + integrity sha512-YUj421LmBLDlxpIER3pORKfQmpmXD50n5mClHjpZrnl17WTiHtQ+jHvDJdJoxH2eS66W0mQyxLoGo5SfFfiM7A== + +"@dprint/formatter@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@dprint/formatter/-/formatter-0.3.0.tgz#e374398c8e8d7dbf50e8208c87af44a66de0cb2e" + integrity sha512-N9fxCxbaBOrDkteSOzaCqwWjso5iAe+WJPsHC021JfHNj2ThInPNEF13ORDKta3llq5D1TlclODCvOvipH7bWQ== + +"@dprint/linux-arm64-glibc@0.45.1": + version "0.45.1" + resolved "https://registry.yarnpkg.com/@dprint/linux-arm64-glibc/-/linux-arm64-glibc-0.45.1.tgz#e31be90fd8483f8b79c0a7081c7befb167c5865e" + integrity sha512-lJ7s/pOQWRJ0mstjZQnVyX2/3QRXZ9cpFHJDZ7e81Y8QSn/iqxTrnK0DPgxUrDG8hYKQmWQdQLU4sP5DKBz0Jg== + +"@dprint/linux-arm64-musl@0.45.1": + version "0.45.1" + resolved "https://registry.yarnpkg.com/@dprint/linux-arm64-musl/-/linux-arm64-musl-0.45.1.tgz#ff5ad5ce0d55d8ff35139992f283765326a0bc2b" + integrity sha512-un2awe1L1sAJLsCPSEUrE0/cgupdzbYFoyBOutyU1zHR9KQn47AtIDw+chvuinU4xleHDuEGyXGuJ6NE+Ky6vw== + +"@dprint/linux-x64-glibc@0.45.1": + version "0.45.1" + resolved "https://registry.yarnpkg.com/@dprint/linux-x64-glibc/-/linux-x64-glibc-0.45.1.tgz#890a1c42507746d2082778ec67d6e2873b6c7f71" + integrity sha512-5Civht90S/g8zlyYB7n4oH78p+sLbNqeFCFuImJRK7uRxZwCRya7lji6RwlB6DQ7qngVqovTHj9RLOYfZzfVlg== + +"@dprint/linux-x64-musl@0.45.1": + version "0.45.1" + resolved "https://registry.yarnpkg.com/@dprint/linux-x64-musl/-/linux-x64-musl-0.45.1.tgz#53508925c105c8392335f0b6e15c49334e631c96" + integrity sha512-p2/gjnHDd8GRCvtey5HZO4o/He6pSmY/zpcCuIXprFW9P0vNlEj3DFhz4FPpOKXM+csrsVWWs2E0T/xr5QZtVg== + +"@dprint/typescript@^0.90.4": + version "0.90.5" + resolved "https://registry.yarnpkg.com/@dprint/typescript/-/typescript-0.90.5.tgz#22bd5a218c5ac8c4cdcdfa4fb044bf2ef6f6ddb2" + integrity sha512-/1aP6saonFvJyQN3l2is6eTOec3GnLGyW+opid/eDm8pnlhwzYl8A9p36pI6WO5jLl/a9Ghod+LWpvSOuXFGUw== + +"@dprint/win32-x64@0.45.1": + version "0.45.1" + resolved "https://registry.yarnpkg.com/@dprint/win32-x64/-/win32-x64-0.45.1.tgz#6d08308cf08e4b751efb0692ded28b57d42a365d" + integrity sha512-2l78XM7KsW46P2Yv6uPB3fE+y92EsBlrCxi+RVQ0pbznPFdMdkLyGgaCuh683zdld14jHlaADpIQ7YchGAEMAg== + "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.7.0": version "4.7.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz#607084630c6c033992a082de6e6fbc1a8b52175a" @@ -2173,6 +2218,30 @@ globby "^11.0.0" read-yaml-file "^1.1.0" +"@molt/command@^0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@molt/command/-/command-0.9.0.tgz#3c77efe435beb6062da8ba96097f8f82e9bee51c" + integrity sha512-1JI8dAlpqlZoXyKWVQggX7geFNPxBpocHIXQCsnxDjKy+3WX4SGyZVJXuLlqRRrX7FmQCuuMAfx642ovXmPA9g== + dependencies: + "@molt/types" "0.2.0" + alge "0.8.1" + chalk "^5.3.0" + lodash.camelcase "^4.3.0" + lodash.snakecase "^4.1.1" + readline-sync "^1.4.10" + string-length "^6.0.0" + strip-ansi "^7.1.0" + ts-toolbelt "^9.6.0" + type-fest "^4.3.1" + zod "^3.22.2" + +"@molt/types@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@molt/types/-/types-0.2.0.tgz#be19a4c16d944deb93c3d8221170b88eeb9a3085" + integrity sha512-p6ChnEZDGjg9PYPec9BK6Yp5/DdSrYQvXTBAtgrnqX6N36cZy37ql1c8Tc5LclfIYBNG7EZp8NBcRTYJwyi84g== + dependencies: + ts-toolbelt "^9.6.0" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -2773,6 +2842,16 @@ ajv@^8.0.0, ajv@^8.10.0: json-schema-traverse "^1.0.0" require-from-string "^2.0.2" +alge@0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/alge/-/alge-0.8.1.tgz#f3d8a9ceecaf6d56981ecb2a4804a0e6dd7f4e6b" + integrity sha512-kiV9nTt+XIauAXsowVygDxMZLplZxDWt0W8plE/nB32/V2ziM/P/TxDbSVK7FYIUt2Xo16h3/htDh199LNPCKQ== + dependencies: + lodash.ismatch "^4.4.0" + remeda "^1.0.0" + ts-toolbelt "^9.6.0" + zod "^3.17.3" + ansi-colors@^4.1.1, ansi-colors@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" @@ -3271,7 +3350,7 @@ chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^5.4.1: +chalk@^5.3.0, chalk@^5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.4.1.tgz#1b48bf0963ec158dce2aacf69c093ae2dd2092d8" integrity sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w== @@ -3712,6 +3791,19 @@ dotenv@^8.1.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== +dprint@^0.45.1: + version "0.45.1" + resolved "https://registry.yarnpkg.com/dprint/-/dprint-0.45.1.tgz#3cab696fb0eb0f95d975eb534832f2d998aa8819" + integrity sha512-OYefcDgxd6jSdig/Cfkw1vdvyiOIRruCPnqGBbXpc95buDt9kvwL+Lic1OHc+SaQSsQub0BUZMd5+TNgy8Sh3A== + optionalDependencies: + "@dprint/darwin-arm64" "0.45.1" + "@dprint/darwin-x64" "0.45.1" + "@dprint/linux-arm64-glibc" "0.45.1" + "@dprint/linux-arm64-musl" "0.45.1" + "@dprint/linux-x64-glibc" "0.45.1" + "@dprint/linux-x64-musl" "0.45.1" + "@dprint/win32-x64" "0.45.1" + dset@^3.1.2, dset@^3.1.4: version "3.1.4" resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.4.tgz#f8eaf5f023f068a036d08cd07dc9ffb7d0065248" @@ -4593,7 +4685,19 @@ graphql-language-service-utils@^2.7.1: graphql-language-service-types "^1.8.7" nullthrows "^1.0.0" -graphql-request@6.0.0, "graphql-request@^4.0.0 || ^5.0.0 || ^6.0.0", graphql-request@^6.0.0: +graphql-request@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-7.0.0.tgz#a402daca246fbb41f869fee77161482d68ecc488" + integrity sha512-KJ7+YFvxSqSUFHsnBGZtT6lCuyieiaBaKKDor+G2dghKA68//WsmHKKiugoc9CW0oH8l3NYuCdXAAiUSaDkTcw== + dependencies: + "@dprint/formatter" "^0.3.0" + "@dprint/typescript" "^0.90.4" + "@graphql-typed-document-node/core" "^3.2.0" + "@molt/command" "^0.9.0" + dprint "^0.45.1" + zod "^3.23.5" + +"graphql-request@^4.0.0 || ^5.0.0 || ^6.0.0", graphql-request@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-6.0.0.tgz#9c8b6a0c341f289e049936d03cc9205300faae1c" integrity sha512-2BmHTuglonjZvmNVw6ZzCfFlW/qkIPds0f+Qdi/Lvjsl3whJg2uvHmSvHnLWhUTEw6zcxPYAHiZoPvSVKOZ7Jw== @@ -5792,6 +5896,11 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -5802,6 +5911,11 @@ lodash.get@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== +lodash.ismatch@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" + integrity sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g== + lodash.memoize@4.x, lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -5817,6 +5931,11 @@ lodash.mergewith@4.6.2: resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55" integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ== +lodash.snakecase@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" + integrity sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw== + lodash.startcase@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" @@ -6622,6 +6741,11 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" +readline-sync@^1.4.10: + version "1.4.10" + resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.10.tgz#41df7fbb4b6312d673011594145705bf56d8873b" + integrity sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw== + redux-thunk@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-3.1.0.tgz#94aa6e04977c30e14e892eae84978c1af6058ff3" @@ -6708,6 +6832,11 @@ relay-runtime@12.0.0: fbjs "^3.0.0" invariant "^2.2.4" +remeda@^1.0.0: + version "1.61.0" + resolved "https://registry.yarnpkg.com/remeda/-/remeda-1.61.0.tgz#dccd31ab75d0f02865f3ef89e4f0ce0076096464" + integrity sha512-caKfSz9rDeSKBQQnlJnVW3mbVdFgxgGWQKq1XlFokqjf+hQD5gxutLGTTY2A/x24UxVyJe9gH5fAkFI63ULw4A== + remedial@^1.0.7: version "1.0.8" resolved "https://registry.yarnpkg.com/remedial/-/remedial-1.0.8.tgz#a5e4fd52a0e4956adbaf62da63a5a46a78c578a0" @@ -7153,6 +7282,13 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" +string-length@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-6.0.0.tgz#1c7342bbf032129b2f80003e69f889c70231d791" + integrity sha512-1U361pxZHEQ+FeSjzqRpV+cu2vTzYeWeafXFLykiFlv4Vc0n3njgU8HrMbyik5uwm77naWMuVG8fhEF+Ovb1Kg== + dependencies: + strip-ansi "^7.1.0" + "string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -7421,6 +7557,11 @@ ts-node@10.9.2, ts-node@^10.9.1: v8-compile-cache-lib "^3.0.1" yn "3.1.1" +ts-toolbelt@^9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/ts-toolbelt/-/ts-toolbelt-9.6.0.tgz#50a25426cfed500d4a09bd1b3afb6f28879edfd5" + integrity sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w== + tsconfig-paths@^3.15.0: version "3.15.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" @@ -7468,6 +7609,11 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== +type-fest@^4.3.1: + version "4.41.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.41.0.tgz#6ae1c8e5731273c2bf1f58ad39cbae2c91a46c58" + integrity sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA== + typed-array-buffer@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz#a72395450a4869ec033fd549371b47af3a2ee536" @@ -7946,6 +8092,11 @@ zen-observable@0.8.15: resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ== +zod@^3.17.3, zod@^3.22.2, zod@^3.23.5: + version "3.25.7" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.25.7.tgz#74184ecfe03ef8c67a62393008117b3b8d9cc48c" + integrity sha512-YGdT1cVRmKkOg6Sq7vY7IkxdphySKnXhaUmFI4r4FcuFVNgpCb9tZfNwXbT6BPjD5oz0nubFsoo9pIqKrDcCvg== + zod@^3.20.2: version "3.24.4" resolved "https://registry.yarnpkg.com/zod/-/zod-3.24.4.tgz#e2e2cca5faaa012d76e527d0d36622e0a90c315f" From 414dce0f568e2dcd5a429771971b4bf45909ce0d Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Tue, 20 May 2025 22:40:57 +1000 Subject: [PATCH 2/8] Add changeset --- .changeset/thin-clowns-punch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/thin-clowns-punch.md diff --git a/.changeset/thin-clowns-punch.md b/.changeset/thin-clowns-punch.md new file mode 100644 index 0000000000..5dacac9bf7 --- /dev/null +++ b/.changeset/thin-clowns-punch.md @@ -0,0 +1,5 @@ +--- +'@graphql-codegen/typescript-graphql-request': patch +--- + +Make graphql-request@v7 peerDep From 013cad5f20c3cfcf64e2a91453751bf63c69d0e0 Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Tue, 20 May 2025 23:42:00 +1000 Subject: [PATCH 3/8] Update dev graphql-request --- .../typescript/graphql-request/package.json | 2 +- yarn.lock | 154 +----------------- 2 files changed, 6 insertions(+), 150 deletions(-) diff --git a/packages/plugins/typescript/graphql-request/package.json b/packages/plugins/typescript/graphql-request/package.json index de29fe08ce..fe72f4005b 100644 --- a/packages/plugins/typescript/graphql-request/package.json +++ b/packages/plugins/typescript/graphql-request/package.json @@ -50,7 +50,7 @@ "devDependencies": { "@graphql-codegen/testing": "1.18.3", "@graphql-tools/schema": "10.0.23", - "graphql-request": "7.0.0" + "graphql-request": "7.1.2" }, "publishConfig": { "directory": "dist", diff --git a/yarn.lock b/yarn.lock index 592436a3e1..a7aec25455 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1257,51 +1257,6 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@dprint/darwin-arm64@0.45.1": - version "0.45.1" - resolved "https://registry.yarnpkg.com/@dprint/darwin-arm64/-/darwin-arm64-0.45.1.tgz#3c989b5fd7122a61f20ec95db1a3e6f020634a90" - integrity sha512-pH0/uKLJ5SJPoHhOwLWFMhCmL0BY3FzWQbull8OGMK/FRkIPgOl2adZSovtUZpUMGWyDOzIWH1fW9X2DuMhnEg== - -"@dprint/darwin-x64@0.45.1": - version "0.45.1" - resolved "https://registry.yarnpkg.com/@dprint/darwin-x64/-/darwin-x64-0.45.1.tgz#f024fa56804ecdb7b52e31e698b95c5f8fc9e8d1" - integrity sha512-YUj421LmBLDlxpIER3pORKfQmpmXD50n5mClHjpZrnl17WTiHtQ+jHvDJdJoxH2eS66W0mQyxLoGo5SfFfiM7A== - -"@dprint/formatter@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@dprint/formatter/-/formatter-0.3.0.tgz#e374398c8e8d7dbf50e8208c87af44a66de0cb2e" - integrity sha512-N9fxCxbaBOrDkteSOzaCqwWjso5iAe+WJPsHC021JfHNj2ThInPNEF13ORDKta3llq5D1TlclODCvOvipH7bWQ== - -"@dprint/linux-arm64-glibc@0.45.1": - version "0.45.1" - resolved "https://registry.yarnpkg.com/@dprint/linux-arm64-glibc/-/linux-arm64-glibc-0.45.1.tgz#e31be90fd8483f8b79c0a7081c7befb167c5865e" - integrity sha512-lJ7s/pOQWRJ0mstjZQnVyX2/3QRXZ9cpFHJDZ7e81Y8QSn/iqxTrnK0DPgxUrDG8hYKQmWQdQLU4sP5DKBz0Jg== - -"@dprint/linux-arm64-musl@0.45.1": - version "0.45.1" - resolved "https://registry.yarnpkg.com/@dprint/linux-arm64-musl/-/linux-arm64-musl-0.45.1.tgz#ff5ad5ce0d55d8ff35139992f283765326a0bc2b" - integrity sha512-un2awe1L1sAJLsCPSEUrE0/cgupdzbYFoyBOutyU1zHR9KQn47AtIDw+chvuinU4xleHDuEGyXGuJ6NE+Ky6vw== - -"@dprint/linux-x64-glibc@0.45.1": - version "0.45.1" - resolved "https://registry.yarnpkg.com/@dprint/linux-x64-glibc/-/linux-x64-glibc-0.45.1.tgz#890a1c42507746d2082778ec67d6e2873b6c7f71" - integrity sha512-5Civht90S/g8zlyYB7n4oH78p+sLbNqeFCFuImJRK7uRxZwCRya7lji6RwlB6DQ7qngVqovTHj9RLOYfZzfVlg== - -"@dprint/linux-x64-musl@0.45.1": - version "0.45.1" - resolved "https://registry.yarnpkg.com/@dprint/linux-x64-musl/-/linux-x64-musl-0.45.1.tgz#53508925c105c8392335f0b6e15c49334e631c96" - integrity sha512-p2/gjnHDd8GRCvtey5HZO4o/He6pSmY/zpcCuIXprFW9P0vNlEj3DFhz4FPpOKXM+csrsVWWs2E0T/xr5QZtVg== - -"@dprint/typescript@^0.90.4": - version "0.90.5" - resolved "https://registry.yarnpkg.com/@dprint/typescript/-/typescript-0.90.5.tgz#22bd5a218c5ac8c4cdcdfa4fb044bf2ef6f6ddb2" - integrity sha512-/1aP6saonFvJyQN3l2is6eTOec3GnLGyW+opid/eDm8pnlhwzYl8A9p36pI6WO5jLl/a9Ghod+LWpvSOuXFGUw== - -"@dprint/win32-x64@0.45.1": - version "0.45.1" - resolved "https://registry.yarnpkg.com/@dprint/win32-x64/-/win32-x64-0.45.1.tgz#6d08308cf08e4b751efb0692ded28b57d42a365d" - integrity sha512-2l78XM7KsW46P2Yv6uPB3fE+y92EsBlrCxi+RVQ0pbznPFdMdkLyGgaCuh683zdld14jHlaADpIQ7YchGAEMAg== - "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.7.0": version "4.7.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz#607084630c6c033992a082de6e6fbc1a8b52175a" @@ -2218,30 +2173,6 @@ globby "^11.0.0" read-yaml-file "^1.1.0" -"@molt/command@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@molt/command/-/command-0.9.0.tgz#3c77efe435beb6062da8ba96097f8f82e9bee51c" - integrity sha512-1JI8dAlpqlZoXyKWVQggX7geFNPxBpocHIXQCsnxDjKy+3WX4SGyZVJXuLlqRRrX7FmQCuuMAfx642ovXmPA9g== - dependencies: - "@molt/types" "0.2.0" - alge "0.8.1" - chalk "^5.3.0" - lodash.camelcase "^4.3.0" - lodash.snakecase "^4.1.1" - readline-sync "^1.4.10" - string-length "^6.0.0" - strip-ansi "^7.1.0" - ts-toolbelt "^9.6.0" - type-fest "^4.3.1" - zod "^3.22.2" - -"@molt/types@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@molt/types/-/types-0.2.0.tgz#be19a4c16d944deb93c3d8221170b88eeb9a3085" - integrity sha512-p6ChnEZDGjg9PYPec9BK6Yp5/DdSrYQvXTBAtgrnqX6N36cZy37ql1c8Tc5LclfIYBNG7EZp8NBcRTYJwyi84g== - dependencies: - ts-toolbelt "^9.6.0" - "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -2842,16 +2773,6 @@ ajv@^8.0.0, ajv@^8.10.0: json-schema-traverse "^1.0.0" require-from-string "^2.0.2" -alge@0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/alge/-/alge-0.8.1.tgz#f3d8a9ceecaf6d56981ecb2a4804a0e6dd7f4e6b" - integrity sha512-kiV9nTt+XIauAXsowVygDxMZLplZxDWt0W8plE/nB32/V2ziM/P/TxDbSVK7FYIUt2Xo16h3/htDh199LNPCKQ== - dependencies: - lodash.ismatch "^4.4.0" - remeda "^1.0.0" - ts-toolbelt "^9.6.0" - zod "^3.17.3" - ansi-colors@^4.1.1, ansi-colors@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" @@ -3350,7 +3271,7 @@ chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^5.3.0, chalk@^5.4.1: +chalk@^5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.4.1.tgz#1b48bf0963ec158dce2aacf69c093ae2dd2092d8" integrity sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w== @@ -3791,19 +3712,6 @@ dotenv@^8.1.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== -dprint@^0.45.1: - version "0.45.1" - resolved "https://registry.yarnpkg.com/dprint/-/dprint-0.45.1.tgz#3cab696fb0eb0f95d975eb534832f2d998aa8819" - integrity sha512-OYefcDgxd6jSdig/Cfkw1vdvyiOIRruCPnqGBbXpc95buDt9kvwL+Lic1OHc+SaQSsQub0BUZMd5+TNgy8Sh3A== - optionalDependencies: - "@dprint/darwin-arm64" "0.45.1" - "@dprint/darwin-x64" "0.45.1" - "@dprint/linux-arm64-glibc" "0.45.1" - "@dprint/linux-arm64-musl" "0.45.1" - "@dprint/linux-x64-glibc" "0.45.1" - "@dprint/linux-x64-musl" "0.45.1" - "@dprint/win32-x64" "0.45.1" - dset@^3.1.2, dset@^3.1.4: version "3.1.4" resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.4.tgz#f8eaf5f023f068a036d08cd07dc9ffb7d0065248" @@ -4685,17 +4593,12 @@ graphql-language-service-utils@^2.7.1: graphql-language-service-types "^1.8.7" nullthrows "^1.0.0" -graphql-request@7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-7.0.0.tgz#a402daca246fbb41f869fee77161482d68ecc488" - integrity sha512-KJ7+YFvxSqSUFHsnBGZtT6lCuyieiaBaKKDor+G2dghKA68//WsmHKKiugoc9CW0oH8l3NYuCdXAAiUSaDkTcw== +graphql-request@7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-7.1.2.tgz#52d7fd6d8d08c9f0b00c84a091376ce9fbdfa945" + integrity sha512-+XE3iuC55C2di5ZUrB4pjgwe+nIQBuXVIK9J98wrVwojzDW3GMdSBZfxUk8l4j9TieIpjpggclxhNEU9ebGF8w== dependencies: - "@dprint/formatter" "^0.3.0" - "@dprint/typescript" "^0.90.4" "@graphql-typed-document-node/core" "^3.2.0" - "@molt/command" "^0.9.0" - dprint "^0.45.1" - zod "^3.23.5" "graphql-request@^4.0.0 || ^5.0.0 || ^6.0.0", graphql-request@^6.0.0: version "6.0.0" @@ -5896,11 +5799,6 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" -lodash.camelcase@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" - integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== - lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -5911,11 +5809,6 @@ lodash.get@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== -lodash.ismatch@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" - integrity sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g== - lodash.memoize@4.x, lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -5931,11 +5824,6 @@ lodash.mergewith@4.6.2: resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55" integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ== -lodash.snakecase@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" - integrity sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw== - lodash.startcase@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" @@ -6741,11 +6629,6 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -readline-sync@^1.4.10: - version "1.4.10" - resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.10.tgz#41df7fbb4b6312d673011594145705bf56d8873b" - integrity sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw== - redux-thunk@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-3.1.0.tgz#94aa6e04977c30e14e892eae84978c1af6058ff3" @@ -6832,11 +6715,6 @@ relay-runtime@12.0.0: fbjs "^3.0.0" invariant "^2.2.4" -remeda@^1.0.0: - version "1.61.0" - resolved "https://registry.yarnpkg.com/remeda/-/remeda-1.61.0.tgz#dccd31ab75d0f02865f3ef89e4f0ce0076096464" - integrity sha512-caKfSz9rDeSKBQQnlJnVW3mbVdFgxgGWQKq1XlFokqjf+hQD5gxutLGTTY2A/x24UxVyJe9gH5fAkFI63ULw4A== - remedial@^1.0.7: version "1.0.8" resolved "https://registry.yarnpkg.com/remedial/-/remedial-1.0.8.tgz#a5e4fd52a0e4956adbaf62da63a5a46a78c578a0" @@ -7282,13 +7160,6 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -string-length@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-6.0.0.tgz#1c7342bbf032129b2f80003e69f889c70231d791" - integrity sha512-1U361pxZHEQ+FeSjzqRpV+cu2vTzYeWeafXFLykiFlv4Vc0n3njgU8HrMbyik5uwm77naWMuVG8fhEF+Ovb1Kg== - dependencies: - strip-ansi "^7.1.0" - "string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -7557,11 +7428,6 @@ ts-node@10.9.2, ts-node@^10.9.1: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -ts-toolbelt@^9.6.0: - version "9.6.0" - resolved "https://registry.yarnpkg.com/ts-toolbelt/-/ts-toolbelt-9.6.0.tgz#50a25426cfed500d4a09bd1b3afb6f28879edfd5" - integrity sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w== - tsconfig-paths@^3.15.0: version "3.15.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" @@ -7609,11 +7475,6 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-fest@^4.3.1: - version "4.41.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.41.0.tgz#6ae1c8e5731273c2bf1f58ad39cbae2c91a46c58" - integrity sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA== - typed-array-buffer@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz#a72395450a4869ec033fd549371b47af3a2ee536" @@ -8092,11 +7953,6 @@ zen-observable@0.8.15: resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ== -zod@^3.17.3, zod@^3.22.2, zod@^3.23.5: - version "3.25.7" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.25.7.tgz#74184ecfe03ef8c67a62393008117b3b8d9cc48c" - integrity sha512-YGdT1cVRmKkOg6Sq7vY7IkxdphySKnXhaUmFI4r4FcuFVNgpCb9tZfNwXbT6BPjD5oz0nubFsoo9pIqKrDcCvg== - zod@^3.20.2: version "3.24.4" resolved "https://registry.yarnpkg.com/zod/-/zod-3.24.4.tgz#e2e2cca5faaa012d76e527d0d36622e0a90c315f" From 0a815ecb90e3ec615042d389b4c2b1b83624ce22 Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Tue, 20 May 2025 23:42:15 +1000 Subject: [PATCH 4/8] Handle ESM --- jest.project.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jest.project.js b/jest.project.js index ea2a6db3a6..c468ff2729 100644 --- a/jest.project.js +++ b/jest.project.js @@ -19,7 +19,8 @@ module.exports = ({ dirname, projectMode = true }) => { return { ...(CI || !projectMode ? {} : { displayName: pkg.name.replace('@graphql-codegen/', '') }), - transform: { '^.+\\.tsx?$': 'babel-jest' }, + transform: { '^.+\\.[tj]sx?$': 'babel-jest' }, + transformIgnorePatterns: ['/node_modules/(?!(graphql-request)/)'], testEnvironment: 'node', rootDir: dirname, restoreMocks: true, From 5f0535f110461a654f79b0bf0577a9a9e9e93959 Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Thu, 22 May 2025 22:37:35 +1000 Subject: [PATCH 5/8] Use node-fetch to make nock work for graphql-request --- packages/plugins/typescript/graphql-request/package.json | 3 ++- .../graphql-request/tests/test-files/run-example-query.ts | 3 ++- yarn.lock | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/plugins/typescript/graphql-request/package.json b/packages/plugins/typescript/graphql-request/package.json index fe72f4005b..f8976d5df0 100644 --- a/packages/plugins/typescript/graphql-request/package.json +++ b/packages/plugins/typescript/graphql-request/package.json @@ -50,7 +50,8 @@ "devDependencies": { "@graphql-codegen/testing": "1.18.3", "@graphql-tools/schema": "10.0.23", - "graphql-request": "7.1.2" + "graphql-request": "7.1.2", + "node-fetch": "2.7.0" }, "publishConfig": { "directory": "dist", diff --git a/packages/plugins/typescript/graphql-request/tests/test-files/run-example-query.ts b/packages/plugins/typescript/graphql-request/tests/test-files/run-example-query.ts index 7582fcf534..94ce975ba8 100644 --- a/packages/plugins/typescript/graphql-request/tests/test-files/run-example-query.ts +++ b/packages/plugins/typescript/graphql-request/tests/test-files/run-example-query.ts @@ -1,8 +1,9 @@ import { GraphQLClient } from 'graphql-request'; +import fetch from 'node-fetch'; // FIXME: using `node-fetch` temporarily because `graphql-request@7` uses native fetch, which `nock@13.4` from `@graphql-codegen/testing` does not support import { getSdk } from './graphql-request-sdk.js'; export function runExampleQuery(x: number, y: number) { - const client = new GraphQLClient('http://localhost:4000/graphql'); + const client = new GraphQLClient('http://localhost:4000/graphql', { fetch }); const sdk = getSdk(client); return sdk.Add({ x, y }); } diff --git a/yarn.lock b/yarn.lock index a7aec25455..cb7c772cd4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6059,7 +6059,7 @@ nock@13.3.0: lodash "^4.17.21" propagate "^2.0.0" -node-fetch@^2.5.0, node-fetch@^2.6.1, node-fetch@^2.7.0: +node-fetch@2.7.0, node-fetch@^2.5.0, node-fetch@^2.6.1, node-fetch@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== From aa7f2dac563308676e759c2a8f929fab9f69f97f Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Sat, 24 May 2025 21:49:11 +1000 Subject: [PATCH 6/8] Explicitly target node_modules/graphql-request js files to transform --- jest.project.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jest.project.js b/jest.project.js index c468ff2729..6891607271 100644 --- a/jest.project.js +++ b/jest.project.js @@ -19,7 +19,10 @@ module.exports = ({ dirname, projectMode = true }) => { return { ...(CI || !projectMode ? {} : { displayName: pkg.name.replace('@graphql-codegen/', '') }), - transform: { '^.+\\.[tj]sx?$': 'babel-jest' }, + transform: { + '^.+\\.tsx?$': 'babel-jest', + '/node_modules/graphql-request/.+\\.js$': 'babel-jest', + }, transformIgnorePatterns: ['/node_modules/(?!(graphql-request)/)'], testEnvironment: 'node', rootDir: dirname, From 37f544ba075f1c9b584387480255d1aeaf55da7c Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Sun, 25 May 2025 00:20:20 +1000 Subject: [PATCH 7/8] Hack to avoid running graphql-request@7 integration test with graphql@15 --- .../graphql-request/tests/integration.spec.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/plugins/typescript/graphql-request/tests/integration.spec.ts b/packages/plugins/typescript/graphql-request/tests/integration.spec.ts index 8f9d36b1ed..3e8ffc8cd6 100644 --- a/packages/plugins/typescript/graphql-request/tests/integration.spec.ts +++ b/packages/plugins/typescript/graphql-request/tests/integration.spec.ts @@ -1,6 +1,7 @@ import { join } from 'path'; import { remove, writeFile } from 'fs-extra'; -import { parse } from 'graphql'; +// @ts-ignore +import { OperationTypeNode, parse } from 'graphql'; import { codegen } from '@graphql-codegen/core'; import { mockGraphQLServer } from '@graphql-codegen/testing'; import * as TypeScriptPlugin from '@graphql-codegen/typescript'; @@ -10,6 +11,16 @@ import * as GraphQLRequestPlugin from '../src/index.js'; describe('GraphQL Request Integration', () => { it('should send requests correctly', async () => { + // @ts-ignore + if (!OperationTypeNode) { + // `OperationTypeNode` is a type in `graphql@15`, but it is a native TS enum in `graphql@16`. + // `graphql-request@7` uses `OperationTypeNode` enum to analyse document. + // So, `graphql-request@7` does not work with `graphql@15`. + // + // This block is a hacky way to skip running this test for `graphql@15`. + return; + } + const sdkFileName = 'graphql-request-sdk.ts'; const sdkFilePath = join(__dirname, './test-files', sdkFileName); const typeDefs = parse(/* GraphQL */ ` From 776569a64156c1ae2a72755f5c40fe654aaa6e39 Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Mon, 26 May 2025 19:55:55 +1000 Subject: [PATCH 8/8] Use graphql-request@7.2.0 in dev to suport graphql15 and 16 --- .../plugins/typescript/graphql-request/package.json | 2 +- .../graphql-request/tests/integration.spec.ts | 13 +------------ yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/packages/plugins/typescript/graphql-request/package.json b/packages/plugins/typescript/graphql-request/package.json index f8976d5df0..e413b3acfa 100644 --- a/packages/plugins/typescript/graphql-request/package.json +++ b/packages/plugins/typescript/graphql-request/package.json @@ -50,7 +50,7 @@ "devDependencies": { "@graphql-codegen/testing": "1.18.3", "@graphql-tools/schema": "10.0.23", - "graphql-request": "7.1.2", + "graphql-request": "7.2.0", "node-fetch": "2.7.0" }, "publishConfig": { diff --git a/packages/plugins/typescript/graphql-request/tests/integration.spec.ts b/packages/plugins/typescript/graphql-request/tests/integration.spec.ts index 3e8ffc8cd6..8f9d36b1ed 100644 --- a/packages/plugins/typescript/graphql-request/tests/integration.spec.ts +++ b/packages/plugins/typescript/graphql-request/tests/integration.spec.ts @@ -1,7 +1,6 @@ import { join } from 'path'; import { remove, writeFile } from 'fs-extra'; -// @ts-ignore -import { OperationTypeNode, parse } from 'graphql'; +import { parse } from 'graphql'; import { codegen } from '@graphql-codegen/core'; import { mockGraphQLServer } from '@graphql-codegen/testing'; import * as TypeScriptPlugin from '@graphql-codegen/typescript'; @@ -11,16 +10,6 @@ import * as GraphQLRequestPlugin from '../src/index.js'; describe('GraphQL Request Integration', () => { it('should send requests correctly', async () => { - // @ts-ignore - if (!OperationTypeNode) { - // `OperationTypeNode` is a type in `graphql@15`, but it is a native TS enum in `graphql@16`. - // `graphql-request@7` uses `OperationTypeNode` enum to analyse document. - // So, `graphql-request@7` does not work with `graphql@15`. - // - // This block is a hacky way to skip running this test for `graphql@15`. - return; - } - const sdkFileName = 'graphql-request-sdk.ts'; const sdkFilePath = join(__dirname, './test-files', sdkFileName); const typeDefs = parse(/* GraphQL */ ` diff --git a/yarn.lock b/yarn.lock index cb7c772cd4..07e26ec3dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4593,10 +4593,10 @@ graphql-language-service-utils@^2.7.1: graphql-language-service-types "^1.8.7" nullthrows "^1.0.0" -graphql-request@7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-7.1.2.tgz#52d7fd6d8d08c9f0b00c84a091376ce9fbdfa945" - integrity sha512-+XE3iuC55C2di5ZUrB4pjgwe+nIQBuXVIK9J98wrVwojzDW3GMdSBZfxUk8l4j9TieIpjpggclxhNEU9ebGF8w== +graphql-request@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-7.2.0.tgz#af4aa25f27a087dd4fc93a4ff54a0f59c4487269" + integrity sha512-0GR7eQHBFYz372u9lxS16cOtEekFlZYB2qOyq8wDvzRmdRSJ0mgUVX1tzNcIzk3G+4NY+mGtSz411wZdeDF/+A== dependencies: "@graphql-typed-document-node/core" "^3.2.0"