From d8b4f843cf6f3b1c4da3c5b780777a4f36338962 Mon Sep 17 00:00:00 2001 From: librelois Date: Sat, 29 May 2021 23:11:51 +0200 Subject: [PATCH] perf(gql): schema: use fast mode for req validation & limit req depth --- gql/src/schema.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gql/src/schema.rs b/gql/src/schema.rs index c5ab4f6..d2362f9 100644 --- a/gql/src/schema.rs +++ b/gql/src/schema.rs @@ -37,7 +37,9 @@ pub fn build_schema_with_data(data: GvaSchemaData, logger: bool) -> GvaSchema { mutations::MutationRoot::default(), subscriptions::SubscriptionRoot::default(), ) - .data(data); + .data(data) + .validation_mode(async_graphql::ValidationMode::Fast) + .limit_depth(10); if logger { builder = builder.extension(async_graphql::extensions::Logger); }