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

?sdl returns file encoded as UTF-8 with BOM #4912

Closed
1 task done
tobias-tengler opened this issue Apr 1, 2022 · 3 comments · Fixed by #4925
Closed
1 task done

?sdl returns file encoded as UTF-8 with BOM #4912

tobias-tengler opened this issue Apr 1, 2022 · 3 comments · Fixed by #4925
Labels
🐛 bug Something isn't working 🌶️ hot chocolate

Comments

@tobias-tengler
Copy link
Collaborator

tobias-tengler commented Apr 1, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I was trying out the new relay compiler and ran into a weird unsupported character issue. After some research I found out it is due to our schema.graphql file having UTF-8 with BOM and not just UTF-8 encoding: facebook/relay#3798 (comment)

Steps to reproduce

Download your GraphQL schema like this: curl localhost:5000/graphql?sdl -o ./src/schema.graphql

Relevant log output

No response

Additional Context?

The issue is this: https://github.com/ChilliCream/hotchocolate/blob/61936613166e64665ab29d873c965a68084eb0df/src/HotChocolate/Language/src/Language.SyntaxTree/Utilities/SyntaxPrinter.cs#L68

It should be new UTF8Encoding(false) instead of Encoding.UTF8.

Product

Hot Chocolate

Version

13.0.0-preview.15

@tobias-tengler tobias-tengler changed the title ?sdl returns file encoded with UTF-8 + BOM ?sdl returns file encoded as UTF-8 with BOM Apr 1, 2022
@tobias-tengler
Copy link
Collaborator Author

I can submit a PR, if there are no objections :)

@michaelstaib
Copy link
Member

Sure ... do :)

@tobias-tengler
Copy link
Collaborator Author

tobias-tengler commented May 18, 2022

Fixed this in the relay compiler: facebook/relay#3908, but I think it might still be good to also merge my PR here, since this might also cause issues with other tools...

@stale stale bot added the ⌛ stale Nothing happened with this issue in quite a while label Sep 16, 2022
@ChilliCream ChilliCream deleted a comment from stale bot Dec 5, 2023
@glen-84 glen-84 removed the ⌛ stale Nothing happened with this issue in quite a while label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🌶️ hot chocolate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants