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
-
Is there a clean way to use enums defined in
prisma.schema
, within types created usingtypegraphql
? (I've scoured thetypegraphql
and thetypegraphql-prisma
docs, but am not yet seeing the "right" way to do this...)I'm trying to create the following type (+ input type) :
...where
SoundTypeId
is defined withinprisma.schema
:When I run
prisma generate
to create myprisma client
and invoke the typegraphql-prisma plugin, I get the error:When I then try to register
SoundTypeId
with 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.schema
within typegraphql types, which does not involve this kind of duplication?Thanks,
-K
Beta Was this translation helpful? Give feedback.
All reactions