Connection Fields in Query are parsed to `undefined` even though network response has data in those fields
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
## Hooks used
- `useLazyLoadQuery`
- `usePaginationFragment`
## Versions
- React: `19.0.0-rc-66855b96-20241106`
- React-Relay: `18.2.0`
## Issue Description
When using `loadNext` from the `usePaginationFragment` hook, `connection` fields are parsed as `undefined` - But in the network response exist correctly.
Any data fetched initially is correctly structured via the Server response - this only happens with PAGINATED data.
This seems to be a regression after updating to the latest version of Relay. This setup was working previously.
I've been able to narrow down one of the triggers for it.
If i have a connection like `friends()`, if i add a VARIABLE of `first` - the bug appears.
Error:
`friends(first: $friendsFirst)`
Works:
`friends(first: 20)`
### Example of Data
Retrieved from Server:
```
{
"id": "123",
"friends": { "edges": [] }
}
```
Returned from `usePaginationFragment`:
```
{
"id": "123",
"friends": undefined
}
```
### Example of Query
Wrapper Query:
```
query HomeQuery($first: Int = 20, $cursor: Cursor, $where: WhereInput = {}, ...bunchOfArgs){
...HomeFragment @arguments(first: $first, cursor: $cursor, where: $where, ...bunchOfArgs: $...bunchOfArgs)
}
```
Fragment:
```
fragment HomeFragment on Query
@argumentDefinitions(
first: { type: "Int", defaultValue: 20 }
cursor: { type: "Cursor" }
where: { type: "WhereInput", defaultValue: {} }
...bunchOfArgsDefs
)
@refetchable(queryName: "HomePaginationQuery") {
objects(first: $first, after: $cursor, where: $where)
@connection(key: "HomeConnection_objects", filters: ["where"]){
edges {
node {
id
friends(first: 20 # Changing this to a variable causes the bug to appear){
edges {
node {
id
}
}
}
}
}
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.