Skip to content

Commit 07076ed

Browse files
committed
fix: only load profiler services when Symfony profiler is available
The profiler.yaml was loaded unconditionally, causing GraphQLCollector's event listener to run on every GraphQL request in production. This performed unnecessary query parsing and deep-cloning of results/variables that were never read.
1 parent 7e9f36e commit 07076ed

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/DependencyInjection/OverblogGraphQLExtension.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ private function loadConfigFiles(ContainerBuilder $container): void
8686
$loader->load('expression_language_functions.yaml');
8787
$loader->load('definition_config_processors.yaml');
8888
$loader->load('aliases.yaml');
89-
$loader->load('profiler.yaml');
89+
90+
if ($container->has('profiler')) {
91+
$loader->load('profiler.yaml');
92+
}
9093
}
9194

9295
private function registerForAutoconfiguration(ContainerBuilder $container): void

0 commit comments

Comments
 (0)