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

Allow Deprecation of Optional Arguments #575

Closed
dice14u opened this issue Apr 9, 2019 · 1 comment
Closed

Allow Deprecation of Optional Arguments #575

dice14u opened this issue Apr 9, 2019 · 1 comment

Comments

@dice14u
Copy link

dice14u commented Apr 9, 2019

When evolving an api there are often times when a new argument may take the place of an older one. In doing so it would be beneficial to set the old argument as optional and mark it deprecated.

example

type Zoo {
  getAnimals(
    "Example of some originally mandatory field"
     filter: String!
   ): [Animal]
}

may find it is not sufficient for the api and then evolve to

type Zoo {
  getAnimals(
   "Field can no longer be mandatory because it is going to disappear"
    filter: String @deprecated(reason = "Use specific taxa filters removal on 1/1/2020")
    phylum: String
    kingdom: String
    order: String
  ): [Animal]
}

In this example the implementer does not want to have to support parsing the filter string argument forever and so is marking it deprecated. Also because the field was originally a primitive "String" the input type itself cannot be deprecated.

@IvanGoncharov
Copy link
Member

@dice14u Thanks for detail description 👍
This proposal already tracked as #525 and you are welcome to join the discussion there.

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

No branches or pull requests

2 participants