relay-runtime 15.0.0 ConnectionHandler.getConnection() is undefined
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Here is my example query:
```
const viewerData = useLazyLoadQuery(graphql`
query RecentSearchesQuery($filterOption: SavedSearchesWith) {
viewer {
...RecentSearches_viewer @arguments(with: $filterOption)
}
}`,
{ filterOption },
queryOptions,
);
```
I'm passing filterOption to RecentSearchesQuery. here is fragment RecentSearches_viewer
```
const savedSearchesData = useFragment(graphql`
fragment RecentSearches_viewer on Viewer
@argumentDefinitions(
first: {type: "Int", defaultValue: 10}
with: {type: "SavedSearchesWith"}
)
{
savedSearches(first: $first, with: $with)
@connection(key: "RecentSearches_viewer__savedSearches") {
edges {
node {
id
query
}
}
}
}`,
viewer
);
```
when I'm going to update the store in the updater of mutation, I'm getting an error:
```
const savedSearchesConnection = ConnectionHandler.getConnection(
viewer,
'RecentSearches_viewer__savedSearches',
);
```
savedSearchesConnection is undefined. but when I didn't pass argument to RecentSearchesQuery, I don't get any error
How can I resolve this issue?
Contributor guide
Assessment
This issue has not been assessed yet.