usePaginationFragment reordering keys of input object
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
# Summay
One of my components, written using `usePaginationFragment`, was not loading the next page correctly. After translating it to use `createFragmentContainer`, it started to work. While comparing the logs of both implementations, I noticed that the hook is reordering the keys of my object arguments.
### Expected
Object keys of my arguments should not be reordered. In my case, the keys were the following:
### Arguments definition
```js
@argumentDefinitions(
...
order_by: {
type: "[foo_order_by!]"
defaultValue: { precedence: asc, sub: asc_nulls_first, name: asc }
}
) ...
```
### Console output
```js
// arguments called in createFragmentContainer
{
...
"order_by":{ precedence: asc, sub: asc_nulls_first, name: asc }
}
// arguments called in usePgainationContainer
{
...
"order_by":{ name: asc , precedence: asc, sub: asc_nulls_first}
}
```
# Question
Is there anything that can be done to prevent this? Is it expected that one should not rely on the order of object keys in the arguments?
Contributor guide
Assessment
This issue has not been assessed yet.