You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to set up server-side rendering with isomorphic-relay. But I got stuck because it seems that with ExecJS (with Node.js backend), Promises can't be consumed. I tried a very basic Promise in my server startup file.
The above code will log [Object Promise]. But normally it should be foobar and {}. I didn't find much about whether Promise are supported in ExecJS. But this is obviously a key in server-side rendering with a GraphQL client. Do you have any idea on this issue?
The text was updated successfully, but these errors were encountered:
Hey @nostophilia, I haven't tried server side rendering with relay yet. You can checkout this repo, https://github.com/brandfolder/rails-graphql-relay (looks outdated though). I will look into this too.
However it doesn't seem an ideal way as it means extra Rails call stack which is not necessary. It would be great if we can:
extract GraphQL queries for the app on Rails side
Schema.execute(query)
hydrate Relay/Apollo store
render the app
This seems more feasible with Relay as the code of Isomorphic React Relay implies while the getQueriesFromTree of Apollo doesn't seem to return root queries with all sub-queries. Do you have idea whether there's an API for extracting root queries in Relay or Apollo and do they both support store hydration?
I tried to set up server-side rendering with
isomorphic-relay
. But I got stuck because it seems that with ExecJS (with Node.js backend), Promises can't be consumed. I tried a very basic Promise in my server startup file.The above code will log [Object Promise]. But normally it should be
foobar
and{}
. I didn't find much about whether Promise are supported in ExecJS. But this is obviously a key in server-side rendering with a GraphQL client. Do you have any idea on this issue?The text was updated successfully, but these errors were encountered: