Skip to content

Commit

Permalink
refactor(graphql): rename mixin definition export
Browse files Browse the repository at this point in the history
BREAKING CHANGE: export naming changed
  • Loading branch information
dmbch committed Nov 22, 2017
1 parent 321e733 commit dfd1d4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/graphql/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var hopsReact = require('hops-react');
var common = require('./lib/common');
var constants = require('./lib/constants');

exports.mixin = Object.assign({}, common, {
exports.contextDefinition = Object.assign({}, common, {
createCache: function () {
return common.createCache.call(this).restore(
global[constants.APOLLO_STATE]
Expand All @@ -16,4 +16,7 @@ exports.mixin = Object.assign({}, common, {
}
});

exports.createContext = hopsReact.createContext.mixin(exports.mixin);
exports.createContext = hopsReact.combineContexts(
hopsReact.contextDefinition,
exports.contextDefinition
);
7 changes: 5 additions & 2 deletions packages/graphql/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var common = require('./lib/common');
var constants = require('./lib/constants');
var introspectionResult = require('./lib/util').getIntrospectionResult();

exports.mixin = Object.assign({}, common, {
exports.contextDefinition = Object.assign({}, common, {
enhanceElement: function (reactElement) {
var enhancedElement = common.enhanceElement.call(this, reactElement);
return ReactApollo.getDataFromTree(enhancedElement).then(function () {
Expand Down Expand Up @@ -42,4 +42,7 @@ exports.mixin = Object.assign({}, common, {
}
});

exports.createContext = hopsReact.createContext.mixin(exports.mixin);
exports.createContext = hopsReact.combineContexts(
hopsReact.contextDefinition,
exports.contextDefinition
);

0 comments on commit dfd1d4b

Please sign in to comment.