Skip to content

Inconsistent formatting of arguments #330

@nightroman

Description

@nightroman

Please find attached the project for reproducing the issue and follow the below steps.
TryGraphQLParser.zip

Steps

x1-type.graphql is the input file to be formatted

type DesPcb {
  designItems("An optional array of designators to search." designators: [String!] "Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String where: DesDesignItemFilterInput): DesDesignItemConnection
}

Run

dotnet run -- x1-type.graphql

This produces the new x1-type.graphql.output.graphql.
The field arguments are formatted mostly as expected:

type DesPcb {
  designItems(
    "An optional array of designators to search."
    designators: [String!],
    "Returns the first _n_ elements from the list."
    first: Int,
    "Returns the elements in the list that come after the specified cursor."
    after: String,
    "Returns the last _n_ elements from the list."
    last: Int,
    "Returns the elements in the list that come before the specified cursor."
    before: String, where: DesDesignItemFilterInput): DesDesignItemConnection
}

But the last argument where: DesDesignItemFilterInput formatting is inconsistent, it is expected to be on its own line:

type DesPcb {
  designItems(
    "An optional array of designators to search."
    designators: [String!],
    "Returns the first _n_ elements from the list."
    first: Int,
    "Returns the elements in the list that come after the specified cursor."
    after: String,
    "Returns the last _n_ elements from the list."
    last: Int,
    "Returns the elements in the list that come before the specified cursor."
    before: String,
    where: DesDesignItemFilterInput): DesDesignItemConnection
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions