Replace generic GraphQLJSON custom scalar with specific ones #33317
-
I think the generic custom GraphQL We're using GraphQL Code Generator and it's really helping our Gatsby development speed. Unfortunately there's a big gap: the Gatsby graph often uses the very generic scalar type Example: To map this to a TypeScript type, we could configure graphql-codegen to map GraphQL scalar type Compare to the Shopify graph, which defines custom We can work around this for now with type casting: file?.childImageSharp?.gatsbyImageData != null &&
<GatsbyImage image={file.childImageSharp.gatsbyImageData as IGatsbyImageData} /> But this sucks to repeat every time, and opens us up to the very kinds of mistakes we're working to prevent in the first place. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Here's our current GraphQL Code Generator configuration, which (among other things) maps GraphQL scalar type
|
Beta Was this translation helpful? Give feedback.
-
This has been delivered. |
Beta Was this translation helpful? Give feedback.
This has been delivered.