Al
08/05/2020, 5:21 AMModelWhereInput
of Prisma 2 accept for string
(for example) type name: String | StringFilter
.
I'm trying to recreate the same input object with nexus, but seems if there where multiple inputs with same name, the last input will override the others
schema.inputObjectType({
name: 'StringFilter',
definition(t) {
t.string('equals')
t.string('contains')
},
})
schema.inputObjectType({
name: 'ModelWhereMany',
definition(t) {
t.string('name')
t.field('name', {type:'StringFilter'})
},
})
schema.objectType({
name: "Query",
definition(t) {
t.field("findManyModel", {
type: "Model",
args: {
where: schema.arg('ModelWhereMany')
},
async resolve() // other code
}
});
So in this case I have only StringFilter
There is a workaround for that or could be a new feature?Ryan
08/05/2020, 6:45 AMAl
08/05/2020, 6:55 AMschema.inputObjectType({
name: 'ModelWhereMany',
definition(t) {
t.string('name')
t.field('nameFilter', {type:'StringFilter'})
},
})
I think it should work!Ryan
08/05/2020, 6:57 AMAl
08/05/2020, 7:07 AM