Skip to content

Cannot deprecate variables in InputObjectType #816

Closed
@mzins

Description

@mzins

Hi graphene community!

I am trying to deprecated input variables in my schema. I add the deprecated_reason tag to the variable but it does not appear to be deprecated in GraphiQL (still shows in the docs, autofill, and does not have a deprecation warning). Here is what I have

class NameArgs(InputObjectType):
    firstname = List(String, description="query by a list of first names")
    lastname = List( String, description="query by a list of last names" )

class PersonQuery(ObjectType):
    person = List(PersonType, input_args=NameArgs())
    
    def resolve_person( self, info, input_args ):
        return back_end_query(**input_args)
 

I am wanting to deprecate the first name field/variable. My understanding is I can just set the deprecation_reason tag and that is all.

class NameArgs(InputObjectType):
    firstname = List(String, description="query by a list of first names")
    lastname = List( String, description="query by a list of last names",
                     deprecation_reason="last name is no longer supported by database")

However, the last name is not showing that it is deprecated. Is this a bug or am I not using the deprecation feature correctly?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions