public Bytes32 getStorage(final DataFetchingEnvironment environment) {
    final BlockchainQueries query = getBlockchainQueries(environment);
    final Bytes32 slot = environment.getArgument("slot");

    if (account.get() instanceof BonsaiAccount) {
      return query
          .getAndMapWorldState(
              blockNumber.orElse(query.headBlockNumber()),
              ws -> Optional.of((Bytes32) ws.get(address).getStorageValue(UInt256.fromBytes(slot))))
          .get();
    } else {
      return account
          .map(a -> (Bytes32) a.getStorageValue(UInt256.fromBytes(slot)))
          .orElse(Bytes32.ZERO);
    }
  }
Returns the storage of the account.

@param environment the DataFetchingEnvironment
@return the storage of the account
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/AccountAdapter.java