wesbos
05/10/2018, 1:57 PMError: Cannot return null for non-nullable field CartItem.id.
for a simple mutation - I’ve found a few older threads about this but I wanted to see if you had ideas on what this might benilan
05/10/2018, 2:00 PMnull
but is supposed to return something non-null. Can you share your resolver implementation so we can figure out why this is?wesbos
05/10/2018, 2:01 PMasync removeFromCart(parent, args, ctx, info) {
return ctx.db.mutation.deleteManyCartItems(
{
where: {
id: args.id,
user: {
id: ctx.request.userId,
},
},
},
info
);
},
The only reason I’m using deleteManyCartItems
here is because I want to query based on the item ID and the Users ID - so maybe that is it?nilan
05/10/2018, 2:01 PMdeleteManyCartItems
only returns the field count
wesbos
05/10/2018, 2:02 PMnilan
05/10/2018, 2:02 PMCartItem
wesbos
05/10/2018, 2:02 PMnilan
05/10/2018, 2:02 PMwesbos
05/10/2018, 2:03 PMwesbos
05/10/2018, 2:03 PMnilan
05/10/2018, 2:04 PMcount
nilan
05/10/2018, 2:04 PMCartItem
, you cannot use this approach, or you have to query the CartItem
before running deleteManyCartItems
wesbos
05/10/2018, 2:04 PMweakky
05/10/2018, 2:05 PMwesbos
05/10/2018, 2:05 PMnilan
05/10/2018, 2:05 PMweakky
05/10/2018, 2:06 PM