checkoutGiftCardRemove method

Future<void> checkoutGiftCardRemove(
  1. String appliedGiftCardId,
  2. String checkoutId, {
  3. bool deleteThisPartOfCache = false,
})

Removes the Gift card that appliedGiftCardId belongs to, from the Checkout that checkoutId belongs to.

Implementation

Future<void> checkoutGiftCardRemove(
    String appliedGiftCardId, String checkoutId,
    {bool deleteThisPartOfCache = false}) async {
  final MutationOptions _options = MutationOptions(
      document: gql(checkoutGiftCardRemoveMutation),
      variables: {
        'appliedGiftCardId': appliedGiftCardId,
        'checkoutId': checkoutId
      });
  final QueryResult result = await _graphQLClient!.mutate(_options);
  checkForError(
    result,
    key: 'checkoutGiftCardRemoveV2',
    errorKey: 'checkoutUserErrors',
  );
  if (deleteThisPartOfCache) {
    _graphQLClient!.cache.writeQuery(_options.asRequest, data: {});
  }
}