Skip to content

Commit

Permalink
Revert ts-ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
eddeee888 committed Apr 24, 2024
1 parent 8f0d881 commit 5a226cd
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 40 deletions.
1 change: 0 additions & 1 deletion examples/react/apollo-client-swc-plugin/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
// @ts-ignore
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
Expand Down
1 change: 0 additions & 1 deletion examples/react/nextjs-swr/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
// @ts-ignore
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
Expand Down
1 change: 0 additions & 1 deletion examples/react/tanstack-react-query/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
// @ts-ignore
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
Expand Down
1 change: 0 additions & 1 deletion examples/typescript-graphql-request/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
// @ts-ignore
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
Expand Down
1 change: 0 additions & 1 deletion examples/typescript-resolvers/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
// @ts-ignore
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
Expand Down
6 changes: 2 additions & 4 deletions packages/presets/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion website/src/pages/docs/advanced/how-does-it-work.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
28 changes: 0 additions & 28 deletions website/src/pages/docs/config-reference/schema-field.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -241,7 +230,6 @@ You can also specify multiple patterns:


```ts {4}
// @ts-ignore
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -519,7 +495,6 @@ GITHUB_TOKEN=<YOUR 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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 5a226cd

Please sign in to comment.