Update CursorParser to use '\' as escape instead of ':' #7962
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.
TL;DR - There's a bug where HotChocolate cannot parse the pagination cursors it generates if the cursor is ordering on a string, and the string contains a ':' character.
When HotChocolate encodes a cursor with multiple keys, if one of the keys is a string containing a ':', it will attempt to encode the colon with a backslash
(\), when HotChocolate decodes the cursor, there is a bug where ':' is the escape character.This pull request switches the escape character defined in
CursorParserto be '' instead of ':'I have updated some existing tests to cover having a colon embedded in the names being sorted on - these tests fail now without this code change.