Skip to content

Conversation

@zuohuadong
Copy link

@zuohuadong zuohuadong commented Dec 1, 2025

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

This commit adds support for the Elysia web framework to grafserv, enabling developers to use Elysia as a server option for their GraphQL APIs.

Changes:
- Added ElysiaGrafserv class with full GraphQL, GraphiQL, and WebSocket support
- Implemented event handlers for GraphQL queries, GraphiQL interface, and event streams
- Added Elysia as an optional peer dependency
- Added export configuration for elysia/v1 in package.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-project-automation github-project-automation bot moved this to 🌳 Triage in V5.0.0 Dec 1, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 1, 2025

⚠️ No Changeset found

Latest commit: 940ee0f

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

@benjie benjie removed this from V5.0.0 Dec 5, 2025
@benjie benjie added this to V5.X Dec 5, 2025
@github-project-automation github-project-automation bot moved this to 🌳 Triage in V5.X Dec 5, 2025
@benjie
Copy link
Member

benjie commented Dec 5, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🌳 Triage

Development

Successfully merging this pull request may close these issues.

2 participants