diff --git a/src/Laravel/ApiPlatformProvider.php b/src/Laravel/ApiPlatformProvider.php index a13fb63b0e..fe9123da09 100644 --- a/src/Laravel/ApiPlatformProvider.php +++ b/src/Laravel/ApiPlatformProvider.php @@ -1294,7 +1294,7 @@ private function registerGraphQl(Application $app): void /** @var ConfigRepository */ $config = $app['config']; - return new Executor($config->get('api-platform.graphql.introspection.enabled') ?? false); + return new Executor($config->get('api-platform.graphql.introspection.enabled') ?? false, $config->get('api-platform.graphql.max_query_complexity'), $config->get('api-platform.graphql.max_query_depth')); }); $app->singleton(GraphiQlController::class, function (Application $app) { diff --git a/src/Laravel/config/api-platform.php b/src/Laravel/config/api-platform.php index f24a85a9a1..6056db6303 100644 --- a/src/Laravel/config/api-platform.php +++ b/src/Laravel/config/api-platform.php @@ -62,7 +62,9 @@ 'graphql' => [ 'enabled' => false, 'nesting_separator' => '__', - 'introspection' => ['enabled' => true] + 'introspection' => ['enabled' => true], + 'max_query_complexity' => 500, + 'max_query_depth' => 200 ], 'exception_to_status' => [