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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude deprecated fields from the fetched schema #2107

Merged
merged 1 commit into from May 1, 2019

Conversation

Projects
2 participants
@smashwilson
Copy link
Member

commented Apr 29, 2019

Please be sure to read the contributor's guide to the GitHub package before submitting any pull requests.

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • Suggestion: You can use checklists to keep track of progress for the sections on metrics, tests, documentation, and user research.

Description of the Change

Inline the introspectionQuery from the graphql package and change the includeDeprecation: arguments to false. This will exclude deprecated fields from the schema we give to relay-compiler, which will in turn give us early notice of us depending on fields which are due to be removed.

Screenshot/Gif

N/A

Alternate Designs

It might be worth making a pull request to the GraphQL package itself to give getIntrospectionQuery() an option to include deprecated fields or not. We'd need to wait for it to be included in a release and for Relay to catch up before we could take advantage of it, though.

Benefits

Early notice of GraphQL schema changes that will affect us. This would help prevent regressions like #2094 from occurring.

Possible Drawbacks

Well... we can't actually merge the schema changes until #2104 is merged 馃檭

Applicable Issues

#2094, #2104.

Metrics

N/A

Tests

N/A

Documentation

N/A

Release Notes

N/A

User Experience Research (Optional)

N/A

@smashwilson smashwilson added this to In progress in Sprint : 4 April 2019 - 8 May 2019 : v0.29.0 via automation Apr 29, 2019

@codecov

This comment has been minimized.

Copy link

commented Apr 29, 2019

Codecov Report

Merging #2107 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2107   +/-   ##
=======================================
  Coverage   92.55%   92.55%           
=======================================
  Files         207      207           
  Lines       12021    12021           
  Branches     1746     1746           
=======================================
  Hits        11126    11126           
  Misses        895      895

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 4ef8aac...e3fdcf1. Read the comment docs.

@kuychaco
Copy link
Member

left a comment

This looks good to me 馃憤

I guess it's technically somewhat redundant to #2108, but still seems like a good change!

A couple quick questions to consider before merging:

@smashwilson you indicated N/A for testing in the PR description. It's probably worth doing a quick manual check on the command line just for good measure...

I'm also wondering if there is a way to programmatically modify the includeDeprecated arguments in graphql/utilities's introspectionQuery. Maybe using tree-sitter or some other parsing library? That way we'd get any updates that might be made by the graphql folks. But perhaps it's not worth the effort... Just figured I'd throw the thought out there :)

@smashwilson

This comment has been minimized.

Copy link
Member Author

commented May 1, 2019

I guess it's technically somewhat redundant to #2108, but still seems like a good change!

Yeah, kind of? There's likely a way to share code between them once they're both merged, even.

@smashwilson you indicated N/A for testing in the PR description. It's probably worth doing a quick manual check on the command line just for good measure...

Oh, right, I did check it out manually - I didn't commit the schema changes it made because they broke relay-compiler on account of #2104 not being merged yet. 馃槃

I'm also wondering if there is a way to programmatically modify the includeDeprecated arguments in graphql/utilities's introspectionQuery.

Oh, interesting idea... I'd thought about sending a pull request to the GraphQL package to add a deprecated parameter to getIntrospectionQuery(), but that stalled a bit when I found out I'd have to do the Facebook CLA thing to contribute. I think we have access to an intermediate representation of the query that we can likely walk and modify... ?

@smashwilson smashwilson merged commit ee081ab into master May 1, 2019

14 checks passed

atom.github Build #20190429.16 succeeded
Details
atom.github (Lint) Lint succeeded
Details
atom.github (Linux beta) Linux beta succeeded
Details
atom.github (Linux dev) Linux dev succeeded
Details
atom.github (Linux stable) Linux stable succeeded
Details
atom.github (MacOS beta) MacOS beta succeeded
Details
atom.github (MacOS dev) MacOS dev succeeded
Details
atom.github (MacOS stable) MacOS stable succeeded
Details
atom.github (Snapshot) Snapshot succeeded
Details
atom.github (Windows beta) Windows beta succeeded
Details
atom.github (Windows dev) Windows dev succeeded
Details
atom.github (Windows stable) Windows stable succeeded
Details
codecov/patch Coverage not affected when comparing 4ef8aac...e3fdcf1
Details
codecov/project 92.55% remains the same compared to 4ef8aac
Details

Sprint : 4 April 2019 - 8 May 2019 : v0.29.0 automation moved this from In progress to Merged May 1, 2019

@smashwilson smashwilson deleted the aw/inline-introspection-query branch May 1, 2019

@smashwilson smashwilson referenced this pull request May 8, 2019

Closed

v0.29.0-0 QA Review #2129

11 of 11 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.