Does anyone know, is there a way to combine a coup...
# prisma-whats-new
s
Does anyone know, is there a way to combine a couple fields into a "virtual" field? This is a concept I got used to in mongoose. What I'm envisioning is something like the fullName field in this pseudo-type:
Copy code
type Artist @model {
createdAt: DateTime!
updatedAt: DateTime!
id: ID! @isUnique
firstName: String!
lastName: String!
fullName: `{$firstName} {$lastName}`
}
a
I have also run into this issue. This would be a nice addition, although I don’t believe Prisma currently has a solution for virtual fields. My team is running our own
graphql-yoga
server on top of the Prisma database, so we have just added a new field to our public API, in which the resolver for that field acts the same as our mongoose virtual fields used to.
s
I work with steveb and we currently have done the same with a query that resolves the normal query data but provides the “virtual” field in its response. Just wondering if there’s a simpler cleaner approach that is available already.
👍 1