You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The generated ScalarConfig are invalid for flow types.
To Reproduce
Given a scalar type (e.g. DateTime), a DateTimeScalarType is generated of kind interface. However, the GraphQLScalarTypeConfig flow type from graphqlis a type, which makes it impossible to extend as an interface.
For TypeScript, the GraphQLScalarTypeConfig is an interface, which makes it extendible, but not for FlowType.
Expected behavior
I wonder what the purpose of this ScalarConfig is in the first place. Is it really necessary to have? I tried to find some explanations in the commit history but the only things I found are:
ad07eaf (but the commit didn't have any useful explanation on what the problem was)
I am also unsure on how the GraphQLScalarTypeConfig can be "extended". Being a type, it's not really possible to do, even with intersections, especially given that the name property is literal.
Maybe I'm doing something wrong or I'm missing something. It would be good to understand the reasons for having that and what are we supposed to do about it.
Many thanks! 🙏
The text was updated successfully, but these errors were encountered:
Describe the bug
The generated
ScalarConfig
are invalid for flow types.To Reproduce
Given a scalar type (e.g.
DateTime
), aDateTimeScalarType
is generated of kindinterface
. However, theGraphQLScalarTypeConfig
flow type fromgraphql
is atype
, which makes it impossible to extend as an interface.For TypeScript, the
GraphQLScalarTypeConfig
is aninterface
, which makes it extendible, but not for FlowType.Expected behavior
I wonder what the purpose of this
ScalarConfig
is in the first place. Is it really necessary to have? I tried to find some explanations in the commit history but the only things I found are:I am also unsure on how the
GraphQLScalarTypeConfig
can be "extended". Being atype
, it's not really possible to do, even with intersections, especially given that thename
property is literal.Example: https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVAXAngBwKZgDiATgIY4AWAigDIDKAxqTKcQCq54DCcAdlAEsA5mAC8YAN4AfML1IBbPAC4wAZwzEBvEVIC+AbkycwAEVIY8bAYsbNWPfsLFEylWrZbtODwSIBkkrIKymAA5GYWVoqhYAboAG6sYIkwAK4hEZbWeB72fL7OEqhgQYoqoQD8FaEANKgGQA
Environment:
0.18.0
11
Maybe I'm doing something wrong or I'm missing something. It would be good to understand the reasons for having that and what are we supposed to do about it.
Many thanks! 🙏
The text was updated successfully, but these errors were encountered: