Gorodov Maksim
11/24/2018, 11:47 AMconst 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?Harshit
11/24/2018, 5:21 PM! in the type of example then yes null is allowedGorodov Maksim
11/25/2018, 1:14 AMHarshit
11/25/2018, 2:14 AM! null will work