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
inline graphql-js' printer #4692
base: main
Are you sure you want to change the base?
Conversation
This seems sensible to me. Feel free to ping me when this diff is ready for review (I see it's still marked as Draft). |
I wonder if there's a sensible way to add some tests which assert that the compiler and this code arrive at the same hash? |
That's is easy if we can run the printer standalone. Or, it would be ideal to publish to NPM and directly use its WASM or NAPI distribution |
Workaround: Commit md5 hashes for all the fixtures in the graphql-text-printer crate test suite. Then we can compare it when running the babel plugin tests. |
8df33f3
to
cd480da
Compare
@captbaritone I added idempotency testing using compiler-side fixtures. Fixed 4 failures related to spaces between multiple definitions and it all passes. |
return fixtures; | ||
} | ||
|
||
function parsePrintFixture(name: string, content: string): PrinterFixture { |
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.
Love this. Brilliant solution. When I merge I think I'll add a note in the Rust tests so that people know the fixtures are serving double duty.
@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
See #3628 and #4226