Multiple queries at the same page
Opened this issue · 1 comments
iksent commented
Hello, I have the next problem:
- Imagine my index page:
function IndexPage() {
return (
<div>
<Articles />
<Categories />
</div>
)
}
- Both Articles and Categories components have react hooks for querying data from GraphQL with SSR.
- And the problem is that one of these components (random) not waiting for the query's end and I don't see the result data, but loading spinners at the client side.
- If I remove Articles or Categories component, then I see that querying is being made at SSR always.
- So the problem is that maybe
getInitialProps
not waiting for all promises and resolves when the first promise resolves.
Can you please answer, is it connected with next-apollo
?
iksent commented
I see this is connected with getDataFromTree which next-apollo
uses.
Also I am experiencing some problems with caching GQL data. Can these problems be related? Don't know...