DataFetcher<Optional<Bytes32>> getSendRawTransactionDataFetcher() {
    return dataFetchingEnvironment -> {
      try {
        final TransactionPool transactionPool =
            dataFetchingEnvironment.getGraphQlContext().get(GraphQLContextType.TRANSACTION_POOL);
        final Bytes rawTran = dataFetchingEnvironment.getArgument("data");

        final Transaction transaction = Transaction.readFrom(RLP.input(rawTran));
        final ValidationResult<TransactionInvalidReason> validationResult =
            transactionPool.addTransactionViaApi(transaction);
        if (validationResult.isValid()) {
          return Optional.of(transaction.getHash());
        } else {
          throw new GraphQLException(GraphQLError.of(validationResult.getInvalidReason()));
        }
      } catch (final IllegalArgumentException | RLPException e) {
        throw new GraphQLException(GraphQLError.INVALID_PARAMS);
      }
    };
  }
Returns a DataFetcher that fetches the result of sending a raw transaction.

<p>The DataFetcher is a functional interface. It has a single method that takes a
DataFetchingEnvironment object as input and returns the hash of the transaction if it is valid
and added to the transaction pool. If the transaction is invalid, it throws a GraphQLException
with the invalid reason. If the raw transaction data cannot be read, it throws a
GraphQLException with INVALID_PARAMS error.

@return a DataFetcher that fetches the result of sending a raw transaction
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/GraphQLDataFetchers.java