Skip to content

VS Code extension - Syntax Error with multi-line placeholders in gql #1298

@henryqdineen

Description

@henryqdineen

Our prettier config's print-width setting is breaking some placeholders into multiple lines in our gql tagged template literals and causing errors in the VS Code plugin.

Intended outcome:

No error. Correctly parse the JS.

Actual outcome:

Syntax Error: Unexpected $ GraphQL: Syntax [73, 3]

How to reproduce the issue:
You need to have a placeholder that breaks onto a new line.

const query = gql`
  {
    hero {
      ...Hero_character
    }
  }

  ${Hero.fragments
    .character}
`;

Versions
v1.6.9 of the VS Code extension

Metadata

Metadata

Assignees

No one assigned

    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