public Optional<Long> getCumulativeGasUsed(final DataFetchingEnvironment environment) {
    return getReceipt(environment).map(rpt -> rpt.getReceipt().getCumulativeGasUsed());
  }
Retrieves the cumulative gas used by the transaction.

<p>This method uses the getReceipt method to get the receipt of the transaction. It then
returns an Optional containing the cumulative gas used by the transaction.

@param environment the data fetching environment.
@return an Optional containing a Long object representing the cumulative gas used by the
    transaction.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/TransactionAdapter.java