tylim
11/27/2020, 12:42 PMconst User = objectType({
name: 'User',
definition(t) {
t.model.id()
t.model.name()
t.nullable.model.email() //nullable not working
t.model.posts({
pagination: false,
})
},
})
anyone know how to make the model nullable/nonNull, it is not working, the type follow the prisma model whether i use nullable or nonNulllnikolasburk
t.model
will always use the Prisma version of this field – so you probably can't modify it. However, you should be able to define it like this:
const User = objectType({
name: 'User',
definition(t) {
t.model.id()
t.model.name()
t.nullable.string.email()
t.model.posts({
pagination: false,
})
},
})
Let me know if that works for you 🙂tylim
11/27/2020, 1:43 PMEthan Liu
12/23/2020, 10:31 PMconst User = objectType({
name: 'User',
definition(t) {
t.model.id()
t.model.posts({
args:{where:arg(type:.....)},
})
},
})
it is nice that Prisma provide out of box support for pagination, filtering, orderby as args, but it would be nice to have custom args here so that user can have much more flexibility. Thank you.