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

Failing main tests / webonyx compatibility #1112

Closed Vincz closed 1 year ago

Vincz commented 1 year ago
Q A
Bug report? yes

Our tests fail with the latest version of webonyx/graphql because of the schema dumping test. Here: https://github.com/webonyx/graphql-php/blob/4ceb094b7850a586f04d487cc33702dd65ef9117/src/Utils/SchemaPrinter.php#L213

They are calling getType() for Query, Mutation and Query. The problem is that our type resolver raises an exception when a requested type is requested (here: https://github.com/overblog/GraphQLBundle/blob/f33382ac2bbdb750cbe448ac74cb1b6207e73c4f/src/Resolver/TypeResolver.php#L67). I think that webonyx/graphql expect us to return null in this case (as shown here: https://github.com/webonyx/graphql-php/blob/4ceb094b7850a586f04d487cc33702dd65ef9117/src/Type/Schema.php#L305).

I'm not sure how to resolve this. Should we comply with webonyx requirement? If so, we should check everywhere we are using getType and assuming an raised exception.

I don't have much time to look further, just wanted to write down my conclusion for further fix.

@mcg-web Let me know what you think about this.

Vincz commented 1 year ago

Fix in #1122