Skip to content

Commit

Permalink
pin nextjs version
Browse files Browse the repository at this point in the history
  • Loading branch information
YassinEldeeb committed Oct 26, 2023
1 parent 1bed87b commit cb05739
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 11 deletions.
1 change: 1 addition & 0 deletions examples/react/apollo-client-swc-plugin/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */

Check warning on line 1 in examples/react/apollo-client-swc-plugin/codegen.ts

View workflow job for this annotation

GitHub Actions / eslint

examples/react/apollo-client-swc-plugin/codegen.ts#L1

[null] Unused eslint-disable directive (no problems were reported from 'import/no-extraneous-dependencies').
// @ts-ignore

Check failure on line 2 in examples/react/apollo-client-swc-plugin/codegen.ts

View workflow job for this annotation

GitHub Actions / eslint

examples/react/apollo-client-swc-plugin/codegen.ts#L2

[@typescript-eslint/ban-ts-comment] Do not use "@ts-ignore" because it alters compilation errors.
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
Expand Down
1 change: 1 addition & 0 deletions examples/react/nextjs-swr/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// eslint-disable-next-line import/no-extraneous-dependencies

Check warning on line 1 in examples/react/nextjs-swr/codegen.ts

View workflow job for this annotation

GitHub Actions / eslint

examples/react/nextjs-swr/codegen.ts#L1

[null] Unused eslint-disable directive (no problems were reported from 'import/no-extraneous-dependencies').
// @ts-ignore

Check failure on line 2 in examples/react/nextjs-swr/codegen.ts

View workflow job for this annotation

GitHub Actions / eslint

examples/react/nextjs-swr/codegen.ts#L2

[@typescript-eslint/ban-ts-comment] Do not use "@ts-ignore" because it alters compilation errors.
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
Expand Down
2 changes: 1 addition & 1 deletion examples/react/nextjs-swr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@graphql-tools/executor-http": "^1.0.0",
"next": "^13.3.0",
"next": "13.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"swr": "^2.0.0"
Expand Down
1 change: 1 addition & 0 deletions examples/react/tanstack-react-query/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */

Check warning on line 1 in examples/react/tanstack-react-query/codegen.ts

View workflow job for this annotation

GitHub Actions / eslint

examples/react/tanstack-react-query/codegen.ts#L1

[null] Unused eslint-disable directive (no problems were reported from 'import/no-extraneous-dependencies').
// @ts-ignore

Check failure on line 2 in examples/react/tanstack-react-query/codegen.ts

View workflow job for this annotation

GitHub Actions / eslint

examples/react/tanstack-react-query/codegen.ts#L2

[@typescript-eslint/ban-ts-comment] Do not use "@ts-ignore" because it alters compilation errors.
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
Expand Down
1 change: 1 addition & 0 deletions examples/typescript-graphql-request/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */

Check warning on line 1 in examples/typescript-graphql-request/codegen.ts

View workflow job for this annotation

GitHub Actions / eslint

examples/typescript-graphql-request/codegen.ts#L1

[null] Unused eslint-disable directive (no problems were reported from 'import/no-extraneous-dependencies').
// @ts-ignore

Check failure on line 2 in examples/typescript-graphql-request/codegen.ts

View workflow job for this annotation

GitHub Actions / eslint

examples/typescript-graphql-request/codegen.ts#L2

[@typescript-eslint/ban-ts-comment] Do not use "@ts-ignore" because it alters compilation errors.
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
Expand Down
1 change: 1 addition & 0 deletions examples/typescript-resolvers/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */

Check warning on line 1 in examples/typescript-resolvers/codegen.ts

View workflow job for this annotation

GitHub Actions / eslint

examples/typescript-resolvers/codegen.ts#L1

[null] Unused eslint-disable directive (no problems were reported from 'import/no-extraneous-dependencies').
// @ts-ignore

Check failure on line 2 in examples/typescript-resolvers/codegen.ts

View workflow job for this annotation

GitHub Actions / eslint

examples/typescript-resolvers/codegen.ts#L2

[@typescript-eslint/ban-ts-comment] Do not use "@ts-ignore" because it alters compilation errors.
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
Expand Down
6 changes: 4 additions & 2 deletions packages/presets/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@

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

const config: CodegenConfig = {
schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
Expand Down Expand Up @@ -394,7 +395,8 @@

```ts
/** codegen.ts */
import { CodegenConfig } from '@graphql-codegen/cli';
// @ts-ignore
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,6 +17,7 @@ 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 @@ -65,6 +66,7 @@ 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: 1 addition & 0 deletions website/src/pages/docs/advanced/how-does-it-work.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ 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: 28 additions & 0 deletions website/src/pages/docs/config-reference/schema-field.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ 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 @@ -36,6 +37,7 @@ 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 @@ -59,6 +61,7 @@ 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 @@ -87,6 +90,7 @@ 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 @@ -103,6 +107,7 @@ 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 @@ -127,6 +132,7 @@ 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 @@ -147,6 +153,7 @@ 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 @@ -167,6 +174,7 @@ 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 @@ -188,6 +196,7 @@ 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 @@ -203,6 +212,7 @@ 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 @@ -217,6 +227,7 @@ 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 @@ -230,6 +241,7 @@ You can also specify multiple patterns:


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

const config: CodegenConfig = {
Expand All @@ -243,6 +255,7 @@ 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 @@ -264,6 +277,7 @@ 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 @@ -285,6 +299,7 @@ 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 @@ -307,6 +322,7 @@ 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 @@ -326,6 +342,7 @@ 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 @@ -343,6 +360,7 @@ 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 @@ -363,6 +381,7 @@ 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 @@ -382,6 +401,7 @@ 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 @@ -403,6 +423,7 @@ 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 @@ -434,6 +455,7 @@ 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 @@ -452,6 +474,7 @@ 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 @@ -474,6 +497,7 @@ 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 @@ -495,6 +519,7 @@ 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 @@ -510,6 +535,7 @@ 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 @@ -534,6 +560,7 @@ 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 @@ -609,6 +636,7 @@ 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
Loading

0 comments on commit cb05739

Please sign in to comment.