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
Is your feature request related to a problem? Please describe.
In order to use this library alongside GraphQL Code Generator (with GraphQL Config), we had to write a script that extracted the type definitions and converted them into an executable schema:
This works, but it took a while to figure out that this is what I needed to do. It might be difficult for newer folks to use this library if it doesn't play nice with their tooling.
Describe the solution you'd like
The script I mentioned above (rewritten into TS of course) could be included into this library as an alternative entry point like graphql-scalars/schema, which could be imported in a codegen/graphql config like so:
As I said before, the script that just adds all the scalar types together is working for us right now, but we'd like to use the type definitions from this library in other applications which won't have access to that script, so it's not very scalable. Which is weird, since this library is all about scalars. ;)
Additional context
This library has really won us over, there are a lot of types here that we wanted in our schema but didn't have the time budget to implement properly. So the fact that y'all have done it in this project is fantastic, and I wanted to say thanks so much for building this! We've already seen the benefits of a richly typed schema and haven't even taken it to production yet.
The text was updated successfully, but these errors were encountered:
I encountered the same issue here, and was able to resolve it similarly. However I also have a problem with mapping the correct TS type in the graphql code generator config. Now all the auto generated types on these scalars are type any in TS, and I think we are missing type-safety by doing that.
Other than that, you should configure types for scalars in GraphQL Code Generator. This seems out of scope for this library.
See dotansimha/graphql-code-generator#1532
Is your feature request related to a problem? Please describe.
In order to use this library alongside GraphQL Code Generator (with GraphQL Config), we had to write a script that extracted the type definitions and converted them into an executable schema:
This works, but it took a while to figure out that this is what I needed to do. It might be difficult for newer folks to use this library if it doesn't play nice with their tooling.
Describe the solution you'd like
The script I mentioned above (rewritten into TS of course) could be included into this library as an alternative entry point like
graphql-scalars/schema
, which could be imported in a codegen/graphql config like so:Describe alternatives you've considered
As I said before, the script that just adds all the scalar types together is working for us right now, but we'd like to use the type definitions from this library in other applications which won't have access to that script, so it's not very scalable. Which is weird, since this library is all about scalars. ;)
Additional context
This library has really won us over, there are a lot of types here that we wanted in our schema but didn't have the time budget to implement properly. So the fact that y'all have done it in this project is fantastic, and I wanted to say thanks so much for building this! We've already seen the benefits of a richly typed schema and haven't even taken it to production yet.
The text was updated successfully, but these errors were encountered: