This repository has been archived by the owner on Dec 19, 2019. It is now read-only.
Allow introspection by default in production mode #308
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds env.php parameter for disabling introspection: ```php ... 'graphql' => [ 'disable_introspection' => true, ], ... ``` Fixes magento#232
paliarush
approved these changes
Jan 8, 2019
…ry" in production mode
…ry" in production mode
The constructor value passed to `GraphQL\Validator\Rules\DisableIntrospection` must be `int 0` to enable intropection.
pmclain
commented
Jan 24, 2019
@@ -53,7 +61,7 @@ public function __construct( | |||
public function execute(): void | |||
{ | |||
DocumentValidator::addRule(new QueryComplexity($this->queryComplexity)); | |||
DocumentValidator::addRule(new DisableIntrospection()); | |||
DocumentValidator::addRule(new DisableIntrospection((int) $this->introspectionConfig->isIntrospectionDisabled())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@naydav I updated this line casting the bool to int after this change way pushed yesterday b6fe3ff Passing anything other than int 0
here disables introspection https://github.com/webonyx/graphql-php/blob/v0.12.6/src/Validator/Rules/DisableIntrospection.php#L31
Hi @pmclain, thank you for your contribution! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (*)
Adds env.php parameter for disabling introspection:
Fixed Issues (if relevant)
Manual testing scenarios (*)
Validate disabled
env.php
:GraphQL introspection is not allowed, but the query contained __schema or __type
Validate enabled
env.php
, or ensure pathgraphql/disable_introspection
is not set:Contribution checklist (*)