0

I'd like to disable the GraphQL API doc query entry(which lists the document of all my GraphQL Apis) in lighthouse, but I'v not yet found any configuration for that. How can? Thanks.

1 Answers1

4

That is called "introspection" in GraphQL lingo.

You can disable it in the config/lighthouse.php config file.

You can find a section called security like this in there:

    'security' => [
        'max_query_complexity' => \GraphQL\Validator\Rules\QueryComplexity::DISABLED,
        'max_query_depth' => \GraphQL\Validator\Rules\QueryDepth::DISABLED,
        'disable_introspection' => \GraphQL\Validator\Rules\DisableIntrospection::DISABLED,
    ],

Change the DisableIntrospection from DISABLED to ENABLED:

-       'disable_introspection' => \GraphQL\Validator\Rules\DisableIntrospection::DISABLED,
+       'disable_introspection' => \GraphQL\Validator\Rules\DisableIntrospection::ENABLED,

That will block the introspection query from working.

Alex
  • 1,425
  • 11
  • 25