The most recent official release of the GraphQL spec (Oct 2021) does not support applying the built-in @deprecated
directive to fields of an input type. However, there are workarounds for deprecating an input field.
If you have a Federation 2 supergraph, you can apply the @deprecated
directive to input fields, even though it isn't currently supported in the spec:
input MyInput {
firstField: String
two: String @deprecated(reason: "don't need it!")
}
Alternatively, you can create a new query/mutation and deprecate the old one:
type Query {
oldField(input: OldInput): Int @deprecated(reason: "Uses old input type, use newField instead")
newField(input: NewInput): Int
}
Comments
0 commentsArticle is closed for comments.