overblog / GraphQLBundle

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

Validate only InputObject types fix #1170 #1175

Closed Vincz closed 7 months ago

Vincz commented 7 months ago
Q A
Bug fix? yes
New feature? no
BC breaks? yes
Deprecations? no
Tests pass? yes
Documented? yes/no
Fixed tickets #1170
License MIT

The ArgumentsTransformer should not validated arguments that are not Input or list of Input.
For example, if we have a scalar returning an invalid object, we should not validate it on our side.

In our case for example, we have scalars that turn id into doctrine entities so we can get entities in our methods. The scalar is in charge of validating that the object exists, but we shouldn't call the validation on the object returned by the scalar. Anyway, in a query or mutation, we should only validate inputted data through InputObject.