Hello! I am using Prisma 2 and Apollo server with ...
# orm-help
g
Hello! I am using Prisma 2 and Apollo server with graphql-code-generator for type safe resolvers. I am having trouble with enum mismatch in the to-be returned Prisma response object.
Type '"PRIVATE"' is not assignable to type 'PrivacyScope'.
Where
enum PrivacyScope
has been defined in the exactly same manner in both Prisma and API schema design. In client, I can see that Prisma uses
makeEnun
. What does it do? Could it be the source os this issue? What's the right way to find and fix this issue? P.S. I can also see that for
enum PrivacyScope { PRIVATE }
Prisma goes the
makeEnum
way whereas graphql-code-generator generates a corresponding
enum
type with key-value like
Private = 'PRIVATE'
Error report:
Type '"PRIVATE | "PUBLIC"' is not assignable to type 'PrivacyScope'
Type '"PRIVATE"' is not assignable to type 'PrivacyScope'