Skip to content

Add SSE Support to graphQLSubscriptionsRoute with Configurable Transport Option #2105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cpoyatos1 opened this issue Apr 26, 2025 · 0 comments
Labels
type: enhancement New feature or request

Comments

@cpoyatos1
Copy link

Is your feature request related to a problem? Please explain.
The graphql-kotlin-ktor-server library has a built-in route function for WebSocket subscriptions (graphQLSubscriptionsRoute), but it doesn’t offer an easy way to handle Server-Sent Events (SSE). Having SSE support would be super helpful since it works over regular HTTP(S), making it easier to work with common tools like Identity & Access Proxies (e.g., Ory Oathkeeper), which usually need special setup to handle WebSockets.

Describe the solution you’d like
It would be great if the existing graphQLSubscriptionsRoute function could be updated to handle different types of connections, not just WebSockets. Maybe by adding a new option like transport: subscriptionTransport = SubscriptionTransport.WEBSOCKET, so we could also pick something like SubscriptionTransport.SSE when needed.

Describe alternatives you’ve considered
Building SSE support from scratch manually.

Additional context
This idea would keep everything under the same routing function, just with more flexibility. It would make it a lot easier to plug into HTTP-based security setups without needing extra complicated configuration.

@cpoyatos1 cpoyatos1 added the type: enhancement New feature or request label Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Development

No branches or pull requests

1 participant