getDataFromTree not working (render to Loading...)
See original GitHub issue_app.js:
this code render <div>Loading…</div>
import withApollo from 'next-with-apollo';
import { ApolloProvider } from '@apollo/react-hooks';
import ApolloClient, { InMemoryCache } from 'apollo-boost';
import { getDataFromTree } from '@apollo/react-ssr'
const App = ({Component, pageProps, apollo}) => (
<ApolloProvider client={ apollo }>
<Component { ...pageProps } />
</ApolloProvider>
);
export default withApollo(function ({initialState}) {
return new ApolloClient({
uri: 'https://api.graph.cool/simple/v1/cixmkt2ul01q00122mksg82pn',
cache: new InMemoryCache().restore(initialState || {})
});
}, {getDataFromTree})(App, {getDataFromTree});
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:10
Top Results From Across the Web
SSR - Apollo GraphQL Docs
The getDataFromTree function takes your React tree, determines which queries are needed to render them, and then fetches them all. JavaScript.
Read more >React Apollo SSR getDataFromTree not waiting for query
The issue here is that getDataFromTree is not waiting for my query at all. It simply returns the component with loading: true and...
Read more >next-with-apollo
I try to totally disable Apollo queries during server render in test mode, so that I can mock them ... getDataFromTree not working...
Read more >Setting up Apollo GraphQL in Next.js with Server Side ...
However, the biggest downside to client side rendering is poor SEO ... running `getDataFromTree`', error); } // getDataFromTree does not ...
Read more >Server-side rendering - Apollo GraphQL
Apollo provides two techniques to allow your applications to load ... be getting stale data and you'll have problems with authentication.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I changed to use 4.3.0 and it render in server side
With 5.0.0 and 5.0.1, page is rendered at client side with “Loading…”