I need to get data depends on computed field For example
const resolvers = {
Query: {
users: (parent, args, ctx, info) => {
const fragment = `fragment EnsureFullName on User { firstName lastName }`
return ctx.db.query.users({}, addFragmentToInfo(info, fragment))
},
},
User: {
fullName: parent => `${parent.firstName} ${parent.lastName}`,
},
}
I need to get all data where fullname = 'any value',
How can I do that ?
You need to filter manually after fetching from the database or use use a where condition to check if firstName and lastName:
const users = await prisma.users({ where: { firstName: 'any', lastName: 'value' } });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With