Print description of enum and input for GraphQL (#3633)
parent
5356db0e69
commit
6a953e47b5
|
@ -374,6 +374,8 @@ function genericPrint(path, options, print) {
|
||||||
|
|
||||||
case "EnumValueDefinition": {
|
case "EnumValueDefinition": {
|
||||||
return concat([
|
return concat([
|
||||||
|
path.call(print, "description"),
|
||||||
|
n.description ? hardline : "",
|
||||||
path.call(print, "name"),
|
path.call(print, "name"),
|
||||||
printDirectives(path, print, n)
|
printDirectives(path, print, n)
|
||||||
]);
|
]);
|
||||||
|
@ -381,6 +383,8 @@ function genericPrint(path, options, print) {
|
||||||
|
|
||||||
case "InputValueDefinition": {
|
case "InputValueDefinition": {
|
||||||
return concat([
|
return concat([
|
||||||
|
path.call(print, "description"),
|
||||||
|
n.description ? (n.description.block ? hardline : line) : "",
|
||||||
path.call(print, "name"),
|
path.call(print, "name"),
|
||||||
": ",
|
": ",
|
||||||
path.call(print, "type"),
|
path.call(print, "type"),
|
||||||
|
|
|
@ -29,6 +29,26 @@ of the \`one\` field.
|
||||||
"""
|
"""
|
||||||
one: Type
|
one: Type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Foo {
|
||||||
|
q("docs" field: String): Type
|
||||||
|
q("A long string of description of the field parameter to make this break" field: String): Type
|
||||||
|
q("""docs""" field: String): Type
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Enum {
|
||||||
|
"""
|
||||||
|
Description of \`one\`
|
||||||
|
"""
|
||||||
|
one
|
||||||
|
}
|
||||||
|
|
||||||
|
input Input {
|
||||||
|
"""
|
||||||
|
Description of \`one\`
|
||||||
|
"""
|
||||||
|
one: string
|
||||||
|
}
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
query X($a: Int) @relay(meta: "{\\"lowPri\\": true}") {
|
query X($a: Int) @relay(meta: "{\\"lowPri\\": true}") {
|
||||||
a
|
a
|
||||||
|
@ -65,4 +85,32 @@ type Foo {
|
||||||
one: Type
|
one: Type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Foo {
|
||||||
|
q("docs" field: String): Type
|
||||||
|
q(
|
||||||
|
"A long string of description of the field parameter to make this break"
|
||||||
|
field: String
|
||||||
|
): Type
|
||||||
|
q(
|
||||||
|
"""
|
||||||
|
docs
|
||||||
|
"""
|
||||||
|
field: String
|
||||||
|
): Type
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Enum {
|
||||||
|
"""
|
||||||
|
Description of \`one\`
|
||||||
|
"""
|
||||||
|
one
|
||||||
|
}
|
||||||
|
|
||||||
|
input Input {
|
||||||
|
"""
|
||||||
|
Description of \`one\`
|
||||||
|
"""
|
||||||
|
one: string
|
||||||
|
}
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -26,3 +26,23 @@ of the `one` field.
|
||||||
"""
|
"""
|
||||||
one: Type
|
one: Type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Foo {
|
||||||
|
q("docs" field: String): Type
|
||||||
|
q("A long string of description of the field parameter to make this break" field: String): Type
|
||||||
|
q("""docs""" field: String): Type
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Enum {
|
||||||
|
"""
|
||||||
|
Description of `one`
|
||||||
|
"""
|
||||||
|
one
|
||||||
|
}
|
||||||
|
|
||||||
|
input Input {
|
||||||
|
"""
|
||||||
|
Description of `one`
|
||||||
|
"""
|
||||||
|
one: string
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue