GithubHelp home page GithubHelp logo

SSR? about reason-apollo HOT 10 OPEN

apollographql avatar apollographql commented on May 22, 2024
SSR?

from reason-apollo.

Comments (10)

kgoggin avatar kgoggin commented on May 22, 2024 5

Anyone have an example of this in the wild? I'm curious about how you'd set up a different instance of the client for server use and then have that client used when doing SSR in place of the one defined for the client. Thanks!

from reason-apollo.

rickiesmooth avatar rickiesmooth commented on May 22, 2024 1

yes I was also looking for an example of providing a fetch client. I tried

  ApolloLinks.createHttpLink(
    ~fetch=Fetch,
  );

But that didn't work.

Edit: after reading the second comment again, added [%bs.raw "require('isomorphic-unfetch')"]; and it worked

from reason-apollo.

Gregoirevda avatar Gregoirevda commented on May 22, 2024

Could you provide some more details of what isn't working or features missing?

from reason-apollo.

drejohnson avatar drejohnson commented on May 22, 2024

Was getting Error: fetch is not found globally and no fetcher passed, to fix pass a fetch for [1] your environment like https://www.npmjs.com/package/node-fetch. but fixed it by adding [%bs.raw "require('isomorphic-unfetch')"];

But I was thinking more about how to do rehydration on the client like the docs suggest.

from reason-apollo.

Gregoirevda avatar Gregoirevda commented on May 22, 2024

Part of that should be fixed now:

from reason-apollo.

Gregoirevda avatar Gregoirevda commented on May 22, 2024

Being able to restore the in memory cache: #25

from reason-apollo.

drejohnson avatar drejohnson commented on May 22, 2024

Yep, this is pretty much resolved. Could add bindings for the getDataFromTree and the renderDataFromString functions for server, as well as the extract() method to be piped onto the initialized client e.g. client.extract().

from reason-apollo.

BeerPoldet avatar BeerPoldet commented on May 22, 2024

It would be great for an example. cheers!

from reason-apollo.

romanschejbal avatar romanschejbal commented on May 22, 2024

Queries don't seem to execute on the server, am I missing something?

from reason-apollo.

EnriqueVidal avatar EnriqueVidal commented on May 22, 2024

@romanschejbal queries execute for me, could be a network issue? like host unreachable? what is the error thrown?

from reason-apollo.

Related Issues (20)

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.