Giter VIP home page Giter VIP logo

Comments (2)

gauravtiwari avatar gauravtiwari commented on June 20, 2024

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.

from relay-rails-blog.

mongjong59 avatar mongjong59 commented on June 20, 2024

@gauravtiwari
Seems we can get it work by means of React on Rails Node.js SSR (I pushed a fix on the server file, merged with v6.5.0).

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:

  1. extract GraphQL queries for the app on Rails side
  2. Schema.execute(query)
  3. hydrate Relay/Apollo store
  4. 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?

from relay-rails-blog.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.