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

Doesn't wait for data before rendering #10

Closed
trainiac opened this issue Jun 8, 2019 · 1 comment
Closed

Doesn't wait for data before rendering #10

trainiac opened this issue Jun 8, 2019 · 1 comment

Comments

@trainiac
Copy link

trainiac commented Jun 8, 2019

I might be missing something but from reading the example and code these hooks don't actually allow you to render your data server side. Yes, you can render the state of your app before you have data and these hooks will allow you to wait for data being fetched serialized to the client. However in order to achieve SEO goals you have to have the data rendered within your html.

In graphql-hooks-ssr they make a pass through the app render tree with renderToStaticMarkup. That is what queues up the async requests. They then wait for those async requests to finish and then make another render pass with renderToString with your pre-loaded data.

@trainiac trainiac changed the title Doesn't wait for Data before rendering Doesn't wait for data before rendering Jun 8, 2019
@simoneb
Copy link
Owner

simoneb commented Jun 10, 2019

That's a very good point, don't know how I missed it. I'm planning to look into this soon and release a new version that supports this scenario.

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

2 participants