Skip to content

Commit c9d50e2

Browse files
committed
fix: support @graphql-codegen/cli v7.0.0
resolves #42
1 parent e3ddc63 commit c9d50e2

10 files changed

Lines changed: 1168 additions & 431 deletions

File tree

package-lock.json

Lines changed: 1102 additions & 355 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
"prepack": "npm run build"
5050
},
5151
"peerDependencies": {
52-
"@graphql-codegen/cli": ">=1.0.0 <7.0.0",
52+
"@graphql-codegen/cli": ">=1.0.0 <8.0.0",
5353
"graphql": ">=14.0.0 <17.0.0",
5454
"vite": ">=2.7.0 <9.0.0"
5555
},
5656
"devDependencies": {
5757
"@danielwaltz/eslint-config": "^3.0.1",
58-
"@graphql-codegen/plugin-helpers": "^6.1.0",
59-
"@graphql-codegen/typescript": "^5.0.7",
60-
"@graphql-codegen/typescript-operations": "^5.0.7",
58+
"@graphql-codegen/plugin-helpers": "^7.0.0",
59+
"@graphql-codegen/typescript": "^6.0.0",
60+
"@graphql-codegen/typescript-operations": "^6.0.0",
6161
"@semantic-release/changelog": "^6.0.3",
6262
"@semantic-release/commit-analyzer": "^13.0.1",
6363
"@semantic-release/git": "^10.0.1",

test/codegen-config-file/__snapshots__/codegen-config-file.spec.ts.snap

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`codegen-config-file > generates 1`] = `
4-
"export type Maybe<T> = T | null;
5-
export type InputMaybe<T> = Maybe<T>;
6-
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
7-
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
8-
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
9-
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
4+
"/** Internal type. DO NOT USE DIRECTLY. */
5+
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
6+
/** Internal type. DO NOT USE DIRECTLY. */
107
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
8+
export type Maybe<T> = T | null;
9+
export type InputMaybe<T> = Maybe<T>;
1110
/** All built-in and custom scalars, mapped to their actual values */
1211
export type Scalars = {
1312
ID: { input: string; output: string; }
@@ -25,6 +24,6 @@ export type Query = {
2524
export type FooQueryVariables = Exact<{ [key: string]: never; }>;
2625
2726
28-
export type FooQuery = { __typename?: 'Query', foo?: string | null };
27+
export type FooQuery = { foo: string | null };
2928
"
3029
`;

test/graphql-config-file/__snapshots__/graphql-config-file.spec.ts.snap

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`graphql-config-file > generates 1`] = `
4-
"export type Maybe<T> = T | null;
5-
export type InputMaybe<T> = Maybe<T>;
6-
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
7-
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
8-
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
9-
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
4+
"/** Internal type. DO NOT USE DIRECTLY. */
5+
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
6+
/** Internal type. DO NOT USE DIRECTLY. */
107
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
8+
export type Maybe<T> = T | null;
9+
export type InputMaybe<T> = Maybe<T>;
1110
/** All built-in and custom scalars, mapped to their actual values */
1211
export type Scalars = {
1312
ID: { input: string; output: string; }
@@ -25,6 +24,6 @@ export type Query = {
2524
export type FooQueryVariables = Exact<{ [key: string]: never; }>;
2625
2726
28-
export type FooQuery = { __typename?: 'Query', foo?: string | null };
27+
export type FooQuery = { foo: string | null };
2928
"
3029
`;

test/graphql-multi-project/__snapshots__/graphql-multi-project.spec.ts.snap

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`graphql-multi-project > generates 1`] = `
4-
"export type Maybe<T> = T | null;
5-
export type InputMaybe<T> = Maybe<T>;
6-
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
7-
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
8-
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
9-
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
4+
"/** Internal type. DO NOT USE DIRECTLY. */
5+
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
6+
/** Internal type. DO NOT USE DIRECTLY. */
107
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
8+
export type Maybe<T> = T | null;
9+
export type InputMaybe<T> = Maybe<T>;
1110
/** All built-in and custom scalars, mapped to their actual values */
1211
export type Scalars = {
1312
ID: { input: string; output: string; }
@@ -25,6 +24,6 @@ export type Query = {
2524
export type FooQueryVariables = Exact<{ [key: string]: never; }>;
2625
2726
28-
export type FooQuery = { __typename?: 'Query', foo?: string | null };
27+
export type FooQuery = { foo: string | null };
2928
"
3029
`;

