-
Hey! I have an enum enum Role {
USER
ADMIN
} but I'm not 100% sure what the correct implementation would be. Is this correct? builder.enumType(Role, {
name: 'Role'
})
builder.prismaObject('User', {
findUnique: (user) => ({ id: user.id }),
fields: (t) => ({
// ... other fields
role: t.field({
type: Role,
resolve: ({ role }) => role
})
})
}) |
Beta Was this translation helpful? Give feedback.
Answered by
hayes
Feb 13, 2022
Replies: 1 comment 3 replies
-
This looks correct, is this causing an issue for you? |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
m4rvr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This looks correct, is this causing an issue for you?