singleLine
Control whether items should be placed on single line as possible, even they’re originally on multiple lines, or force them to be on multiple lines.
Possible option values:
"prefer": Place items on single line as possible."smart": Whether items should be placed on single line will be determined by original layout."never": Force items to be on multiple lines."inherit": Inherit from the basesingleLineoption.
Default option value is "smart".
This global option can be overridden by different syntax nodes.
Some syntax-node-specific options will override by default instead of "inherit":
arguments.singleLineargumentsDefinition.singleLinedirectiveLocations.singleLinedirectives.singleLineenumValuesDefinition.singleLine(default:"never")fieldsDefinition.singleLine(default:"never")implementsInterfaces.singleLineinputFieldsDefinition.singleLine(default:"never")listValue.singleLineobjectValue.singleLineschemaDefinition.singleLine(default:"never")schemaExtension.singleLine(default:"never")selectionSet.singleLine(default:"never")unionMemberTypes.singleLinevariableDefinitions.singleLine
Example for "prefer"
query Query(
$a: A
$b: B
) {
field1
field2
}
will be formatted as:
query Query($a: A, $b: B) {
field1
field2
}
Example for "smart"
query Query(
$a: A
$b: B
) {
field1
field2
}
will be formatted as:
query Query(
$a: A
$b: B
) {
field1
field2
}
which is the same as the original layout.
But,
query Query($a: A
$b: B
) {
field1
field2
}
will be formatted as:
query Query($a: A, $b: B) {
field1
field2
}
Example for "never"
query Query($a: A, $b: B) {
field1
field2
}
will be formatted as:
query Query(
$a: A
$b: B
) {
field1
field2
}