Comments (10)
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.
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.
Could you provide some more details of what isn't working or features missing?
from reason-apollo.
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.
Part of that should be fixed now:
-
Being able to set ssr to true: https://github.com/apollographql/reason-apollo/blob/master/src/ReasonApollo.re#L5
-
Being able to provide a fetch client: https://github.com/apollographql/reason-apollo/blob/master/src/ApolloLinks.re#L24
from reason-apollo.
Being able to restore the in memory cache: #25
from reason-apollo.
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.
It would be great for an example. cheers!
from reason-apollo.
Queries don't seem to execute on the server, am I missing something?
from reason-apollo.
@romanschejbal queries execute for me, could be a network issue? like host unreachable? what is the error thrown?
from reason-apollo.
Related Issues (20)
- Spike on cypress watch mode
- Support react-apollo >=3 ? HOT 2
- WriteQuery with enums seems unusable HOT 4
- Fragments doesn't work in 0.17.0 HOT 2
- Forward Guidance: Reason Apollo Continued Development? HOT 7
- Upgrading to [email protected] errors HOT 3
- Updating the example
- [email protected] HOT 2
- graphql_ppx/ppx not found when resolving ppx-flags HOT 3
- Version compatibility issue with ReasonApolloMutation.re ? HOT 6
- PPX issue due to bs-platform HOT 3
- Missing git tags for 0.19.0 and 0.20.0 releases
- How can setContext be used? HOT 7
- Mutation promises rejected instead of resolving with Errors
- Can't call `mutate` on the `client` when using `Consumer` HOT 2
- Upgrading reasonreact to v0.8.0 breaks
- How to use awaitRefetchQueries?
- Not working with bs-platform 8 (jsx 2 in example)
- Compilation error when try to use generatedApolloClient.query
- Unable to set timeout to WebSocket configuration options
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reason-apollo.