test/inline-config/__snapshots__/inline-config.spec.ts.snap

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`inline-config > generates 1`] = `
4-
"export type Maybe<T> = T | null;
5-
export type InputMaybe<T> = Maybe<T>;
6-
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
7-
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
8-
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
9-
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
4+
"/** Internal type. DO NOT USE DIRECTLY. */
5+
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
6+
/** Internal type. DO NOT USE DIRECTLY. */
107
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
8+
export type Maybe<T> = T | null;
9+
export type InputMaybe<T> = Maybe<T>;
1110
/** All built-in and custom scalars, mapped to their actual values */
1211
export type Scalars = {
1312
ID: { input: string; output: string; }
@@ -25,6 +24,6 @@ export type Query = {
2524
export type FooQueryVariables = Exact<{ [key: string]: never; }>;
2625
2726
28-
export type FooQuery = { __typename?: 'Query', foo?: string | null };
27+
export type FooQuery = { foo: string | null };
2928
"
3029
`;

test/main/__snapshots__/main.spec.ts.snap

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`main > generates on file add 1`] = `
4-
"export type Maybe<T> = T | null;
5-
export type InputMaybe<T> = Maybe<T>;
6-
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
7-
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
8-
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
9-
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
4+
"/** Internal type. DO NOT USE DIRECTLY. */
5+
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
6+
/** Internal type. DO NOT USE DIRECTLY. */
107
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
8+
export type Maybe<T> = T | null;
9+
export type InputMaybe<T> = Maybe<T>;
1110
/** All built-in and custom scalars, mapped to their actual values */
1211
export type Scalars = {
1312
ID: { input: string; output: string; }
@@ -26,23 +25,22 @@ export type Query = {
2625
export type BarQueryVariables = Exact<{ [key: string]: never; }>;
2726
2827
29-
export type BarQuery = { __typename?: 'Query', bar?: number | null };
28+
export type BarQuery = { bar: number | null };
3029
3130
export type FooQueryVariables = Exact<{ [key: string]: never; }>;
3231
3332
34-
export type FooQuery = { __typename?: 'Query', foo?: string | null };
33+
export type FooQuery = { foo: string | null };
3534
"
3635
`;
3736
3837
exports[`main > generates on file change 1`] = `
39-
"export type Maybe<T> = T | null;
40-
export type InputMaybe<T> = Maybe<T>;
41-
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
42-
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
43-
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
44-
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
38+
"/** Internal type. DO NOT USE DIRECTLY. */
39+
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
40+
/** Internal type. DO NOT USE DIRECTLY. */
4541
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
42+
export type Maybe<T> = T | null;
43+
export type InputMaybe<T> = Maybe<T>;
4644
/** All built-in and custom scalars, mapped to their actual values */
4745
export type Scalars = {
4846
ID: { input: string; output: string; }
@@ -61,23 +59,22 @@ export type Query = {
6159
export type BarQueryVariables = Exact<{ [key: string]: never; }>;
6260
6361
64-
export type BarQuery = { __typename?: 'Query', bar?: number | null };
62+
export type BarQuery = { bar: number | null };
6563
6664
export type FooQueryVariables = Exact<{ [key: string]: never; }>;
6765
6866
69-
export type FooQuery = { __typename?: 'Query', foo?: string | null, bar?: number | null };
67+
export type FooQuery = { foo: string | null, bar: number | null };
7068
"
7169
`;
7270
7371
exports[`main > generates on server start 1`] = `
74-
"export type Maybe<T> = T | null;
75-
export type InputMaybe<T> = Maybe<T>;
76-
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
77-
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
78-
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
79-
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
72+
"/** Internal type. DO NOT USE DIRECTLY. */
73+
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
74+
/** Internal type. DO NOT USE DIRECTLY. */
8075
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
76+
export type Maybe<T> = T | null;
77+
export type InputMaybe<T> = Maybe<T>;
8178
/** All built-in and custom scalars, mapped to their actual values */
8279
export type Scalars = {
8380
ID: { input: string; output: string; }
@@ -96,6 +93,6 @@ export type Query = {
9693
export type FooQueryVariables = Exact<{ [key: string]: never; }>;
9794
9895
99-
export type FooQuery = { __typename?: 'Query', foo?: string | null };
96+
export type FooQuery = { foo: string | null };
10097
"
10198
`;

