Using react-relay v15.
I have a component that gets a list of orders.
const data = useLazyLoadQuery<OrdersQueryType>(OrdersQuery, {});
I have another component that can delete orders via a mutation.
mutation DeleteOrderMutation($orderId: ID!) {
deleteOrder(input: { orderId: $orderId }) {
order {
id @deleteRecord
}
}
}
If the data
originally had three orders in it, after the mutation runs, it has 2 orders in it, and a null
element where the deleted order was.
Can this be avoided so that the array only has two entries? Adding null checks for arrays contents is not ideal.