Skip to content

Deprecation of input fields #197

Closed
Closed
@dylanahsmith

Description

@dylanahsmith

It is possible to deprecate fields and enum values, but not input values or arguments. I think it should be possible to deprecate optional arguments and input fields.

A natural way of evolving the schema in this case would be to make an input field optional if it is required, deprecate it, then remove it once clients stop explicitly setting the value. We can add support for that into the server to detect when the input field is still used, but we would like deprecation warnings on the client so we can easily remove usage of these deprecated input fields.

One possible workaround is to create a new field with different input, but that is a more disruptive way of evolving the schema.

Note that if __InputValue was just given isDeprecated and deprecationReason fields, then that would mean that an input object type could be deprecated, would that be undesirable? Right now an __Type (object, interface or union) also can't be deprecated, so would we want that to be consistent with an input object type?

Also, should the spec disallow an argument to be deprecated if it is non-null (i.e. required)? Otherwise, that effectively makes the field it is on deprecated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions