Skip to content

Allow Deprecation of Optional Arguments #575

Closed
@dice14u

Description

@dice14u

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions