How to use the hops-react.ReactContext function in hops-react

To help you get started, we’ve selected a few hops-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xing / hops / packages / graphql / dom.js View on Github external
};
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,
    },
  };
};
github xing / hops / packages / graphql / node.js View on Github external
]),
        });
      }.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,
    },
  };
};

hops-react

React and ReactRouter setup for Hops

MIT
Latest version published 2 years ago

Package Health Score

60 / 100
Full package analysis