-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(scalar): add generics to scalars #1522
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
Conversation
fixed this 2 issues now, we got 20 more to fix like this one:
I think it does not recognize that parentType can't be null in this situation |
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 love strong typing! Thank you for looking into this :)
@@ -458,8 +458,8 @@ export function getNullableType(type) { | |||
* These named types do not include modifiers like List or NonNull. | |||
*/ | |||
export type GraphQLNamedType = | |||
| GraphQLScalarType | |||
| GraphQLObjectType | |||
| GraphQLScalarType<any, 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.
Should this be <*, *>
?
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.
- is deprecated on flow type
@@ -532,21 +532,21 @@ function resolveThunk<+T>(thunk: Thunk<T>): T { | |||
* }); | |||
* | |||
*/ | |||
export class GraphQLScalarType { | |||
export class GraphQLScalarType<TInternal = any, TExternal = TInternal> { |
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.
Could you explain what the purpose of / difference between TInternal
and TExternal
is?
Fixed by #3228 |
based on gtkatakura/fullstack-challenge@36cc105
and #1487
and #576
and #914
only 2 flow erros to fix
for the first one, we can do this
for the second one, we can add a type param to valueFromASTUntyped or try to type cast the function (not sure if this is possible)