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

Allow the cache viewer to sort items more "intelligently" when showing cache entries that have a number at the end #5379

Closed
StylianosGakis opened this issue Nov 17, 2023 · 2 comments

Comments

@StylianosGakis
Copy link
Contributor

Use case

When looking at my cache entries in the IDE Plugin, in the window "Apollo Normalized Cache", my cache entries are sorted like this:

QUERY_ROOT
chat()
chat().messages.0
chat().messages.1
chat().messages.10
chat().messages.11
chat().messages.12
chat().messages.13
chat().messages.14
chat().messages.2
chat().messages.3
chat().messages.4
chat().messages.5
chat().messages.6
chat().messages.7
chat().messages.8
chat().messages.9

This is maybe not always a big deal, but in my case, working with reading chat messages from the cache, it would actually be quite convenient for the entries to be sorted exactly as they came into the cache to easier debug what is going on there.

Describe the solution you'd like

The current sorting sorts per character, and that looks like it's sorting 1 -> 10 -> 2 instead of 1 -> 2 -> ... -> 10 -> 11 and so on.
For this to be fixed, the sorting would need to happen taking into consideration when numbers are involved and sorting those in a special way compared to other strings.

@BoD
Copy link
Contributor

BoD commented Nov 27, 2023

Done in #5396 which will be included in the next release and snapshot of the plugin.

@BoD BoD closed this as completed Nov 27, 2023
@StylianosGakis
Copy link
Contributor Author

Wow thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants