Print description of enum and input for GraphQL (#3633)
parent
5356db0e69
commit
6a953e47b5
|
@ -374,6 +374,8 @@ function genericPrint(path, options, print) {
|
|||
|
||||
case "EnumValueDefinition": {
|
||||
return concat([
|
||||
path.call(print, "description"),
|
||||
n.description ? hardline : "",
|
||||
path.call(print, "name"),
|
||||
printDirectives(path, print, n)
|
||||
]);
|
||||
|
@ -381,6 +383,8 @@ function genericPrint(path, options, print) {
|
|||
|
||||
case "InputValueDefinition": {
|
||||
return concat([
|
||||
path.call(print, "description"),
|
||||
n.description ? (n.description.block ? hardline : line) : "",
|
||||
path.call(print, "name"),
|
||||
": ",
|
||||
path.call(print, "type"),
|
||||
|
|
|
@ -29,6 +29,26 @@ of the \`one\` field.
|
|||
"""
|
||||
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}") {
|
||||
a
|
||||
|
@ -65,4 +85,32 @@ type Foo {
|
|||
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
|
||||
}
|
||||
|
||||
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