Hello, I have a question about prisma and nexus. `...
# orm-help
a
Hello, I have a question about prisma and nexus.
ModelWhereInput
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
Copy code
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?
r
Hey @Al 👋 Why not give it a custom name for the time being to not cause any confusion between the built-in types that Nexus provides and your own type.
a
Something like
Copy code
schema.inputObjectType({
  name: 'ModelWhereMany',
  definition(t) {
    t.string('name')
    t.field('nameFilter', {type:'StringFilter'})
  },
})
I think it should work!
r
Yes any custom names will work
a
Yes, if Nexus can't define more than one argument type per name, another name is the only solution! Thanks
💯 1