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

Example to integrate with Axum #1184

Closed
bakatest-me opened this issue Sep 3, 2023 · 7 comments · Fixed by #1088
Closed

Example to integrate with Axum #1184

bakatest-me opened this issue Sep 3, 2023 · 7 comments · Fixed by #1088
Labels
duplicate This issue or pull request already exists 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

@bakatest-me
Copy link

Hi everyone i'm newbie in Rust (from Golang). Juniper(Graphql) look very cool.
Can you show me about example to integrate with Axum?

@bakatest-me bakatest-me added the enhancement Improvement of existing features or bugfix label Sep 3, 2023
@kaos
Copy link

kaos commented Sep 30, 2023

I think this is covered by #986

@tyranron tyranron added this to the 0.16.0 milestone Oct 27, 2023
@tyranron tyranron linked a pull request Nov 9, 2023 that will close this issue
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 (not released yet, however).

@tyranron tyranron added k::example Related to usage examples feature New feature or request duplicate This issue or pull request already exists labels Nov 9, 2023
@paulkre
Copy link

paulkre commented Dec 29, 2023

When will juniper_axum be released?

@paulkre
Copy link

paulkre commented Dec 29, 2023

The examples are pretty useless if you can't install the crate.

@LegNeato
Copy link
Member

LegNeato commented Jan 1, 2024

It's being worked on:

https://github.com/graphql-rust/juniper/milestone/4

@alexhancock
Copy link

alexhancock commented Jan 11, 2024

Does anyone know if there is a way to temporarily depend on the crate in the git repo until it is published?

I read https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories, but suspect that because the top level of the https://github.com/graphql-rust/juniper has a Cargo.toml, it will auto-detect and use that as the dependency.

Is there a facility to specify the path inside the git repo, and use that when resolving the dependencies?

@tyranron
Copy link
Member

@alexhancock

Something like this should work OK:

juniper = { git = "https://github.com/graphql-rust/juniper", branch = "master" }
juniper_axum = { git = "https://github.com/graphql-rust/juniper", branch = "master" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists 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.

6 participants