Replies: 1 comment 3 replies
-
|
import the generated enum |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a clean way to use enums defined in
prisma.schema, within types created usingtypegraphql? (I've scoured thetypegraphqland thetypegraphql-prismadocs, but am not yet seeing the "right" way to do this...)I'm trying to create the following type (+ input type) :
...where
SoundTypeIdis defined withinprisma.schema:When I run
prisma generateto create myprisma clientand invoke the typegraphql-prisma plugin, I get the error:When I then try to register
SoundTypeIdwith type-graphql usingregisterEnumType(),...I run into the following error when the schema is constructed in code:
If I then change the registered name, i.e.
All errors disappear - but the result yields effectively duplicate enums in
schema.graphql:Is there a better way to use enums defined in
prisma.schemawithin typegraphql types, which does not involve this kind of duplication?Thanks,
-K
Beta Was this translation helpful? Give feedback.
All reactions