Closed chrbala closed 3 years ago
Duplicates #78
These enum values will be changed into an internal type union after #79 is merged.
Hello @cometkim, this bug is still present.
In the release 2.2.0
that PR #80 is missing, probably fail.
Oh no :cry: @orblazer you right. Thank you for notifying it.
Published at v2.2.2
Because of the update to export only global types, enum values break. That is, because enum values pass through the types to the underlying Gatbsy compilation process, the Gatsby compilation process doesn't know how to handle the global types. Example below.
GraphQL definition
This gets transformed to the following in
gatsby-types.ts
Typescript then allows the following usage:
But the actual Gatsby build fails where GatbsyTypes is needed in the runtime because it can't find GatsbyTypes with an error of
"GatsbyTypes" is not defined
. Is it possible to emit both the global types and the older importable types? Otherwise, is there better solution to this?