graphql-scalars
graphql-scalars copied to clipboard
Export scalar configs
If you look here - https://github.com/graphql/graphql-js/blob/607345275f60e07dba1b7156a23b9ddf8b086fc9/src/type/definition.d.ts#L319
You'll see that applying a scalar config to the scalar constructor erases the type information associated with the underlying types on either side of the scalar parse/serialize.
If you expose the configs (done by the typings, not by the compiled js) then it allows typescript programmers to use those configs in places where they want to maintain type safe interactions with data coming in through these scalars.
Hopefully this is a small ask, happy to open a PR if you can point me in the right direction what to change.
@beezee This would be nice! But currently I don't think we have that strong type safety in our scalar configuration for all of them. We need to move the configurations of each of them to a seperate variable.
This is available in the latest release! Thanks for the idea!