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

Add ability to map custom scalar types #19

Open
vladar opened this issue Oct 19, 2020 · 2 comments
Open

Add ability to map custom scalar types #19

vladar opened this issue Oct 19, 2020 · 2 comments

Comments

@vladar
Copy link
Contributor

vladar commented Oct 19, 2020

At the moment, any custom scalar type is replaced with the most generic JSON type. We should allow you to define a map of remoteScalarType => gatsbyScalarType in the config.

Technically it is also possible now by overriding toolkit's types with schema customization. But it is tedious as it has to be done per-field (so if you have fields of type Timestamp on 100 different types, you will have to add 100 type definitions manually).

@vladar
Copy link
Contributor Author

vladar commented Oct 26, 2020

One way to go with it (that is also generic enough) is to allow custom field transformers in sourcing config here:

export const fieldTransformers: IGatsbyFieldTransform[] = [

@aaronadamsCA
Copy link
Contributor

Just ran into this. Couldn't figure out why Gatsby revised gatsbyImageData to be of scalar type GatsbyImageData, but our generated schema from our remote source still shows JSON.

Any chance this toolkit gets some love anytime soon, @vladar, or is it dead?

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