From 2fb50339d039a62b272c1f9916ad5a1bcea33f7e Mon Sep 17 00:00:00 2001 From: Jan Beseda Date: Sun, 6 Feb 2022 18:48:51 +0100 Subject: [PATCH] fix(example): with-typescript-graphql graphql-let package migrate (#29996) ## Bug - Partially fixes #25854 - Badly specified package dependency version (`graphql-let`). The new major version required manual migration. As specified [here](/~https://github.com/piglovesyou/graphql-let/releases/tag/v0.18.0). - In `lib/resolvers.ts` ```Module '"*.graphqls"' has no exported member 'MutationResolvers'. Did you mean to use 'import MutationResolvers from "*.graphqls"' instead?ts(2614)``` ## Fixes - Migrate as described in migration guide for `graphql-let` above. - Update some npm packages along the way. --- examples/with-typescript-graphql/.babelrc | 3 ++- examples/with-typescript-graphql/.gitignore | 2 +- examples/with-typescript-graphql/package.json | 20 ++++++++++--------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/examples/with-typescript-graphql/.babelrc b/examples/with-typescript-graphql/.babelrc index 1ff94f7ed28e16..3f909975105876 100644 --- a/examples/with-typescript-graphql/.babelrc +++ b/examples/with-typescript-graphql/.babelrc @@ -1,3 +1,4 @@ { - "presets": ["next/babel"] + "presets": ["next/babel"], + "plugins": ["graphql-let/babel"] } diff --git a/examples/with-typescript-graphql/.gitignore b/examples/with-typescript-graphql/.gitignore index d3dd34733a8bca..bb4ca946e5e9d3 100644 --- a/examples/with-typescript-graphql/.gitignore +++ b/examples/with-typescript-graphql/.gitignore @@ -34,7 +34,7 @@ yarn-error.log* .vercel # graphql-let -__generated__ +.cache *.graphql.d.ts *.graphqls.d.ts .cache diff --git a/examples/with-typescript-graphql/package.json b/examples/with-typescript-graphql/package.json index 72413abcba0295..796b595e1a7047 100644 --- a/examples/with-typescript-graphql/package.json +++ b/examples/with-typescript-graphql/package.json @@ -19,20 +19,22 @@ "react-dom": "^17.0.2" }, "devDependencies": { - "@graphql-codegen/cli": "^1.17.8", - "@graphql-codegen/import-types-preset": "^2.1.8", - "@graphql-codegen/plugin-helpers": "^1.17.8", - "@graphql-codegen/typescript": "^1.17.8", - "@graphql-codegen/typescript-operations": "^1.17.8", - "@graphql-codegen/typescript-react-apollo": "^2.0.6", - "@graphql-codegen/typescript-resolvers": "^1.17.8", + "@graphql-codegen/cli": "^2.2.1", + "@graphql-codegen/import-types-preset": "^2.1.6", + "@graphql-codegen/plugin-helpers": "^2.2.0", + "@graphql-codegen/typescript": "^2.2.4", + "@graphql-codegen/typescript-operations": "^2.1.8", + "@graphql-codegen/typescript-react-apollo": "^3.1.6", + "@graphql-codegen/typescript-resolvers": "^2.3.2", "@types/react": "^16.9.46", "@types/react-dom": "^16.9.8", "@types/react-test-renderer": "^17.0.1", - "babel-jest": "26.3.0", + "@types/jest": "^27.0.2", + "@types/mocha": "^9.0.0", + "babel-jest": "27.2.5", "graphql-let": "^0.18.6", "graphql-tag": "2.11.0", - "jest": "26.4.0", + "jest": "^27.2.5", "react-test-renderer": "^17.0.1", "typescript": "^4.5.4", "yaml-loader": "0.6.0"