Skip to content

Commit 2276708

Browse files
authored
Revert default ID scalar input type to string (#9497)
1 parent bbd1848 commit 2276708

File tree

65 files changed

+104
-93
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+104
-93
lines changed

.changeset/empty-grapes-care.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@graphql-codegen/visitor-plugin-common': patch
3+
'@graphql-codegen/typescript-operations': patch
4+
'@graphql-codegen/typescript': patch
5+
'@graphql-codegen/typescript-resolvers': patch
6+
'@graphql-codegen/client-preset': patch
7+
---
8+
9+
Revert default ID scalar input type to string
10+
11+
We changed the ID Scalar input type from `string` to `string | number` in the latest major version of `typescript` plugin. This causes issues for server plugins (e.g. typescript-resolvers) that depends on `typescript` plugin. This is because the scalar type needs to be manually inverted on setup which is confusing.

dev-test/githunt/typed-document-nodes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> =
88
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
99
/** All built-in and custom scalars, mapped to their actual values */
1010
export type Scalars = {
11-
ID: { input: string | number; output: string };
11+
ID: { input: string; output: string };
1212
String: { input: string; output: string };
1313
Boolean: { input: boolean; output: boolean };
1414
Int: { input: number; output: number };

dev-test/githunt/types.avoidOptionals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> =
77
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
88
/** All built-in and custom scalars, mapped to their actual values */
99
export type Scalars = {
10-
ID: { input: string | number; output: string };
10+
ID: { input: string; output: string };
1111
String: { input: string; output: string };
1212
Boolean: { input: boolean; output: boolean };
1313
Int: { input: number; output: number };

dev-test/githunt/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> =
77
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
88
/** All built-in and custom scalars, mapped to their actual values */
99
export type Scalars = {
10-
ID: { input: string | number; output: string };
10+
ID: { input: string; output: string };
1111
String: { input: string; output: string };
1212
Boolean: { input: boolean; output: boolean };
1313
Int: { input: number; output: number };

dev-test/githunt/types.enumsAsTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> =
77
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
88
/** All built-in and custom scalars, mapped to their actual values */
99
export type Scalars = {
10-
ID: { input: string | number; output: string };
10+
ID: { input: string; output: string };
1111
String: { input: string; output: string };
1212
Boolean: { input: boolean; output: boolean };
1313
Int: { input: number; output: number };

dev-test/githunt/types.flatten.preResolveTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> =
77
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
88
/** All built-in and custom scalars, mapped to their actual values */
99
export type Scalars = {
10-
ID: { input: string | number; output: string };
10+
ID: { input: string; output: string };
1111
String: { input: string; output: string };
1212
Boolean: { input: boolean; output: boolean };
1313
Int: { input: number; output: number };

dev-test/githunt/types.immutableTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> =
77
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
88
/** All built-in and custom scalars, mapped to their actual values */
99
export type Scalars = {
10-
ID: { input: string | number; output: string };
10+
ID: { input: string; output: string };
1111
String: { input: string; output: string };
1212
Boolean: { input: boolean; output: boolean };
1313
Int: { input: number; output: number };

dev-test/githunt/types.preResolveTypes.onlyOperationTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> =
77
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
88
/** All built-in and custom scalars, mapped to their actual values */
99
export type Scalars = {
10-
ID: { input: string | number; output: string };
10+
ID: { input: string; output: string };
1111
String: { input: string; output: string };
1212
Boolean: { input: boolean; output: boolean };
1313
Int: { input: number; output: number };

dev-test/githunt/types.preResolveTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> =
77
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
88
/** All built-in and custom scalars, mapped to their actual values */
99
export type Scalars = {
10-
ID: { input: string | number; output: string };
10+
ID: { input: string; output: string };
1111
String: { input: string; output: string };
1212
Boolean: { input: boolean; output: boolean };
1313
Int: { input: number; output: number };

dev-test/githunt/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> =
77
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
88
/** All built-in and custom scalars, mapped to their actual values */
99
export type Scalars = {
10-
ID: { input: string | number; output: string };
10+
ID: { input: string; output: string };
1111
String: { input: string; output: string };
1212
Boolean: { input: boolean; output: boolean };
1313
Int: { input: number; output: number };

0 commit comments

Comments
 (0)