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

Fetched relay data is not rendered server-side #4210

Closed
1 task done
mrozbarry opened this issue Apr 25, 2018 · 4 comments
Closed
1 task done

Fetched relay data is not rendered server-side #4210

mrozbarry opened this issue Apr 25, 2018 · 4 comments

Comments

@mrozbarry
Copy link

mrozbarry commented Apr 25, 2018

In my app, I have a series of QueryRenderers (some nested inside each other) that are pulling data. When I disable javascript in my browser, I expect it to render the full page properly on the server, and give it to me, however, this does not happen.

Posted here, since I think this is a problem centric to the server-side render, and not specifically relay.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Server side should render the full app, after all the QueryRenderer calls complete.

Current Behavior

It appears that after the fetch, the QueryRenderer#render prop is not called again on the server.

Steps to Reproduce (for bugs)

  1. Add relay and a working query renderer to your app
  2. Have the result just output the result as text
  3. Disable javascript in your browser
  4. Reload the page, you won't see the result text.

Context

Your Environment

Tech Version
next 5.0.0
node 8.9.4
OS osx sierra 10.12.6
browser Chrome Version 66.0.3359.117 (Official Build) (64-bit)
@mrozbarry
Copy link
Author

I guess there is no way to know if queries have been fetched, and maybe I'm stuck doing all my queries ahead of time in getInitialProps?

@ghengeveld
Copy link

Not sure how you would do this if not through getInitialProps?

@AriLFrankel
Copy link
Contributor

[This example] demonstrates the intended pattern for next.js with Relay-Modern. Indeed you want to run your query in getInitialProps as you can see in there 👍

@itsDZhang
Copy link

Why is this issue closed?
@AriLFrankel the link you provided does not seem to work.
Would an explanation of why this happen be okay?

@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants