fix(grahpql): linebreak in non-block stringValue (#4808)
parent
d5a2f391cd
commit
0df2199688
|
@ -144,7 +144,11 @@ function genericPrint(path, options, print) {
|
|||
'"""'
|
||||
]);
|
||||
}
|
||||
return concat(['"', n.value.replace(/["\\]/g, "\\$&"), '"']);
|
||||
return concat([
|
||||
'"',
|
||||
n.value.replace(/["\\]/g, "\\$&").replace(/\n/g, "\\n"),
|
||||
'"'
|
||||
]);
|
||||
}
|
||||
case "IntValue":
|
||||
case "FloatValue":
|
||||
|
|
|
@ -49,6 +49,10 @@ Description of \`one\`
|
|||
"""
|
||||
one: string
|
||||
}
|
||||
|
||||
{
|
||||
foo(input: {multiline: "ab\\ncd"}) { id }
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
query X($a: Int) @relay(meta: "{\\"lowPri\\": true}") {
|
||||
a
|
||||
|
@ -113,4 +117,10 @@ input Input {
|
|||
one: string
|
||||
}
|
||||
|
||||
{
|
||||
foo(input: { multiline: "ab\\ncd" }) {
|
||||
id
|
||||
}
|
||||
}
|
||||
|
||||
`;
|
||||
|
|
|
@ -46,3 +46,7 @@ Description of `one`
|
|||
"""
|
||||
one: string
|
||||
}
|
||||
|
||||
{
|
||||
foo(input: {multiline: "ab\ncd"}) { id }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue