Skip to content

How to change return type for createFieldExtension #27710

Answered by vladar
herecydev asked this question in Help
Discussion options

You must be logged in to vote

Hey @herecydev

Thanks for this question! The field type cannot change after it is defined in the schema. The only way you can do this is by setting a custom scalar type on your field. Gatsby includes the most general type: JSON (Date is another example but it's always resolves to string). Technically, you can introduce your own custom scalar type via schema customization (an example) but this is not documented and I would generally recommend staying away from custom scalar types even in regular GraphQL APIs.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@herecydev
Comment options

@vladar
Comment options

Answer selected by herecydev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants