feat: implement full Unicode support per GraphQL September 2025 spec#1405
Open
jwaldrip wants to merge 1 commit intoabsinthe-graphql:mainfrom
Open
feat: implement full Unicode support per GraphQL September 2025 spec#1405jwaldrip wants to merge 1 commit intoabsinthe-graphql:mainfrom
jwaldrip wants to merge 1 commit intoabsinthe-graphql:mainfrom
Conversation
This implements Full Unicode Support as defined in GraphQL specification September 2025 (RFCs absinthe-graphql#805, absinthe-graphql#1040, absinthe-graphql#1053, absinthe-graphql#1142). Changes: - Add support for variable-width Unicode escape sequences (\u{XXXXXX}) allowing representation of all Unicode scalar values up to U+10FFFF - Add validation for Unicode scalar values in escape sequences - Add support for surrogate pair decoding in fixed-width escapes (\uXXXX) for legacy compatibility with supplementary plane characters - Properly reject invalid escape sequences: - Lone high surrogates (U+D800-U+DBFF) - Lone low surrogates (U+DC00-U+DFFF) - Out of range values (>U+10FFFF) - Surrogates in variable-width escapes - Update Parse phase to handle new Unicode escape error type - Add comprehensive test suite covering: - Basic Unicode in strings - BMP escape sequences (\uXXXX) - Extended escape sequences (\u{XXXXXX}) - Surrogate pair handling - Emoji and supplementary plane characters - Invalid escape rejection - Block strings with Unicode - Edge cases The implementation maintains full backward compatibility with existing GraphQL documents while enabling the new Unicode features. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
d63dd1a to
86fa4b6
Compare
Contributor
Author
|
Checking in — any feedback on the Unicode support changes? This aligns Absinthe with the September 2025 spec. Let me know if there are any concerns. |
bryanjos
reviewed
Feb 10, 2026
Contributor
bryanjos
left a comment
There was a problem hiding this comment.
Looks good overall. I just had a question about 2 of the tests
Comment on lines
+47
to
+59
| test "parses Japanese characters" do | ||
| assert {:ok, [{:string_value, {1, 1}, value}]} = | ||
| Lexer.tokenize(~s("")) | ||
|
|
||
| assert to_string(value) == ~s("") | ||
| end | ||
|
|
||
| test "parses Arabic characters" do | ||
| assert {:ok, [{:string_value, {1, 1}, value}]} = | ||
| Lexer.tokenize(~s("")) | ||
|
|
||
| assert to_string(value) == ~s("") | ||
| end |
Contributor
There was a problem hiding this comment.
Should these 2 tests be updated or removed?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
\u{XXXXXX}(1-6 hex digits)\uXXXXescapesTest plan
🤖 Generated with Claude Code