-
Notifications
You must be signed in to change notification settings - Fork 257
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
chore(federation): Update schema printers #996
Conversation
5fdc254
to
c524cda
Compare
Needs changelog entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this! I don't have any real feedback on these changes in particular. Some changes seem unrelated to the @specifiedBy
/@deprecated
additions, but I'm assuming that's because you're brought the code up to date with graphql-js
v16.
We've talked about this before, but it's a shame we have to fork printSchema
(and do it twice!). This is probably a good topic for discussion with @IvanGoncharov, but it would be great to investigate additions to graphql-js
that could avoid the need for forking altogether.
96d073d
to
d0eb6f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
// Apollo addition: support both specifiedByUrl and specifiedByURL - these | ||
// happen across v15 and v16. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IvanGoncharov do you intend to preserve this breaking change in v16?
graphql/graphql-js#3156
Add tests for printing @SpecifiedBy and deprecated input values.
699056d
to
f3368e2
Compare
Update our subgraph and supergraph schema printers to match the
printSchema
function fromgraphql-js
as closely as possible. This introduces printing capabilities for the@specifiedBy
directive as well as@deprecated
on input values.This PR depends on #1000 which resolves a few problems I turned up after addressing @martijnwalraven's sorting concern.
lexicographicSortSchema
was being called, but the printer was modifying the schema after that sort).printFederatedSchema
test was testing printing a composed graph rather than a subgraph, so I fixed the test.printFederatedSchema
(which was exported asprintSchema
) toprintSubgraphSchema
to prevent naming confusion.Fixes #994
Fixes #635
Post-merge edit: In addition, this PR now prints interfaces implementing interfaces (as a byproduct of updating our printer forks). Previously it used to ignore them.