File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -731,7 +731,7 @@ indentation and blank initial and trailing lines via {BlockStringValue()}.
731
731
732
732
For example, the following operation containing a block string:
733
733
734
- ``` graphql
734
+ ``` graphql example
735
735
mutation {
736
736
sendEmail (message : " " "
737
737
Hello,
@@ -745,12 +745,29 @@ mutation {
745
745
746
746
Is identical to the standard quoted string:
747
747
748
- ``` graphql
748
+ ``` graphql example
749
749
mutation {
750
750
sendEmail (message : " Hello,\n World!\n\n Yours,\n GraphQL." )
751
751
}
752
752
```
753
753
754
+ Since block string values strip leading and trailing empty lines, there is no
755
+ single canonical printed block string for a given value. Because block strings
756
+ typically represent freeform text, it is considered easier to read if they begin
757
+ and end with an empty line.
758
+
759
+ ``` graphql example
760
+ """
761
+ This starts with and ends with an empty line,
762
+ which makes it easier to read.
763
+ """
764
+ ```
765
+
766
+ ``` graphql counter-example
767
+ """This does not start with or end with any empty lines,
768
+ which makes it a little harder to read."""
769
+ ```
770
+
754
771
Note: If non-printable ASCII characters are needed in a string value, a standard
755
772
quoted string with appropriate escape sequences must be used instead of a
756
773
block string.
You can’t perform that action at this time.
0 commit comments