From 5a226cd2265bb49519cf4911d55153e5c1252ca1 Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Wed, 24 Apr 2024 20:48:48 +1000 Subject: [PATCH] Revert ts-ignore --- .../react/apollo-client-swc-plugin/codegen.ts | 1 - examples/react/nextjs-swr/codegen.ts | 1 - .../react/tanstack-react-query/codegen.ts | 1 - .../typescript-graphql-request/codegen.ts | 1 - examples/typescript-resolvers/codegen.ts | 1 - packages/presets/client/CHANGELOG.md | 6 ++-- .../advanced/generated-files-colocation.mdx | 2 -- .../pages/docs/advanced/how-does-it-work.mdx | 1 - .../docs/config-reference/schema-field.mdx | 28 ------------------- 9 files changed, 2 insertions(+), 40 deletions(-) diff --git a/examples/react/apollo-client-swc-plugin/codegen.ts b/examples/react/apollo-client-swc-plugin/codegen.ts index d2388e3b1c11..6d94d628656d 100644 --- a/examples/react/apollo-client-swc-plugin/codegen.ts +++ b/examples/react/apollo-client-swc-plugin/codegen.ts @@ -1,5 +1,4 @@ /* eslint-disable import/no-extraneous-dependencies */ -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { diff --git a/examples/react/nextjs-swr/codegen.ts b/examples/react/nextjs-swr/codegen.ts index 6611d1ad4756..0d77bb118c1c 100644 --- a/examples/react/nextjs-swr/codegen.ts +++ b/examples/react/nextjs-swr/codegen.ts @@ -1,5 +1,4 @@ // eslint-disable-next-line import/no-extraneous-dependencies -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { diff --git a/examples/react/tanstack-react-query/codegen.ts b/examples/react/tanstack-react-query/codegen.ts index bee0c4c93554..1a100a3ccf14 100644 --- a/examples/react/tanstack-react-query/codegen.ts +++ b/examples/react/tanstack-react-query/codegen.ts @@ -1,5 +1,4 @@ /* eslint-disable import/no-extraneous-dependencies */ -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { diff --git a/examples/typescript-graphql-request/codegen.ts b/examples/typescript-graphql-request/codegen.ts index edd12fb59fd3..8152d8f114c6 100644 --- a/examples/typescript-graphql-request/codegen.ts +++ b/examples/typescript-graphql-request/codegen.ts @@ -1,5 +1,4 @@ /* eslint-disable import/no-extraneous-dependencies */ -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { diff --git a/examples/typescript-resolvers/codegen.ts b/examples/typescript-resolvers/codegen.ts index e78ae9a2c4e7..6e04a287c8de 100644 --- a/examples/typescript-resolvers/codegen.ts +++ b/examples/typescript-resolvers/codegen.ts @@ -1,5 +1,4 @@ /* eslint-disable import/no-extraneous-dependencies */ -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { diff --git a/packages/presets/client/CHANGELOG.md b/packages/presets/client/CHANGELOG.md index 7ca23cd11de4..fb07695a1cba 100644 --- a/packages/presets/client/CHANGELOG.md +++ b/packages/presets/client/CHANGELOG.md @@ -421,8 +421,7 @@ ```ts /** codegen.ts */ - // @ts-ignore -import { CodegenConfig } from '@graphql-codegen/cli'; + import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', @@ -470,8 +469,7 @@ import { CodegenConfig } from '@graphql-codegen/cli'; ```ts /** codegen.ts */ - // @ts-ignore -import { CodegenConfig } from '@graphql-codegen/cli'; + import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', diff --git a/website/src/pages/docs/advanced/generated-files-colocation.mdx b/website/src/pages/docs/advanced/generated-files-colocation.mdx index 96a54fe439f1..fbe6053bf526 100644 --- a/website/src/pages/docs/advanced/generated-files-colocation.mdx +++ b/website/src/pages/docs/advanced/generated-files-colocation.mdx @@ -17,7 +17,6 @@ For similar results on a back-end project, please refer to [`@graphql-codegen/gr Most GraphQL Code Generator configuration examples (in guides or plugins documentation) generate types in a single common file, as follows: ```ts -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; // Configuration for a React URQL setup @@ -66,7 +65,6 @@ To use this preset, you need to add 2 outputs to your `codegen.ts` file: ```ts filename="codegen.ts" -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { diff --git a/website/src/pages/docs/advanced/how-does-it-work.mdx b/website/src/pages/docs/advanced/how-does-it-work.mdx index fb191ecc1fd8..c723b219b39f 100644 --- a/website/src/pages/docs/advanced/how-does-it-work.mdx +++ b/website/src/pages/docs/advanced/how-does-it-work.mdx @@ -92,7 +92,6 @@ fragment UserFields on User { And with the following `codegen.ts` configuration file: ```ts filename="codegen.ts" -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { diff --git a/website/src/pages/docs/config-reference/schema-field.mdx b/website/src/pages/docs/config-reference/schema-field.mdx index 275a25392bc1..67a918cf509d 100644 --- a/website/src/pages/docs/config-reference/schema-field.mdx +++ b/website/src/pages/docs/config-reference/schema-field.mdx @@ -17,7 +17,6 @@ The `schema` field should point to your `GraphQLSchema` - there are multiple way You can specify the `schema` field in your root level config, as follows: ```ts {4} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -37,7 +36,6 @@ export default config; Or, you can specify it per-output file level. This way you can ```ts {6,10} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -61,7 +59,6 @@ export default config; You can also specify `schema` on both levels: root and output-file, and then GraphQL Code Generator will merge both schemas into one: ```ts {4,7} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -90,7 +87,6 @@ The following can be specified as a single value or an array with mixed values. You can specify a URL to load your `GraphQLSchema` from: ```ts {4} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -107,7 +103,6 @@ export default config; You can also specify custom HTTP headers to be sent with the request: ```ts {7-9} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -132,7 +127,6 @@ You can specify a custom fetch function for the HTTP request, using the module n ```ts {7} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -153,7 +147,6 @@ export default config; You can specify an HTTP method for the introspection query (the default value is `POST`). ```ts {7} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -174,7 +167,6 @@ export default config; Handling the response as SDL will allow you to load schema from remote server that doesn't return a JSON introspection. Example use case is when using schema registry like [GraphQL Hive](https://docs.graphql-hive.com/features/high-availability-cdn#graphql-schema-sdl). ```ts {7} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -196,7 +188,6 @@ You can point to a local `.json` file that contains [GraphQL Introspection](http ```ts {4} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -212,7 +203,6 @@ export default config; You can point to a single `.graphql` file that contains the AST string of your schema: ```ts {4} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -227,7 +217,6 @@ Or, you can point to multiple files using a glob expression (codegen will merge ```ts {4} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -241,7 +230,6 @@ You can also specify multiple patterns: ```ts {4} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -255,7 +243,6 @@ export default config; And, you can specify files to exclude/ignore, using the `!` sign: ```ts {4} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -277,7 +264,6 @@ If you are using `graphql-import` syntax in your schema definitions, you can tel ```ts {7} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -299,7 +285,6 @@ When enabled, converts all deprecated forms of GraphQL comments (marked with `#` ```ts {7} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -322,7 +307,6 @@ Set to true to assume the SDL is valid, and skip any SDL syntax validations. ```ts {7} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -342,7 +326,6 @@ export default config; You can use code files, and the codegen will try to extract the GraphQL schema from it, based on `gql` tag: ```ts {4} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -360,7 +343,6 @@ The codegen will try to load the file as an AST and look for exact GraphQL strin You can disable the `require` if it causes errors for you (for example, because of a different module system or missing dependency): ```ts {7} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -381,7 +363,6 @@ You can disable the AST lookup phase and tell codegen to skip and directly try t ```ts {7} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -401,7 +382,6 @@ export default config; Set this to `true` to tell codegen to skip AST validation. ```ts {7} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -423,7 +403,6 @@ You can also specify a code file that exports your `GraphQLSchema` object as exp ```ts {4} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -455,7 +434,6 @@ You can specify your schema directly as an AST string in your config file. It's ```ts {4} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -474,7 +452,6 @@ You can load your schema file from a remote GitHub file using one of the followi Provide the GitHub path to your schema and token using the following syntax: ```ts {4,5,6,7} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -497,7 +474,6 @@ yarn graphql-codegen Alternatively, you can provide just the GitHub path to your schema: ```ts {4} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -519,7 +495,6 @@ GITHUB_TOKEN= yarn graphql-codegen You can load your schema file from a Git repository using the following syntax: ```ts {4} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -535,7 +510,6 @@ export default config; You can load your schema from Apollo Engine with the following syntax: ```ts -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -560,7 +534,6 @@ export default config; If your schema has a different or complicated way of loading, you can point to a single code file that works for you. ```ts {7,12} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { @@ -636,7 +609,6 @@ export default async () => { Add custom loader to your codegen config: ```ts {7} -// @ts-ignore import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = {