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

Support deprecation #93

Closed
Globegitter opened this issue Jan 28, 2016 · 4 comments
Closed

Support deprecation #93

Globegitter opened this issue Jan 28, 2016 · 4 comments

Comments

@Globegitter
Copy link
Contributor

It seems that deprecation of fields is not supported either in graphene or graphql-core. It seems to be explained here: https://github.com/facebook/graphql/blob/d8a52f1fb70a61ceb13dd49292b74b58d894a074/spec/Section%204%20--%20Introspection.md#deprecation

I would expect to be able to use it as follows:

class User(relay.Node):
    billing_address = graphene.String(
        isDeprecated=True,
        deprecationReason='Selecting your billing address is not supported anymore',
        description='Selected billing address.')
@jhgg
Copy link
Member

jhgg commented Jan 28, 2016

This is already supported in core. Just pass a deprecation_reason to the underlying GraphQLField.
There is no is_deprecated as a non-null value for deprecation_reason implies is_deprecated for the purpose of schema introspection.

@Globegitter
Copy link
Contributor Author

Ok will have a look - thanks for the quick response :)

@syrusakbary
Copy link
Member

@Globegitter You can now use graphene.String(..., deprecation_reason='Deprecated since 1.0') 😉

@Globegitter
Copy link
Contributor Author

@syrusakbary Thank you for the quick turnaround :)

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

3 participants