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

Improve error when composeAndValidate is provided empty SDL #18

Open
EverlastingBugstopper opened this issue Mar 12, 2021 · 5 comments
Open

Comments

@EverlastingBugstopper
Copy link
Contributor

If you pass an empty string to harmonizer::harmonize, you get this error:

UNKNOWN: Syntax Error: Unexpected <EOF>

Edit by @abernix: see my comment below for where this is probably buried.

@EverlastingBugstopper EverlastingBugstopper changed the title harmonizer::harmonize should have a better error message for empty files harmonizer::harmonize should have a better error message for empty strings Mar 12, 2021
@abernix
Copy link
Member

abernix commented Mar 15, 2021

Agree we can guard against this.

I suspect the fix for this lives upstream from harmonizer in (the JS) @apollo/federation to benefit both implementations. It could guard against the production of this error which is (I believe) a result of the invocation of graphql's parse on the empty input.

@abernix abernix changed the title harmonizer::harmonize should have a better error message for empty strings Improve error when composeAndValidate is provided empty SDL Mar 15, 2021
@abernix
Copy link
Member

abernix commented Mar 15, 2021

@trevor-scheer I believe you may be working around improving error messages already, so perhaps this is a low-hanging fruit. I surface this only if it's convenient; if it's not easily within reach don't worry about it!

@trevor-scheer
Copy link
Member

Thanks @abernix. @EverlastingBugstopper I've got another issue (#605) immediately related to this error, but it's not at the top of my priority list for now. Is this something that can wait, or is it blocking / problematic in a way that can't be worked around for the time being?

@EverlastingBugstopper
Copy link
Contributor Author

oh it can totally be worked around, not blocking at all. this is mostly just to bring it to y'alls attention for sanding down some of these rough edges 😄

@EverlastingBugstopper EverlastingBugstopper transferred this issue from apollographql/federation Jan 27, 2022
@abernix
Copy link
Member

abernix commented Mar 22, 2022

do we want to transfer this back to federation for next steps?

dingxiangfei2009 pushed a commit to dingxiangfei2009/federation-rs that referenced this issue Jun 23, 2022
…rror-1.x

Update Rust crate thiserror to 1.0.26
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