Is it possible to deprecate an input parameter on GraphQL query?

I want to deprecate an input parameter that’s no longer used. But I do not get a deprecated warning in GraphQL doc.

extend type Query {
       param1: String!, 
       param2: String @deprecated(reason: "param2 is no longer used")
    ): String!

You have to depreciate in the schema not a custom function. You can create a custom input schema, then depreciate it there.


1 Like

Thanks for the answer @jdgamble555. Looks like that’s the only way of doing that as @deprecated is not applied to INPUT_FIELD_DEFINITION. Ref: Creating schema directives - Apollo Server - Apollo GraphQL Docs