-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync type TS definitions with Flow #2109
Conversation
Specifically: Add `extensions` field in lots of places Reorder fields Both this and graphql#2106 add Path.d.ts, but they're the same. If theres a merge conflict, just pick one.
This will need to wait until #2106 is in, then we can rebase off of it. Currently |
tstypes/type/scalars.d.ts
Outdated
@@ -8,4 +8,4 @@ export const GraphQLID: GraphQLScalarType; | |||
|
|||
export const specifiedScalarTypes: ReadonlyArray<GraphQLScalarType>; | |||
|
|||
export function isSpecifiedScalarType(type: GraphQLScalarType): boolean; | |||
export function isSpecifiedScalarType(type: unknown): type is GraphQLScalarType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought unknown
available only in TS 3.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved it to any
tstypes/type/introspection.d.ts
Outdated
@@ -40,6 +30,8 @@ export const SchemaMetaFieldDef: GraphQLField<any, any>; | |||
export const TypeMetaFieldDef: GraphQLField<any, any>; | |||
export const TypeNameMetaFieldDef: GraphQLField<any, any>; | |||
|
|||
export const introspectionTypes: ReadonlyArray<any>; | |||
export const introspectionTypes: ReadonlyArray< | |||
GraphQLObjectType | GraphQLEnumType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to make it just GraphQLType
since we can latter add different types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it
tstypes/type/definition.d.ts
Outdated
@@ -285,13 +288,16 @@ export class GraphQLScalarType { | |||
serialize: GraphQLScalarSerializer<any>; | |||
parseValue: GraphQLScalarValueParser<any>; | |||
parseLiteral: GraphQLScalarLiteralParser<any>; | |||
extensions: Maybe<Record<string, any>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make them ReadOnly
both in class definitions and inside configs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep!
@IvanGoncharov should be good to go now |
@JacksonKearl Merged 🎉 |
Specifically:
Add
extensions
field in lots of placesReorder fields
Both this and #2106 add Path.d.ts, but they're the same. If theres a merge conflict, just pick one.