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 Answer 1

6

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.