Skip to content

Commit

Permalink
feat(api): set graphql depth and complexity limit
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Mar 1, 2024
1 parent ed2ab70 commit 54b44e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/synd_api/src/gql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ pub mod handler {

#[must_use]
pub fn schema_builder() -> SchemaBuilder<Query, Mutation, EmptySubscription> {
#[cfg(feature = "introspection")]
let schema = Schema::build(Query, Mutation, EmptySubscription);

#[cfg(not(feature = "introspection"))]
let schema = Schema::build(Query, Mutation, EmptySubscription).disable_introspection();
let schema = schema.disable_introspection();

// disabled
// schema.extension(Tracing)
schema
schema.limit_depth(10).limit_complexity(50)
}

impl<'a> usecase::Context for &async_graphql::Context<'a> {
Expand Down

0 comments on commit 54b44e8

Please sign in to comment.