I have an updating mutation: ``` const updateRule ...
# orm-help
g
I have an updating mutation:
Copy code
const updateRule = async(_, args, context, info) => {
  return context.prisma.updateRule(
    {
      where: args.id ? { id: args.id } : { name: args.name.toLowerCase() },
      data: {
        examples: args.examples ? {
          create: {
            options: args.examples.options ? {
              create: args.examples.options.map((exampleOption) => ({
                name: exampleOption.name,
                value: exampleOption.value,
              })),
            } : null,
            correct: args.examples.correct,
            incorrect: args.examples.incorrect,
          },
        } : null,
      },
    },
  );
};
And I'm interested in this - if the
Rule
has field
examples
but I passed
null
to it, will field
examples
become
null
or not?
h
If it allowed in the datamodel, mean there should not be a
!
in the type of example then yes null is allowed
g
@Harshit it is not allowed in my datamodel. The question was not 'is` null` allowed or not' but 'will the value change if I pass `null`'. I remember I did it before and it didn't change anything but not sure how it works in new API.
h
If there is no bang ie ,
!
null will work