getCartById method
Implementation
Future<Cart> getCartById(String cartId) async {
final cartById = WatchQueryOptions(
document: gql(getCartByIdQuery),
variables: {
'id': cartId,
'country': ShopifyLocalization.countryCode,
},
fetchPolicy: ShopifyConfig.fetchPolicy,
);
QueryResult result = await _graphQLClient!.query(cartById);
checkForError(result);
return Cart.fromJson(result.data!['cart'] ?? const {});
}