facebook / facebook/relay

Hook 'useQueryLoader' example returns a nullable queryReference which doesn't seem to make sense

Open
#3,476 4 comments 5 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

The example on https://relay.dev/docs/api-reference/use-query-loader/ shows the usage of 'useQueryLoader' with a non nullable initialQueryRef being passed in. If this is passed straight back out then surely the queryRef returned by 'useQueryLoader' cannot be null either and thus the null checks are click to reveal button are not warranted. Am I missing something?

Follow on, if I am correct in this case then perhaps the nullability for the return type should change when initialQueryRef is passed in?

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.