Skip to content

Commit 61c50f2

Browse files
andimarekleebyron
andauthored
clarify that utf-8 is just a possible encoding of strings (#684)
* clarify that utf-8 is just a possible encoding of strings * fix Unicode spelling * Update Section 3 -- Type System.md * Update Section 3 -- Type System.md Co-authored-by: Lee Byron <lee@leebyron.com>
1 parent d4777b4 commit 61c50f2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

spec/Section 3 -- Type System.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -529,14 +529,16 @@ outside the available precision), a request error must be raised.
529529

530530
### String
531531

532-
The String scalar type represents textual data, represented as UTF-8 character
533-
sequences. The String type is most often used by GraphQL to represent free-form
534-
human-readable text. All response formats must support string representations,
535-
and that representation must be used here.
532+
The String scalar type represents textual data, represented as a sequence of
533+
Unicode code points. The String type is most often used by GraphQL to
534+
represent free-form human-readable text. How the String is encoded internally
535+
(for example UTF-8) is left to the service implementation. All response
536+
serialization formats must support a string representation (for example, JSON
537+
Unicode strings), and that representation must be used to serialize this type.
536538

537539
**Result Coercion**
538540

539-
Fields returning the type {String} expect to encounter UTF-8 string internal values.
541+
Fields returning the type {String} expect to encounter Unicode string values.
540542

541543
GraphQL services may coerce non-string raw values to {String} when reasonable
542544
without losing information, otherwise they must raise a field error. Examples of
@@ -545,7 +547,7 @@ string `"1"` for the integer `1`.
545547

546548
**Input Coercion**
547549

548-
When expected as an input type, only valid UTF-8 string input values are
550+
When expected as an input type, only valid Unicode string input values are
549551
accepted. All other input values must raise a request error indicating an
550552
incorrect type.
551553

0 commit comments

Comments
 (0)