Skip to content

useDeprecatedReason

诊断类别:lint/nursery/useDeprecatedReason

¥Diagnostic Category: lint/nursery/useDeprecatedReason

自从:v1.9.0

¥Since: v1.9.0

来源:

¥Sources:

要求在使用@deprecated 指令时指定原因参数

¥Require specifying the reason argument when using @deprecated directive

此规则检查 @deprecated 指令的参数是否使用原因参数,建议用户在参数缺失时添加它。

¥This rule checks the parameter of @deprecated directive for the use of reason argument, suggesting user to add it in case the argument is missing.

¥Examples

¥Invalid

query {
member @deprecated
}

¥Valid

query {
member @deprecated(reason: "Why?")
}

¥Related links