I noticed an issue with printing StringValue value (./language/printer/printer.go#L372). The quotation of the string value is incorrect. If the input StringValue node contains escaped double quote characters (\"), then the output string from printer drops proper character escaping.
Steps to reproduce
If we get a following query and parse it to *ast.Document, and then print it to a string:
Hi,
I noticed an issue with printing
StringValue
value (./language/printer/printer.go#L372). The quotation of the string value is incorrect. If the input StringValue node contains escaped double quote characters (\"
), then the output string from printer drops proper character escaping.Steps to reproduce
If we get a following query and parse it to
*ast.Document
, and then print it to a string:Expected result
We should expect the result string equal to:
Actual result
However, what we get instead is:
Which makes it incorrect query.
I will provide a pull request with a unit test case and fix for that issue.
Cheers!