nexus-plugin-prisma
nexus-plugin-prisma copied to clipboard
Filter on computed fields?
Is it possible to filter on computed fields?
It seems that nexus
/ nexus-prisma
does not generate types for computed fields, but I may be missing
I have defined a computed field for my User
model as follows:
t.string('searchField', {
resolve: (parent, _, __) =>
parent.firstname.toLowerCase() +
' ' +
parent.familyname.toLowerCase() +
' ' +
parent.email.toLowerCase(),
});
My user query is defined as:
t.crud.users({ ordering: true, filtering: true });
I am getting the error
Field "searchField" is not defined by type QueryFindManyUserWhereInput.
This would be great!
I have the same question and haven't found anything about it yet.
Is there any way to do this?
Also curious about this, would be very handy.