removeLineItemsFromCart method
remove line item from cart
Implementation
Future<Cart> removeLineItemsFromCart({
required String cartId,
required List<String> lineIds,
}) async {
final MutationOptions removeLineItem = MutationOptions(
document: gql(removeLineItemFromCartMutation),
variables: {
'cartId': cartId,
'lineIds': lineIds,
'country': ShopifyLocalization.countryCode
},
);
QueryResult result = await _graphQLClient!.mutate(removeLineItem);
checkForError(result, key: 'cartLinesRemove', errorKey: 'userErrors');
return Cart.fromJson(
((result.data!['cartLinesRemove'] ?? const {})['cart'] ?? const {}));
}