Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple queries at the same page #97

Open
iksent opened this issue Mar 12, 2021 · 1 comment
Open

Multiple queries at the same page #97

iksent opened this issue Mar 12, 2021 · 1 comment

Comments

@iksent
Copy link

iksent commented Mar 12, 2021

Hello, I have the next problem:

  1. Imagine my index page:
function IndexPage() {
  return (
    <div>
      <Articles />
      <Categories />
    </div>
  )
}
  1. Both Articles and Categories components have react hooks for querying data from GraphQL with SSR.
  2. 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.
  3. If I remove Articles or Categories component, then I see that querying is being made at SSR always.
  4. 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
Copy link
Author

iksent commented Mar 13, 2021

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant