Why can't something both be marked as `nullable: f...
# graphql-nexus
a
Why can't something both be marked as
nullable: false
and
required: false
??? I have two required fields in my schema one of type string the other boolean. But when updating, I want to something like this. If I only set
nullable: false
then when I go to call my update mutation it asks me to pass in the other fields to update. What if I only want to update one field? And if I set
required: false
my types become messed up and I'm told I can't update data where the value could possibly be
null
I ended up having to do this. Which seems wrong to me.
Copy code
data: {
            text: text!,
            completed: completed!,
          },
r
@Awey đź‘‹ Is this a
create
or an
update
?
a
@Ryan
update
r
In that case, you would need to filter out the nulls first and then pass them into data as Prisma doesn’t accept
null
for a required field as that would cause a database constraint error.