overblog / GraphQLBundle

This bundle provides tools to build a complete GraphQL API server in your Symfony App.
MIT License
783 stars 221 forks source link

Disabling introspection results in an error #1109

Open Luca-Marra opened 1 year ago

Luca-Marra commented 1 year ago
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Version/Branch 0.15.2

Disabling the introspection:

overblog_graphql:
    security:
        enable_introspection: false

results to the following error:

request.CRITICAL: Uncaught PHP Exception Error: "Class "Overblog\GraphQLBundle\__DEFINITIONS__\QueryType" not found" at /app/vendor/overblog/graphql-bundle/src/Definition/Builder/TypeFactory.php
fp-cfr commented 1 year ago

Same here with v0.14.4 with the following Exception:

"Too few arguments to function GraphQL\Validator\Rules\DisableIntrospection::__construct(), 0 passed in /.../vendor/overblog/graphql-bundle/src/Request/Executor.php on line 128 and exactly 1 expected"

The problem is that in the master branch this issues was fixed here by @mcg-web https://github.com/overblog/GraphQLBundle/commit/2cf6f48d8b6903f7e1fb707ed87da941e0ceb806
but in the v.0.14 and v.0.15 branches this was never applied. The webonyx part was commited 2 years ago https://github.com/webonyx/graphql-php/blame/e8dfe9b6a333578f4420294a62c25d951617fec3/src/Validator/Rules/DisableIntrospection.php#L16.

Here is the code with the latest tags. v.0.14 https://github.com/overblog/GraphQLBundle/blob/v0.14.4/src/Request/Executor.php#L128 v.0.15 https://github.com/overblog/GraphQLBundle/blob/v0.15.2/src/Request/Executor.php#L128

I ask myself why this has not been noticed in all these years...