Skip to content

Multiline strings in mutation error #299

Closed
@frasercobb

Description

@frasercobb

Hello,
I have an issue whereby sending a multiline string in a mutation will return a difficult to understand error message.
I have reproduced this issue on the starwars example in this repo.

Graphql mutation(not using block strings) that will reproduce the error:

mutation {
  createReview(episode:NEWHOPE, review: {stars: 0, commentary: "1
    2"}) {
    
  }
}

Expected: Error message indicating that a multiline/un-terminated string was found in the query.
Actual:

{
  "errors": [
    {
      "message": "syntax error: unexpected \"2\", expecting Ident",
      "locations": [
        {
          "line": 32,
          "column": 5
        }
      ]
    }
  ]
}

Log output: <input>:31:64: literal not terminated

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions