graphql-mesh icon indicating copy to clipboard operation
graphql-mesh copied to clipboard

Can not get deprecated args and inputFields from GraphQL sources

Open sebastianmulders opened this issue 11 months ago • 0 comments

Is your feature request related to a problem? Please describe.

Currently, graphql-mesh does not seem support retrieving deprecated arguments and inputFields from GraphQL sources. The issue appears to stem from the underlying introspection query not setting args(includeDeprecated: true). Consequently, there is no apparent way to pass this as an option. I've found this in graphql-js's getIntrospectionQuery(), where it sets inputValueDeprecation to be false by default. I'm not 100% sure this is the underlying issue though.

Describe the solution you'd like

I'd like to either have an option to set inputValueDeprecation to true, or somehow otherwise make it possible to get deprecated arguments and inputFields (and preferably the deprecationReason, too).

Describe alternatives you've considered

I did a thorough search through graphql-mesh, graphql-tools and graphql-js but could not find a way to set this or pass options otherwise. I think this'll need to be implemented on graphql-mesh.

Additional context

Try running the following introspection query on a GraphQL server. I think when includeDeprecated is not set, or set to false explicitly, the args are not part of the mesh's generated schema.

  __schema {
    queryType {
      fields {
        name
        args(includeDeprecated: true) {
          name
          isDeprecated
          deprecationReason
        }
      }
    }
  }
} 

sebastianmulders avatar Jul 17 '23 12:07 sebastianmulders