test/match-on-glob-schema/__snapshots__/match-on-glob-schema.spec.ts.snap

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`match-on-glob-schema > generates on schema change 1`] = `
4-
"export type Maybe<T> = T | null;
5-
export type InputMaybe<T> = Maybe<T>;
6-
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
7-
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
8-
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
9-
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
4+
"/** Internal type. DO NOT USE DIRECTLY. */
5+
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
6+
/** Internal type. DO NOT USE DIRECTLY. */
107
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
8+
export type Maybe<T> = T | null;
9+
export type InputMaybe<T> = Maybe<T>;
1110
/** All built-in and custom scalars, mapped to their actual values */
1211
export type Scalars = {
1312
ID: { input: string; output: string; }
@@ -28,6 +27,6 @@ export type Query = {
2827
export type FooQueryVariables = Exact<{ [key: string]: never; }>;
2928
3029
31-
export type FooQuery = { __typename?: 'Query', foo?: number | null };
30+
export type FooQuery = { foo: number | null };
3231
"
3332
`;

test/match-on-schema/__snapshots__/match-on-schema.spec.ts.snap

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`match-on-schema > generates on schema change 1`] = `
4-
"export type Maybe<T> = T | null;
5-
export type InputMaybe<T> = Maybe<T>;
6-
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
7-
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
8-
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
9-
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
4+
"/** Internal type. DO NOT USE DIRECTLY. */
5+
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
6+
/** Internal type. DO NOT USE DIRECTLY. */
107
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
8+
export type Maybe<T> = T | null;
9+
export type InputMaybe<T> = Maybe<T>;
1110
/** All built-in and custom scalars, mapped to their actual values */
1211
export type Scalars = {
1312
ID: { input: string; output: string; }
@@ -26,6 +25,6 @@ export type Query = {
2625
export type FooQueryVariables = Exact<{ [key: string]: never; }>;
2726
2827
29-
export type FooQuery = { __typename?: 'Query', foo?: string | null };
28+
export type FooQuery = { foo: string | null };
3029
"
3130
`;

test/watch-outside-cwd/__snapshots__/watch-outside-cwd.spec.ts.snap

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`watch-outside-cwd > generates on schema change outside of cwd 1`] = `
4-
"export type Maybe<T> = T | null;
5-
export type InputMaybe<T> = Maybe<T>;
6-
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
7-
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
8-
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
9-
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
4+
"/** Internal type. DO NOT USE DIRECTLY. */
5+
type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
6+
/** Internal type. DO NOT USE DIRECTLY. */
107
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
8+
export type Maybe<T> = T | null;
9+
export type InputMaybe<T> = Maybe<T>;
1110
/** All built-in and custom scalars, mapped to their actual values */
1211
export type Scalars = {
1312
ID: { input: string; output: string; }
@@ -26,6 +25,6 @@ export type Query = {
2625
export type FooQueryVariables = Exact<{ [key: string]: never; }>;
2726
2827
29-
export type FooQuery = { __typename?: 'Query', foo?: string | null };
28+
export type FooQuery = { foo: string | null };
3029
"
3130
`;

0 commit comments

Comments
 (0)