Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
import {
combineContexts,
contextDefinition as reactContext
} from 'hops-react';
import {
contextDefinition as reduxContext
} from 'hops-redux';
import {
contextDefinition as graphqlContext
} from 'hops-graphql';
export default combineContexts(
reactContext,
reduxContext,
graphqlContext
);
},
]),
});
}.bind(this)
);
},
prefetchData: function(rootElement) {
return process.env.HOPS_MODE !== 'static'
? ReactApollo.getDataFromTree(rootElement)
: Promise.resolve();
},
});
exports.contextDefinition = exports.GraphQLContext;
exports.createContext = hopsReact.combineContexts(
hopsReact.ReactContext,
exports.GraphQLContext
);
exports.graphqlExtension = function(config) {
return {
context: exports.GraphQLContext,
config: {
graphql: config,
},
};
};
return common.constructor.apply(this, arguments);
};
exports.GraphQLContext.prototype = Object.assign({}, common, {
createCache: function() {
return common.createCache
.call(this)
.restore(global[constants.APOLLO_STATE]);
},
getIntrospectionResult: function() {
return global[constants.APOLLO_IQRD];
},
});
exports.contextDefinition = exports.GraphQLContext;
exports.createContext = hopsReact.combineContexts(
hopsReact.ReactContext,
exports.GraphQLContext
);
exports.graphqlExtension = function(config) {
return {
context: exports.GraphQLContext,
config: {
graphql: config,
},
};
};