graphql-rust / juniper

GraphQL server library for Rust
Other
5.72k stars 425 forks source link

Axum integration #1088

Closed btielen closed 1 year ago

btielen commented 2 years ago

This PR provides an integration for Axum including subscriptions (fixes #986)

Get started

Run cargo run -p juniper_axum --example simple from the root directory, and navigate to 127.0.0.1:3000 in your browser.

Other changes

Minor changes were made in other libraries

Discussion

Any help polishing this PR is appreciated :)

btielen commented 2 years ago

In case this PR will get merged, it would be nice to update the projects documentation and book to point out an integration for Axum exists.

btielen commented 2 years ago

Thanks for the feedback, I will take a look at it tomorrow.

harksin commented 2 years ago

:wave: Incredible work :star_struck: , Is there any plan to merge & release it ?

urothis commented 1 year ago

Any blockers on merging this?

Cugatay commented 1 year ago

Hey, are you going to push Axum integration? I loved Axum when I tried it, and I want to use something I already know when using GraphQL

LegNeato commented 1 year ago

There are still outstanding review comments here...

frederikhors commented 1 year ago

@btielen are you able to fix those changes so to merge this?

tyranron commented 1 year ago

I plan to finish it in next few weeks.

tyranron commented 1 year ago

Progress

  1. Reverted graphql_ws::WebsocketError changes, as they're clearly behind theme of this PR.
  2. The same with Cloneing of RootNode. Such refactoring is better to be done properly in a separate PR (if makes sense), as touches all the integration crates.
  3. Added CI integration for juniper_axum.
  4. Added GraphiQL endpoint to juniper_axum.
  5. Migrated to 0.6 axum (without subscriptions yet).
  6. Got rid of GetQueryVariables and JsonRequestBody, which duplicated GraphQLRequest.
tyranron commented 1 year ago

Progress

  1. Parametrized extractor::JuniperRequest with ScalarValue.
  2. Reworked legacy graphql-ws GraphQL over WebSocket Protocol implementation.
  3. Fixed doc tests.
  4. Added new graphql-transport-ws GraphQL over WebSocket Protocol implementation.
  5. Implemented auto-selection between new graphql-transport-ws and legacy graphql-ws GraphQL over WebSocket Protocol implementations.
  6. Add ready-to-go default graphql, subscriptions::ws, subscriptions::graphql_ws and subscriptions::graphql_trasnport_ws handlers.
  7. Polished API docs.
tyranron commented 1 year ago

@LegNeato I'm going to merge this in next few days. Take a final look, if you would like. All the stuff is ready, only minor CI issues are left to be resolved.