Are enums for types rather than just strings a fut...
# prisma-whats-new
a
Are enums for types rather than just strings a future feature?
n
@aurnik Can you elaborate? We already support Enums for a very long time
a
For example I have a Notification type, and it has something like a ‘source’ field that can be one of 3 different other types (such as Image, Post, Comment, etc). Right now we are just setting source as a JSON object that holds the name of the type and its ID, but I was wondering if there will ever be a possibility to set the source field to have a relation enum value of [Image, Post, Comment]
n
@aurnik ahh now I understand. This will be supported, but rather by virtue of interface and Union types: https://github.com/graphcool/feature-requests/issues/83 https://github.com/graphcool/feature-requests/issues/165
a
@nilan Awesome, union types are exactly what we need! Thanks!
👍 1