Skip to content
This repository has been archived by the owner on Feb 10, 2019. It is now read-only.

Add query complexity/dept config option ? #60

Closed
pelletiermaxime opened this issue Oct 30, 2016 · 3 comments
Closed

Add query complexity/dept config option ? #60

pelletiermaxime opened this issue Oct 30, 2016 · 3 comments

Comments

@pelletiermaxime
Copy link
Contributor

Hi, first of all thanks for the great package.

What do you think about adding config options for the QueryComplexity and QueryDept rules of graphql-php ? I know I can set them in my bootstrap for example :

$queryComplexity = DocumentValidator::getRule('QueryComplexity');
$queryComplexity->setMaxQueryComplexity($maxQueryComplexity = 1);

$queryDepth = DocumentValidator::getRule('QueryDepth');
$queryDepth->setMaxQueryDepth($maxQueryDepth = 1);

But I think adding options in config/graphql.php would be more user friendly. What do you think ? If you think it's a good idea I could send a PR.

Thanks.

@dmongeau
Copy link
Member

Yes, we could add this in the config, with null as the default value and set this in the ServiceProvider if the value is other than null just to be sure it doesn't have any impact on people that doesn't need to explicitly set this. A PR would be much appreciated

@idubz33
Copy link

idubz33 commented Nov 29, 2016

@dmongeau any chance you can accept and merge the PR?

@dmongeau
Copy link
Member

Sorry about that, merged!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants