GitHub
164
Created 5 years ago, last commit 3 years ago
3 contributors
150 commits
Stars added on GitHub, month by month
0
0
0
0
0
0
0
0
0
0
5
6
7
8
9
10
11
12
1
2
3
4
2024
2025
Stars added on GitHub, per day, on average
Yesterday
=
Last week
0.0
/day
Last month
0.0
/day
Last 12 months
0.0
/day
npmPackage on NPM
Monthly downloads on NPM
5
6
7
8
9
10
11
12
1
2
3
4
2024
2025
README

Stereo

Benzene is a new take on GraphQL server that gives us the control we need while staying blazing fast.

CI codecov PRs Welcome

Features

The @benzene/http and @benzene/ws packages allow us to build a full-featured GraphQL server, featuring:

  • Super minimal (~4kB) and performant. @benzene/http and @benzene/ws purely wrap @benzene/core, which includes minimal dependencies and features no third-party integrations, thus avoiding unnecessary overheads.
  • Transport & Framework agnostic. Each package features generic Request, Response, or WebSocket interfaces to easily plug into any JavaScript frameworks or runtimes: Node.js, Deno, Cloudflare Worker, etc.
  • Customizable runtime. Use custom GraphQL implementation such as graphql-jit or rolling our own for performance and cutting-edge features.
  • Unopinionated and observable APIs. Benzene does not include any middleware or configurations, so we can be in total control of logging, parsing, and error handling.
  • Unified pipeline. Write error handling or context creation function only once. Every transport handler inherits the same Benzene instance and takes advantage of its shared configuration.
  • Fully extensible. Despite not being battery-included, it can be extended with recipes (like Persisted queries) or @benzene/extra.

We are taking an approach opposite to Apollo Server, which abstracts everything behind its applyMiddleware function that includes unexpected and hard-to-customized "defaults". While our approach requires a bit more boilerplate, we achieve an observable and customizable server integration.

Documentation

Documentation is available at benzene.vercel.app

There is also a Getting Started section which shows how to build a real-time book voting app using both @benzene/http and @benzene/ws.

Examples

There are also various examples for integrations with different tools and frameworks.

Contributing

This repository uses the new npm v7 workspaces (yarn 1 workspace may also work). Please see contributing.md.

License

MIT