Skip to content

Get more information about @deprecated fields from SchemaDiff#1610

Merged
bbakerman merged 5 commits into
graphql-java:masterfrom
grrttedwards:schemadiff-deprecated-warning
Jan 14, 2020
Merged

Get more information about @deprecated fields from SchemaDiff#1610
bbakerman merged 5 commits into
graphql-java:masterfrom
grrttedwards:schemadiff-deprecated-warning

Conversation

@grrttedwards

@grrttedwards grrttedwards commented Jul 30, 2019

Copy link
Copy Markdown
Contributor

Addresses #1504

Let me know your thoughts on this. My strategy was to just add another category, which can provide the extra information and keep the Danger and Breaking levels untouched.

The two new combinations of level and category are:

  1. level: DANGER, category: DEPRECATED for fields that become deprecated
  2. level: BREAKING, category: DEPRECATED for fields that were deprecated and now missing

Todo:

  • Detect fields that are @deprecated in the new schema
  • Detect removals that were @deprecated in the old schema
  • ???

Remarks:
It's actually interesting to note that @deprecated on anything but FIELD_DEFINITION | ENUM_VALUE is not currently a valid spec-compliant use of the directive.
See: https://graphql.github.io/graphql-spec/June2018/#sec--deprecated
and the corresponding implementation proposed on graphql-js: https://github.com/graphql/graphql-js/pull/1560/files

@grrttedwards grrttedwards marked this pull request as ready for review August 16, 2019 15:01
@grrttedwards

Copy link
Copy Markdown
Contributor Author

@andimarek @bbakerman Sorry for the bump, my organization has been looking for this feature for a while. Could you spend a moment taking a look at this?

@bbakerman bbakerman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much for this PR. In general I think its an improvment

I wonder aloud if we should not have 2 enums for depreacted

  • DEPRECATED_REMOVED
  • DEPRECATED_ADDED

To distinguish that which was deprecated and then removed versus that which is newly deprecated

??

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

Successfully merging this pull request may close these issues.

2 participants