Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(graphql): add deprecationReason to ArgsOptions #3157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hayatekiribayashi
Copy link

The official document said that @Args option allowed deprecationReason, but it did not. GraphQL allows deprecation directives for arguments, so I made it allow deprecationReason.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #3033

What is the new behavior?

I make changes to AuthorResolver of https://github.com/bodil-dev/nest-graphql-args-deprecated . Because, deprecated arguments required nullable or default value. (see https://spec.graphql.org/draft/#sec--deprecated)
And I add @ArgsType usage.

image

Then, @deprecated will be given properly.

image

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

The official document said that @Args option allowed deprecationReason, but it did not.
GraphQL allows deprecation directives for arguments, so I made it allow deprecationReason.
@kamilmysliwiec
Copy link
Member

Could you update tests too?

@hayatekiribayashi
Copy link
Author

@kamilmysliwiec
Yes, but I want to know testing strategy in this project. Only a few tests exist now.
Should I write a integrative test for GraphQLSchemaBuilder? (e.g. expect to generate rigth schema from decorated class definition)
or, individual unit test for @Args and ArgsFactory? (e.g. expect to set deprecationReason to metadata/configMap)

@kamilmysliwiec
Copy link
Member

e2e test that confirms that auto-generated schema contains deprecation messages added through this attribute

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

Successfully merging this pull request may close these issues.

None yet

4 participants