From f18ce55d8ac85f8abaa51bcd8a663ef5c8e78d28 Mon Sep 17 00:00:00 2001 From: Pavel Mineev Date: Sun, 13 Jun 2021 19:40:28 +0300 Subject: [PATCH] (example/with-typescript-grapql): fix deps (#26010) ### Documentation / Examples Fixed one of the items from #25854 - [x] add `@graphql-codegen/import-types-preset` - [x] remove depriceated field `schemaEntrypoint` - [x] add the StackBlitz button - [x] Make sure the linting passes [Live demo on StackBlitz](https://stackblitz.com/github/akellbl4/next.js/tree/example/with-typescript-graphql/fix-deps/examples/with-typescript-graphql) --- examples/with-typescript-graphql/.graphql-let.yml | 2 -- examples/with-typescript-graphql/README.md | 6 ++++++ examples/with-typescript-graphql/package.json | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/with-typescript-graphql/.graphql-let.yml b/examples/with-typescript-graphql/.graphql-let.yml index 160b9d9659c03..c820c15cb4da5 100644 --- a/examples/with-typescript-graphql/.graphql-let.yml +++ b/examples/with-typescript-graphql/.graphql-let.yml @@ -1,8 +1,6 @@ schema: '**/*.graphqls' -schemaEntrypoint: 'lib/type-defs.graphqls' documents: '**/*.graphql' plugins: - - typescript - typescript-operations - typescript-react-apollo cacheDir: __generated__ diff --git a/examples/with-typescript-graphql/README.md b/examples/with-typescript-graphql/README.md index fa868934555bc..2d5b3092cfca6 100644 --- a/examples/with-typescript-graphql/README.md +++ b/examples/with-typescript-graphql/README.md @@ -17,6 +17,12 @@ const News = () => { By default `**/*.graphqls` is recognized as GraphQL schema and `**/*.graphql` as GraphQL documents. If you prefer the other extensions, make sure the settings of the webpack loader in `next.config.js` and `.graphql-let.yml` are consistent. +## Preview + +Preview the example live on [StackBlitz](http://stackblitz.com/): + +[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/with-typescript-graphql) + ## Deploy your own Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example): diff --git a/examples/with-typescript-graphql/package.json b/examples/with-typescript-graphql/package.json index 7caf217e414a1..ad4f75322c5e0 100644 --- a/examples/with-typescript-graphql/package.json +++ b/examples/with-typescript-graphql/package.json @@ -23,6 +23,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "^1.17.8", + "@graphql-codegen/import-types-preset": "1.18.2", "@graphql-codegen/plugin-helpers": "^1.17.8", "@graphql-codegen/typescript": "^1.17.8", "@graphql-codegen/typescript-operations": "^1.17.8",