Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,715 changes: 93 additions & 2,622 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,7 @@ members = [
"value",
"parser",
"derive",
"integrations/poem",
"integrations/actix-web",
"integrations/rocket",
"integrations/warp",
"integrations/axum",
"integrations/tide",
]

[workspace.dependencies]
Expand Down
4 changes: 0 additions & 4 deletions docs/en/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
- [Extensions](extensions.md)
- [How extensions are working](extensions_inner_working.md)
- [Available extensions](extensions_available.md)
- [Integrations](integrations.md)
- [Poem](integrations_to_poem.md)
- [Warp](integrations_to_warp.md)
- [Actix-web](integrations_to_actix_web.md)
- [Advanced topics](advanced_topics.md)
- [Custom scalars](custom_scalars.md)
- [Optimizing N+1 queries](dataloader.md)
Expand Down
35 changes: 0 additions & 35 deletions docs/en/src/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,41 +55,6 @@ let schema = Schema::build(Query::default(), EmptyMutation, EmptySubscription)
.finish();
```

### Request data

You can put data inside the context at the execution of the request, it's useful for authentication data for instance.

A little example with a `warp` route:

```rust
# extern crate async_graphql;
# extern crate async_graphql_warp;
# extern crate warp;
# use async_graphql::*;
# use warp::{Filter, Reply};
# use std::convert::Infallible;
# #[derive(Default, SimpleObject)]
# struct Query { name: String }
# struct AuthInfo { pub token: Option<String> }
# let schema = Schema::build(Query::default(), EmptyMutation, EmptySubscription).finish();
# let schema_filter = async_graphql_warp::graphql(schema);
let graphql_post = warp::post()
.and(warp::path("graphql"))
.and(warp::header::optional("Authorization"))
.and(schema_filter)
.and_then( |auth: Option<String>, (schema, mut request): (Schema<Query, EmptyMutation, EmptySubscription>, async_graphql::Request)| async move {
// Do something to get auth data from the header
let your_auth_data = AuthInfo { token: auth };
let response = schema
.execute(
request
.data(your_auth_data)
).await;

Ok::<_, Infallible>(async_graphql_warp::GraphQLResponse::from(response))
});
```

## Headers

With the Context you can also insert and appends headers.
Expand Down
49 changes: 0 additions & 49 deletions docs/en/src/integrations_to_actix_web.md

This file was deleted.

39 changes: 0 additions & 39 deletions docs/en/src/integrations_to_poem.md

This file was deleted.

66 changes: 0 additions & 66 deletions docs/en/src/integrations_to_warp.md

This file was deleted.

38 changes: 0 additions & 38 deletions integrations/actix-web/Cargo.toml

This file was deleted.

Loading