-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Description
We should come up with a better solution to handle multiple queries in Faustjs. Discussion around useFaustQuery and multiple queries: #2110
Summary:
useFaustQueryadds an elegant way to access multiple queries on client side.
- But it don't support to get the same queries with different variables.
- It's also adding a duplicate cache, where we already have the same data in Apollo cache.
We can use Apollo's
useQueryto access server-fetched data with more control.
- To do this we need to have the correct query variables that server uses to fetch data, mostly based on seed query.
- Template passes seed query data inside props. But it's not a developer friendly way to access that data, also requires prop drilling for child components.
Next steps:
A better way to access the data on client side should be explored.
- One option is to have
useSeedQueryutility to access the seed node anywhere underFaustProvider.- Another way is to wrap useQuery with
useFaustQuerywithout restricting the capabilities ofuseQuery.We should avoid breaking changes.
We may consider a config option to disable useFaustQuery-related cache for those who want it.
We should well document the capabilities of Faust for the multiple queries.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
🆕 Backlog