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

Allow deprecating input fields and arguments (InputObjectType) #1071

Closed TaProhm closed 1 year ago

TaProhm commented 1 year ago
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Documented? no
Fixed tickets #...
License MIT

The @deprecated directive is supported by this bundle for different GraphQL entities: Types, Objects, Interfaces, Enums. But not for Inputs for some reason.

TaProhm commented 1 year ago

Hi @mcg-web and @Vincz. Could this PR be reviewed, please. The change is relatively small, but rather important for everyday work.

Vincz commented 1 year ago

Hi @TaProhm, sorry for the late reply. Would you mind to update this line : https://github.com/overblog/GraphQLBundle/blob/f33382ac2bbdb750cbe448ac74cb1b6207e73c4f/src/Config/Parser/MetadataParser/MetadataParser.php#L401 to pass true as the second argument of getDescriptionConfiguration.

Can you also add tests? (just to ensure that it works when we add the directive in yaml or with annotations/attributes)

TaProhm commented 1 year ago

@Vincz Thank you for pointing out in the right direction. As a result I stuck with" Overblog\GraphQLBundle\Tests\Functional\Type\DefinitionTest" for InputObjectType. It turned out there is an issue with webonyx/graphql-php regarding input values deprecation https://github.com/webonyx/graphql-php/issues/110 I will amend this PR with tests as soon as it will be possible.

Vincz commented 1 year ago

Hi @TaProhm, it seems the issue in webonyx has been fixed: https://github.com/webonyx/graphql-php/issues/110 :)

TaProhm commented 1 year ago

Hi @Vincz

It's only now that I've been able to give a detailed answer. I contributed to webonyx/graphql-php/issues/110 during my vacation, and then I was going to finish this PR. But now there is not enough time. However, this functionality is rather necessary, so I plan to finish it as soon as I can.

TaProhm commented 1 year ago

@Vincz, I have updated this PR with actual commit containing new code and tests. It is ready to be reviewed.

Vincz commented 1 year ago

Awesome @TaProhm! Thank you very much for this :)