How to update a relation

I have a form that contains basically a customer with 1 or more addresses and 1 or more phone numbers. I can create and display everything just fine but I’m running into trouble with updates of the addresses and phone numbers. I currently have something like

export const updateCustomerWithRelations = ({ id, input }) => {
  return db.customer.update({
    data: {
      customer: input.customer:
      addresses: [{
        update: {
          data: { ... },
          where: { ... }
        }
      }],
      phoneNumbers: [{
        update: {
          data: { ... },
          where: { ... }
        }
      }]
    },
    where: { id },
  });
};

But I’m getting an error

Field "update" is not defined by type "UpdateAddressInput".
...
Field "update" is not defined by type "UpdatePhoneNumberInput"

Is it possible to do an update of multiple relations at the same time like this?

I think you are looking for connectOrCreate [ref: Relation queries (Concepts)]

export const updateCustomerWithRelations = ({ id, input }) => {
  return db.customer.update({
    data: {
      customer: input.customer:
      addresses: {
        connectOrCreate: {
          data: { ... },
          where: { ... }
        }
      },
      phoneNumbers: {
        connectOrCreate: {
          data: { ... },
          where: { ... }
        }
      }
    },
    where: { id },
  });
};