Skip to content

GraphQL syntax highlighting breaks if query/mutation parameters have a newline character in them #49

@brianphillips

Description

@brianphillips

Works:

###

# @graphql
# @name Test

GRAPHQL http://some-host.com/graphql HTTP/1.1

query {
  someField
}

Doesn't work:

###

# @graphql
# @name Test

GRAPHQL http://some-host.com/graphql HTTP/1.1

query
{
  someField
}

This is problematic in the case of a query (or mutation) with a long list of parameters which code formatters (i.e. prettier) want to split across multiple lines:

query testQuery(
  $param1: String
  $param2: String
  $param3: String
  $param4: String
) {
  someField
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions