facebook / facebook/relay

Handle laziness between lazy queries

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

Description

## Scenario

I'm having an issue with `useLazyLoadQuery` and some `Suspense` fallbacks. In my scenario, what I have is: a component that have four children component, each of these components has its respective `useLazyLoadQuery`, but I would like a behavior where three of these components just render after the first query be resolved.

Without it, the current behavior that I have is: all of these components is rendered together and display in a way that brings a bad UX to the final user, because isn't rendering in the right order.

Is there any way where I could do something similar to it? Or any idea about how can I solve it?
The structure of my component is something similar to it:

Structure of my components

```
Component
ComponentA
useLazyLoadQuery
ComponentB
useLazyLoadQuery
ComponentC
useLazyLoadQuery
ComponentD
useLazyLoadQuery
```

## Observations

- We didn't implement `@defer` directive, so we can't use a `Suspense` with `useFragment` yet.

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.