graphql-platform
graphql-platform copied to clipboard
`?sdl` returns file encoded as UTF-8 with BOM
Is there an existing issue for this?
- [X] 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: https://github.com/facebook/relay/issues/3798#issuecomment-1085991645
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
I can submit a PR, if there are no objections :)
Sure ... do :)
Fixed this in the relay compiler: https://github.com/facebook/relay/pull/3908, but I think it might still be good to also merge my PR here, since this might also cause issues with other tools...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.