facebook / facebook/relay

[modern] Same field queried with different arguments overwrites proper results

Open
#2,024 2 comments 1 reaction 0 assignees View on GitHub
bug help wanted wontfix
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Given query:
```graphql
query UsersStatisticsQuery(
$monthAgo: DateTime!,
$twoMonthsAgo: DateTime!,
$threeMonthsAgo: DateTime!,
$fourMonthsAgo: DateTime!,
$fiveMonthsAgo: DateTime!
$sixMonthsAgo: DateTime!
) {
root {
statistics {
usersUpToNow: users_count
usersUpToMonthAgo: users_count(registered_before: $monthAgo)
usersUpToTwoMonthsAgo: users_count(registered_before: $twoMonthsAgo)
usersUpToThreeMonthsAgo: users_count(registered_before: $threeMonthsAgo)
usersUpToFourMonthsAgo: users_count(registered_before: $fourMonthsAgo)
usersUpToFiveMonthsAgo: users_count(registered_before: $fiveMonthsAgo)
}
}
}
```

in GraphiQL it gets properly returned:

```json
{
"data": {
"root": {
"statistics": {
"usersUpToNow": 1282,
"usersUpToMonthAgo": 1248,
"usersUpToTwoMonthsAgo": 1156,
"usersUpToThreeMonthsAgo": 1071,
"usersUpToFourMonthsAgo": 968,
"usersUpToFiveMonthsAgo": 737,
}
}
}
}
```

However, in component:
```jsx
usersUpToNow: 1282
usersUpToMonthAgo: 1248
usersUpToTwoMonthsAgo: 1248
usersUpToThreeMonthsAgo: 1248
usersUpToFourMonthsAgo: 1248
usersUpToFiveMonthsAgo: 1248
```

Well… I think it shouldn't have duplicated wrong values. `react-relay@^1.1.0`

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.