updateNoteInCart method
update note in cart
Implementation
Future<Cart> updateNoteInCart({
required String cartId,
required String note,
}) async {
final MutationOptions updateNote = MutationOptions(
document: gql(updateNoteInCartMutation),
variables: {
'cartId': cartId,
'note': note,
'country': ShopifyLocalization.countryCode,
},
);
QueryResult result = await _graphQLClient!.mutate(updateNote);
checkForError(result, key: 'cartNoteUpdate', errorKey: 'userErrors');
return Cart.fromJson(
((result.data!['cartNoteUpdate'] ?? const {})['cart'] ?? const {}));
}