Skip to content

Commit 073e723

Browse files
committed
Introspection query is always allowed #9554
Because we depend on introspection for at least: - `<natural-relations>` - `<natural-select-enum>` - `NaturalEnumService` - `NaturalLinkMutationService`
1 parent ecc05db commit 073e723

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/Api/Server.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
use GraphQL\Server\ServerConfig;
1212
use GraphQL\Server\StandardServer;
1313
use GraphQL\Type\Schema;
14-
use GraphQL\Validator\DocumentValidator;
15-
use GraphQL\Validator\Rules\DisableIntrospection;
1614
use Mezzio\Session\SessionMiddleware;
1715
use Psr\Http\Message\ServerRequestInterface;
1816
use Throwable;
@@ -27,20 +25,14 @@ class Server
2725
private readonly ServerConfig $config;
2826

2927
/**
30-
* @param bool $debug if true, allows the introspection query, and dumps stacktrace in case of error
28+
* @param bool $debug if true, dumps stacktrace in case of error
3129
*/
3230
public function __construct(Schema $schema, bool $debug, array $rootValue = [])
3331
{
3432
GraphQL::setDefaultFieldResolver(new FilteredFieldResolver());
3533

3634
$debugFlag = DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE;
3735

38-
// Forbid introspection query in production mode, because our API is not meant to be publicly available
39-
if (!$debug) {
40-
$rule = new DisableIntrospection(DisableIntrospection::ENABLED);
41-
DocumentValidator::addRule($rule);
42-
}
43-
4436
$this->config = ServerConfig::create([
4537
'schema' => $schema,
4638
'queryBatching' => true,

0 commit comments

Comments
 (0)