GraphQlClientGenerator icon indicating copy to clipboard operation
GraphQlClientGenerator copied to clipboard

Allow retrieving deprecated input fields and arguments

Open gao-artur opened this issue 3 months ago • 4 comments

The new September 2025 spec allows deprecating input values. Please add support to allow retrieving deprecated input fields and arguments from the introspection. Note that older servers may not support this feature so this probably should be a config flag.

        public static string QuerySchemaMetadata(GraphQlWellKnownDirective directive) =>
        $$"""
        query FullIntrospection {
          __schema {
            queryType { name }
            mutationType { name }
            subscriptionType { name }
            types {
              ...FullType
            }
            directives {
              name
              description
              locations
              args(includeDeprecated: true) {   <======== 1. HERE
                ...InputValue
              }
            }
          }
        }
        
        fragment FullType on __Type {
          kind
          name
          description
          fields(includeDeprecated: true) {
            name
            description
            args(includeDeprecated: true) {   <======== 2. HERE
              ...InputValue
            }
            type {
              ...TypeRef
            }
            isDeprecated
            deprecationReason
          }
          inputFields(includeDeprecated: true) {   <======== 3. HERE
            ...InputValue
          }
          interfaces {
            ...TypeRef
          }
 ........

A side note: Apollo Router doesn't include the deprecated input values by default.

gao-artur avatar Nov 06 '25 13:11 gao-artur