public DataFetcher<Optional<BigInteger>> getChainIdDataFetcher() {
    return dataFetchingEnvironment -> {
      final GraphQLContext graphQLContext = dataFetchingEnvironment.getGraphQlContext();
      return graphQLContext.get(GraphQLContextType.CHAIN_ID);
    };
  }
Returns a DataFetcher that fetches the chain ID of the Ethereum node.

<p>The DataFetcher is a functional interface. It has a single method that takes a
DataFetchingEnvironment object as input and returns the chain ID as an {@code
Optional<BigInteger>}.

@return a DataFetcher that fetches the chain ID of the Ethereum node
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/GraphQLDataFetchers.java