facebook / facebook/relay

Feature request: stable sort in normalization ASTs

Open
#4,899 1 comment 0 reactions 0 assignees View on GitHub
shared with relay team
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

* I would love it if fields in normalization ASTs were sorted stably, probably in the order: __typename, id, scalar and linked fields sorted by alias, inline fragments, misc
* We generate inlined queries from normalization ASTs in JS, so this is somewhat slow. (~1.5s for ~300 queries). It's quite nice to be able to see the effect your changes had
* But, if the fields aren't stably sorted, changes (like removing a fragment) shuffle fields around, making the diff less informative

No big deal, just a suggestion.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.