Skip to content
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

Export scalar configs #651

Closed
beezee opened this issue Dec 25, 2020 · 2 comments
Closed

Export scalar configs #651

beezee opened this issue Dec 25, 2020 · 2 comments

Comments

@beezee
Copy link

beezee commented Dec 25, 2020

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.

@ardatan
Copy link
Collaborator

ardatan commented Dec 25, 2020

@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.

@ardatan
Copy link
Collaborator

ardatan commented Sep 29, 2022

This is available in the latest release! Thanks for the idea!

@ardatan ardatan closed this as completed Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants