npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ethpollo

v0.1.0

Published

Client side Ethereum GraphQL wrapper

Readme

RPC is dead, long live GraphQL!

Interact with Ethereum contracts using GraphQL. Please note: this is very new, and probably broken.

Why does this exist?

Ethereum nodes recently got a standard for introducing GraphQL APIs, intended as a more modern alternative to the traditional RPC API. This is great, because it means we can take all the fantastic tooling that already exists for GQL and use it in our dApps! But what this API doesn't include is any kind of decoding for contract data. That's where ethpollo comes in...

This project is a custom link for apollo-client which transforms requests to something Ethereum nodes understand, and responses back to what we can understand - all on the client side. For example, you could write a query similar the following:

{
  SimpleStorage @contract {
    get
  }
}

The request will get turned into something like:

{
  call(data="0x...")
}

And then the response will be converted back to:

{
  SimpleStorage: {
    get: 1337
  }
}

Because it's totally client side, we can reap the benefits of the new API without adding in any element of centralisation. If that's not a concern for you and you want even greater control over decoding and further extensions, you should check out EthQL. It's a server side wrapper around the base Ethereum GraphQL API with support for plugins. They're also the folks that helped get this project kick-started!

Get started

Here's a very unassuming example with a pretty standard apollo-client setup.

import { ApolloClient } from 'apollo-client'
import { InMemoryCache } from 'apollo-cache-inmemory'
import { HttpLink } from 'apollo-link-http'
import { concat } from 'apollo-link'
import gql from 'graphql-tag'

const CONTRACT_NAME = 'SimpleStorage'
const CONTRACT_ADDRESS = '0x...'
const CONTRACT_ABI = [...]
const ETHQL_ENDPOINT = 'http://localhost:4000/graphql'

const ethpollo = new Ethpollo(
  CONTRACT_NAME,
  CONTRACT_ADDRESS,
  CONTRACT_ABI,
)

const http = new HttpLink({ uri: ETHQL_ENDPOINT })

const client = new ApolloClient({
  link: concat(ethpollo, http),
  cache: new InMemoryCache(),
})

const query = gql`{
  SimpleStorage @contract {
    get
  }
}`

client.query({ query }).then(console.log)

More docs and an interactive example coming soon to ethpollo.dev.

Future plans

Right now ethpollo has some way to go! It definitely feels like this could be a great alternative to web3.js, but it first needs to support everything that can do. The short term roadmap looks something like the following:

  • [ ] Support parsing event logs
  • [ ] Suport calling non-constant functions (signing and sending transactions)
  • [ ] Support fetching additional data about addresses in the same query

If you have longer term ideas, it'd be great to hear them. You could consider contributing...

Contributing

If you're interested in contributing, that's great! Come hang out on the EthQL Gitter and let's get some ideas going.