checkoutCompleteFree method

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

Complete Checkout without providing payment information. You can use this mutation for free items or items whose purchase price is covered by a gift card

Implementation

Future<void> checkoutCompleteFree(String checkoutId,
    {bool deleteThisPartOfCache = false}) async {
  final MutationOptions _options = MutationOptions(
      document: gql(checkoutCompleteFreeMutation),
      variables: {'checkoutId': checkoutId});
  final QueryResult result = await _graphQLClient!.mutate(_options);
  checkForError(
    result,
    key: 'checkoutCompleteFree',
    errorKey: 'checkoutUserErrors',
  );

  if (deleteThisPartOfCache) {
    _graphQLClient!.cache.writeQuery(_options.asRequest, data: {});
  }
}