Skip to content

Block string parsing doesn't conform to GraphQL spec. #74

Closed
@fpacanowski

Description

@fpacanowski

Currently the following block string:

"""
    
  Hello,
    World!

  Yours,
    GraphQL.

"""

gets parsed as "\nHello,\n World!\n\nYours,\n GraphQL.\n\n".

GraphQL specification requires the leading and trailing empty lines (i.e. lines containing only whitespace) to be stripped from block string value. Quoting the block string spec:

4. While the first item line in lines contains only WhiteSpace:
    a. Remove the first item from lines.

5. While the last item line in lines contains only WhiteSpace:
    a. Remove the last item from lines.

So the above block string should be parsed as "Hello,\n World!\n\nYours,\n GraphQL.".

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