Skip to content

Commit

Permalink
read SampleData.js for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ksakiyama committed Sep 9, 2018
1 parent 87d6f5e commit 4d6f9d7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/helpers/withData.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import debug from 'debug';

import initApollo from './initApollo';

import data from '../data/SampleData';

const logger = debug('app:withData');
logger.log = console.log.bind(console);

Expand Down Expand Up @@ -64,6 +66,9 @@ export default (ComposedComponent) => {

await getDataFromTree(app);

console.log("---------------------")
console.log("DEBUG")
console.log("---------------------")
serverState = {
apollo: { // Make sure to only include Apollo's data state
data: apollo.cache.extract(), // Extract query data from the Apollo's store
Expand All @@ -83,7 +88,7 @@ export default (ComposedComponent) => {
// render within `getInitialProps()` above (since the entire prop tree
// will be initialized there), meaning the below will only ever be
// executed on the client.
this.apollo = initApollo(this.props.serverState.apollo.data, {
this.apollo = initApollo(data, {
getToken: () => parseCookies(), // ['connect.sid'],
});
}
Expand Down

0 comments on commit 4d6f9d7

Please sign in to comment.