Is your feature request related to a problem? Please describe.
The scalar configuration of the typescript plugin allows setting the generated type annotations but doesn't actually do any casts. This results in a mismatch between the annotated type and the real type (ie, a field is marked as a Date when it's actually still a DateTime String from graphql-scalars)
Describe the solution you'd like
Allow me to pass functions for casting scalars, to be applied whenever the scalar is in the return schema. Ideally with an easy shortcut for the graphql-scalars library because they're both projects of The Guild!
Describe alternatives you've considered
There are some (honestly really buggy) middlewares for urql and apollo which provide scalar casting, but they require loading the schema at runtime, which inflates bundle size and makes for worse performance
Is your feature request related to a problem? Please describe.
The scalar configuration of the typescript plugin allows setting the generated type annotations but doesn't actually do any casts. This results in a mismatch between the annotated type and the real type (ie, a field is marked as a Date when it's actually still a
DateTime
String from graphql-scalars)Describe the solution you'd like
Allow me to pass functions for casting scalars, to be applied whenever the scalar is in the return schema. Ideally with an easy shortcut for the graphql-scalars library because they're both projects of The Guild!
Describe alternatives you've considered