Add Elysia server support to grafserv
Summary
This PR adds support for the Elysia web framework to grafserv, enabling developers to use Elysia as a server option for their GraphQL APIs.
Changes
- New ElysiaGrafserv class: Implements full integration with Elysia framework
- GraphQL support: Complete GraphQL query and mutation handling
- GraphiQL interface: Built-in GraphiQL IDE support
- WebSocket support: GraphQL subscriptions via graphql-ws protocol
- Event stream support: Server-sent events for watch mode
- Package configuration: Added Elysia as an optional peer dependency with proper export paths
Implementation details
The implementation follows the same patterns as existing server integrations (Koa, Express, Fastify, Hono, etc.) and includes:
- Request digest extraction from Elysia context
- WebSocket handler for GraphQL subscriptions
- Event handlers for GraphQL, GraphiQL, and static assets
- Proper header and status code handling
- Stream support for event-stream responses
Test plan
- [ ] Verify GraphQL queries work correctly with Elysia server
- [ ] Test GraphiQL interface loads and functions properly
- [ ] Confirm WebSocket subscriptions work as expected
- [ ] Validate event stream functionality for watch mode
- [ ] Check that the package builds without errors
- [ ] Ensure TypeScript types are properly exported
⚠️ No Changeset found
Latest commit: 940ee0f8c1491cbd706c19a0d9bf1b5ba13777b4
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Thank you for your pull request. Since I am not familiar with Elysia I will not be merging this before the 5.0.0 release, and with the winter holidays coming up it might be 2-3 months before I get around to reviewing it. Rest assured that it is on my TODO list to familiarize myself with this.
In the mean time, have you considered releasing this as its own grafserv-elysia module?