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

effect-graphql

v0.2.1

Published

Derive a GraphQL API from Effect Schema types and Effect-based resolvers.

Readme

effect-graphql

Derive a GraphQL API from Effect Schema types and Effect-based resolvers. Effect owns the runtime; graphql-js owns the wire.

Status

0.x — the surface is stable enough to try, but expect minor breakage until 1.0.

Full documentation is tracked in #15. Remaining GraphQL spec features are catalogued and complexity-rated in #23.

Install

bun add effect-graphql effect graphql
# or npm / pnpm / yarn — effect and graphql are peer dependencies
import { Effect, Layer, Schema } from "effect";
import { Rpc } from "effect/unstable/rpc";
import { Provider, Executor } from "effect-graphql";

class User extends Schema.Class<User>("User")({
  id: Schema.String.annotate({ graphql: { id: true } }),
  name: Schema.String,
}) {}

const provider = Provider.make({
  app: Layer.empty,
  request: Layer.empty,
  query: {
    me: Provider.field({
      rpc: Rpc.make("me", { success: User }),
      resolve: () => Effect.succeed(new User({ id: "u1", name: "Ada" })),
    }),
  },
});

// `Executor.make` wraps `graphql-js` with the two-tier runtime: `app` services
// live for the process, `request` services (auth, loaders, per-request state)
// are rebuilt from `request` fields on every call.
const executor = Executor.make(provider);

const result = await executor.execute({
  query: `{ me { id name } }`,
  request: { method: "POST", url: "/graphql", headers: {}, body: null },
});
console.log(result); // { data: { me: { id: "u1", name: "Ada" } } }

Provider.toSchema(provider) returns the raw GraphQLSchema for tooling (SDL printing, Yoga/Apollo integration) — but you can't graphql() it directly; the resolvers depend on the runtime that Executor.make supplies via contextValue. For the paved-path HTTP server, use Provider.serve(provider) (an effect-platform HttpApp).

Namespaces

| Namespace | Purpose | |---|---| | Provider | Declare your API and reify transports: make, field, augment, toSchema, serve, toRpcGroup, rpcHandlersLayer, rpcServerLayer | | Executor | Materialize a Provider into a runnable executor: make | | Loader | Request-scoped tick-batched loader (DataLoader semantics): make | | ProviderRequest | Context service every request Layer can read; adapters populate ProviderRequest.Fields |

import { graphiql } from "effect-graphql/graphiql" — subpath for the tree-shakable GraphiQL page.

What it does

  • Derives a GraphQLSchema from Schema.Class / Schema.TaggedClass shapes.
  • Runs resolvers as Effect<A, E, R> inside a two-tier runtime (app-scoped services + a per-request context Layer built from headers/method/URL/body).
  • Types errors-as-data via result unions (ADR-0002).
  • Batches loads inside a request via Loader.make (ADR-0003).
  • Ships a Provider.serve HttpApp and a tree-shakable graphiql subpath.

Ideas & roadmap

  • Wishlist (spec features, rated 1–10 complexity): #23
  • Design decisions live in docs/adr/
  • Domain vocabulary lives in CONTEXT.md

License

MIT © Eshin Griffith