updateCheckoutEmail method

Future<Checkout> updateCheckoutEmail(
  1. String checkoutId,
  2. String email
)

Update email of the checkout.

Implementation

Future<Checkout> updateCheckoutEmail(
  String checkoutId,
  String email,
) async {
  final MutationOptions _options = MutationOptions(
    document: gql(checkoutEmailUpdateMutation),
    variables: {
      'checkoutId': checkoutId,
      'email': email,
    },
  );
  final QueryResult result = await _graphQLClient!.mutate(_options);
  checkForError(
    result,
    key: 'checkoutEmailUpdateV2',
    errorKey: 'checkoutUserErrors',
  );

  return Checkout.fromJson(
      ((result.data!['checkoutEmailUpdateV2'] ?? const {})['checkout'] ??
          const {}));
}