-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
If I fetch something from the GraphQL-Server I get from the Server-Side-Rendering <div>loading...</div>
instead of my data. Any idea how to make the SSR waiting for the data?
// home.jsx
...
import query from "./query.gql";
import withApollo from "~/shared/withApollo";
export const Home: StatelessComponent<{}> = ({ loading, entities }) => {
console.log('entities', entities)
if (loading) {
return <div>loading...</div>;
}
return (
<div>{entities.map(item => "...")}</div>
);
};
const withQuery = graphql(query, {
props: ({ ownProps, data }) => ({
...ownProps,
entities: data.nodeQuery && data.nodeQuery.entities,
loading: data.loading
})
});
// export default Home;
export default compose(withApollo, withQuery)(Home);
Metadata
Metadata
Assignees
Labels
No labels