blob: a566c65d3f590ca0a79b1ba571aa206042f94f7a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
use crate::graphql::mutation::Mutation;
use crate::graphql::query::Query;
use async_graphql::{EmptySubscription, Schema};
use async_graphql_axum::{GraphQLRequest, GraphQLResponse};
use axum::extract::Extension;
use super::types::jwt::Authentication;
pub async fn graphql_handler(
schema: Extension<Schema<Query, Mutation, EmptySubscription>>,
auth: Authentication,
req: GraphQLRequest,
) -> GraphQLResponse {
schema.execute(req.0.data(auth)).await.into()
}
|