Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot deprecate variables in InputObjectType #816

Closed
mzins opened this issue Aug 23, 2018 · 1 comment
Closed

Cannot deprecate variables in InputObjectType #816

mzins opened this issue Aug 23, 2018 · 1 comment

Comments

@mzins
Copy link

mzins commented Aug 23, 2018

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!

@jkimbo
Copy link
Member

jkimbo commented Aug 25, 2018

It doesn't look like this is supported in the spec: graphql/graphql-spec#197

I'll close this issue for now but we can revisit it once the spec is updated.

@jkimbo jkimbo closed this as completed Aug 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants