Skip to content
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

axum exemple with websockets #986

Closed
mathroc opened this issue Oct 11, 2021 · 2 comments · Fixed by #1088
Closed

axum exemple with websockets #986

mathroc opened this issue Oct 11, 2021 · 2 comments · Fixed by #1088
Assignees
Labels
feature New feature or request k::documentation Related to project documentation k::example Related to usage examples lib::axum Related to `axum` crate integration
Milestone

Comments

@mathroc
Copy link

mathroc commented Oct 11, 2021

Is your feature request related to a problem? Please describe.

I'm trying to build a small graphql server on top of Axum but can't figure out how to get websockets working with it

Describe the solution you'd like

I'd like an example similar to https://github.com/graphql-rust/juniper/tree/master/examples/warp_subscriptions

Describe alternatives you've considered

async-graphql does have an Axum integration but it does not support implementing dynamic schemas (and they don't plan to)

@mathroc mathroc added the enhancement Improvement of existing features or bugfix label Oct 11, 2021
@btielen
Copy link
Contributor

btielen commented Jul 15, 2022

I am working on it. Got a basic test running locally.

@tyranron tyranron added this to the 0.16.0 milestone Oct 27, 2023
tyranron added a commit that referenced this issue Nov 9, 2023
- create `juniper_axum` crate in Cargo workspace
- implement `graphql` default `axum` handler for processing GraphQL requests
- implement `extract::JuniperRequest` and `response::JuniperResponse` for custom processing GraphQL requests
- implement `subscriptions::graphql_transport_ws()` default `axum` handler for processing the new `graphql-transport-ws` GraphQL over WebSocket Protocol
- implement `subscriptions::graphql_ws()` default `axum` handler for processing the legacy `graphql-ws` GraphQL over WebSocket Protocol
- implement `subscriptions::serve_graphql_transport_ws()` function for custom processing the new `graphql-transport-ws` GraphQL over WebSocket Protocol
- implement `subscriptions::serve_graphql_ws()` function for custom processing the legacy `graphql-ws` GraphQL over WebSocket Protocol
- provide `examples/simple.rs` of default `juniper_axum` integration
- provide `examples/custom.rs` of custom `juniper_axum` integration

Additionally:
- fix `junper_actix` crate MSRV to 1.73
- add `test_post_with_variables()` case to integration `juniper::http::tests`

Co-authored-by: ilslv <[email protected]>
Co-authored-by: Christian Legnitto <[email protected]>
Co-authored-by: Kai Ren <[email protected]>
@tyranron tyranron added k::documentation Related to project documentation lib::axum Related to `axum` crate integration and removed enhancement Improvement of existing features or bugfix labels Nov 9, 2023
@tyranron
Copy link
Member

tyranron commented Nov 9, 2023

The examples may be found in juniper_axum/examples and in API docs of subscriptions module (not released yet, however).

@tyranron tyranron added k::example Related to usage examples feature New feature or request labels Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request k::documentation Related to project documentation k::example Related to usage examples lib::axum Related to `axum` crate integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants