Closed rryter closed 3 years ago
sorry you can't because to query tag name from the DB, you must ask it in your query like
Post{
tags{
name
}
}
so my Select plugin can convert to
prisma.post.findUnique({
select: {
tags: {
select: {
name: true,
},
},
},
})
I see that you take the query result and make your map to return the name in your frontend
Thank you very much for the fast feedback. 👍
Hello :-)
I'm currently trying to achieve the following:
schema.prisma
This generates the correct DB tables and queries (
pal g
).But now I would like to be able receive
tags
as an array of strings, and not objects. I would like to be able to query it like this:I would like to avoid the following:
Is this even possible? I was thinking I should just be able to add a
.map
in the resolver but it does not seem to be as simple as that.Thank you very much.