customerAddressUpdate method

Future<void> customerAddressUpdate({
  1. required String customerAccessToken,
  2. required String id,
  3. String? address1,
  4. String? address2,
  5. String? company,
  6. String? city,
  7. String? country,
  8. String? firstName,
  9. String? lastName,
  10. String? phone,
  11. String? province,
  12. String? zip,
})

Updated the Address of a Customer, please input only the fields that you wish to update.

Implementation

Future<void> customerAddressUpdate({
  required String customerAccessToken,
  required String id,
  String? address1,
  String? address2,
  String? company,
  String? city,
  String? country,
  String? firstName,
  String? lastName,
  String? phone,
  String? province,
  String? zip,
}) async {
  final MutationOptions _options = MutationOptions(
      document: gql(customerAddressUpdateMutation),
      variables: {
        'address1': address1,
        'address2': address2,
        'company': company,
        'city': city,
        'country': country,
        'firstName': firstName,
        'lastName': lastName,
        'phone': phone,
        'province': province,
        'zip': zip,
        'customerAccessToken': customerAccessToken,
        'id': id
      });
  final QueryResult result = await _graphQLClient!.mutate(_options);
  checkForError(
    result,
    key: 'customerAddressUpdate',
    errorKey: 'customerUserErrors',
  );
}