checkoutShippingLineUpdate method
Returns Checkout that checkoutId
belongs to, requires shipping.
Implementation
Future<Checkout> checkoutShippingLineUpdate(
String checkoutId,
String shippingRateHandle,
) async {
final MutationOptions _options = MutationOptions(
document: gql(checkoutShippingLineUpdateMutation),
variables: {
'shippingRateHandle': shippingRateHandle,
'checkoutId': checkoutId
});
final QueryResult result = await _graphQLClient!.mutate(_options);
checkForError(
result,
key: 'checkoutShippingLineUpdate',
errorKey: 'checkoutUserErrors',
);
return Checkout.fromJson(
((result.data!['checkoutShippingLineUpdate'] ?? const {})['checkout'] ??
const {}));
}