Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.12][WIP] Block Strings #238

Closed
wants to merge 2 commits into from
Closed

[0.12][WIP] Block Strings #238

wants to merge 2 commits into from

Commits on Feb 8, 2018

  1. RFC: Block String

    This RFC adds a new form of `StringValue`, the multi-line string, similar to that found in Python and Scala.
    
    A multi-line string starts and ends with a triple-quote:
    
    ```
    """This is a triple-quoted string
    and it can contain multiple lines"""
    ```
    
    Multi-line strings are useful for typing literal bodies of text where new lines should be interpretted literally. In fact, the only escape sequence used is `\"""` and `\` is otherwise allowed unescaped. This is beneficial when writing documentation within strings which may reference the back-slash often:
    
    ```
    """
    In a multi-line string \n and C:\\ are unescaped.
    """
    ```
    
    The primary value of multi-line strings are to write long-form input directly in query text, in tools like GraphiQL, and as a prerequisite to another pending RFC to allow docstring style documentation in the Schema Definition Language.
    
    Ref: graphql/graphql-js#926
    danez committed Feb 8, 2018
    Configuration menu
    Copy the full SHA
    45255f1 View commit details
    Browse the repository at this point in the history
  2. Improvements to printing block strings

    ref: graphql/graphql-js#f9e67c403a4667372684ee8c3e82e1f0ba27031b
    danez committed Feb 8, 2018
    Configuration menu
    Copy the full SHA
    f475cdf View commit details
    Browse the repository at this point in the history