1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Initial GraphQL API

This commit is contained in:
Quentin Gliech
2022-11-04 18:59:25 +01:00
parent 35e5a5a7a7
commit c13b0478e6
10 changed files with 518 additions and 9 deletions

View File

@@ -22,7 +22,7 @@ use mas_router::UrlBuilder;
use mas_templates::Templates;
use sqlx::PgPool;
use crate::MatrixHomeserver;
use crate::{GraphQLSchema, MatrixHomeserver};
#[derive(Clone)]
pub struct AppState {
@@ -34,6 +34,7 @@ pub struct AppState {
pub mailer: Mailer,
pub homeserver: MatrixHomeserver,
pub policy_factory: Arc<PolicyFactory>,
pub graphql_schema: GraphQLSchema,
}
impl FromRef<AppState> for PgPool {
@@ -42,6 +43,12 @@ impl FromRef<AppState> for PgPool {
}
}
impl FromRef<AppState> for GraphQLSchema {
fn from_ref(input: &AppState) -> Self {
input.graphql_schema.clone()
}
}
impl FromRef<AppState> for Templates {
fn from_ref(input: &AppState) -> Self {
input.templates.clone()