Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-apollo

Package Overview
Dependencies
Maintainers
8
Versions
220
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-apollo - npm Package Compare versions

Comparing version 2.5.3 to 2.5.4

react-apollo.cjs.d.ts

2

ApolloContext.d.ts

@@ -1,2 +0,2 @@

import React from 'react';
import * as React from 'react';
import ApolloClient from 'apollo-client';

@@ -3,0 +3,0 @@ import { DocumentNode } from 'graphql';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var react_1 = tslib_1.__importDefault(require("react"));
exports.ApolloContext = react_1.default.createContext
? react_1.default.createContext(undefined)
var React = tslib_1.__importStar(require("react"));
exports.ApolloContext = React.createContext
? React.createContext(undefined)
: null;
//# sourceMappingURL=ApolloContext.js.map

@@ -73,3 +73,3 @@ import * as React from 'react';

optimisticResponse: PropTypes.Requireable<object>;
refetchQueries: PropTypes.Requireable<(string | object | null)[] | ((...args: any[]) => any)>;
refetchQueries: PropTypes.Requireable<((...args: any[]) => any) | (string | object | null)[]>;
awaitRefetchQueries: PropTypes.Requireable<boolean>;

@@ -76,0 +76,0 @@ update: PropTypes.Requireable<(...args: any[]) => any>;

{
"name": "react-apollo",
"version": "2.5.3",
"version": "2.5.4",
"author": "opensource@apollographql.com",

@@ -5,0 +5,0 @@ "description": "React data container for Apollo Client",

@@ -38,4 +38,4 @@ "use strict";

return (React.createElement(Query_1.default, tslib_1.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document, warnUnhandledError: true }), function (_a) {
var _b, _c;
var _ = _a.client, data = _a.data, r = tslib_1.__rest(_a, ["client", "data"]);
var _b, _c;
if (operationOptions.withRef) {

@@ -42,0 +42,0 @@ _this.withRef = true;

@@ -104,2 +104,3 @@ "use strict";

}
var fetchPolicy = _this.queryObservable.options.fetchPolicy;
Object.assign(data, { loading: loading, networkStatus: networkStatus, error: error });

@@ -114,4 +115,7 @@ if (loading) {

}
else if (fetchPolicy === 'no-cache' &&
Object.keys(currentResult.data).length === 0) {
data.data = _this.previousData;
}
else {
var fetchPolicy = _this.queryObservable.options.fetchPolicy;
var partialRefetch = _this.props.partialRefetch;

@@ -118,0 +122,0 @@ if (partialRefetch &&

@@ -7,4 +7,3 @@ 'use strict';

var React__default = require('react');
var React__default__default = _interopDefault(React__default);
var react = require('react');
var propTypes = require('prop-types');

@@ -17,4 +16,4 @@ var tsInvariant = require('ts-invariant');

var ApolloContext = React__default__default.createContext
? React__default__default.createContext(undefined)
var ApolloContext = react.createContext
? react.createContext(undefined)
: null;

@@ -30,3 +29,3 @@

}
return ApolloContext ? (React__default.createElement(ApolloContext.Consumer, null, finish)) : (finish(legacyContext));
return ApolloContext ? (react.createElement(ApolloContext.Consumer, null, finish)) : (finish(legacyContext));
};

@@ -59,3 +58,3 @@ ApolloConsumer.contextTypes = {

ApolloProvider.prototype.render = function () {
return ApolloContext ? (React__default.createElement(ApolloContext.Provider, { value: this.getChildContext() }, this.props.children)) : (this.props.children);
return ApolloContext ? (react.createElement(ApolloContext.Provider, { value: this.getChildContext() }, this.props.children)) : (this.props.children);
};

@@ -71,3 +70,3 @@ ApolloProvider.propTypes = {

return ApolloProvider;
}(React__default.Component));
}(react.Component));

@@ -245,2 +244,3 @@ var DocumentType;

}
var fetchPolicy = _this.queryObservable.options.fetchPolicy;
Object.assign(data, { loading: loading, networkStatus: networkStatus, error: error });

@@ -255,4 +255,7 @@ if (loading) {

}
else if (fetchPolicy === 'no-cache' &&
Object.keys(currentResult.data).length === 0) {
data.data = _this.previousData;
}
else {
var fetchPolicy = _this.queryObservable.options.fetchPolicy;
var partialRefetch = _this.props.partialRefetch;

@@ -425,3 +428,3 @@ if (partialRefetch &&

return Query;
}(React__default.Component));
}(react.Component));

@@ -576,3 +579,3 @@ var initialState = {

return Mutation;
}(React__default.Component));
}(react.Component));

@@ -692,3 +695,3 @@ var Subscription = (function (_super) {

return Subscription;
}(React__default.Component));
}(react.Component));

@@ -734,3 +737,3 @@ var defaultMapPropsToOptions = function () { return ({}); };

return GraphQLBase;
}(React__default.Component));
}(react.Component));

@@ -765,5 +768,5 @@ function withQuery(document, operationOptions) {

}
return (React__default.createElement(Query, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document, warnUnhandledError: true }), function (_a) {
return (react.createElement(Query, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document, warnUnhandledError: true }), function (_a) {
var _b, _c;
var _ = _a.client, data = _a.data, r = tslib.__rest(_a, ["client", "data"]);
var _b, _c;
if (operationOptions.withRef) {

@@ -776,3 +779,3 @@ _this.withRef = true;

if (shouldSkip) {
return (React__default.createElement(WrappedComponent, tslib.__assign({}, props, {})));
return (react.createElement(WrappedComponent, tslib.__assign({}, props, {})));
}

@@ -790,3 +793,3 @@ var result = Object.assign(r, data || {});

}
return (React__default.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
return (react.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
}));

@@ -828,3 +831,3 @@ };

}
return (React__default.createElement(Mutation, tslib.__assign({}, opts, { mutation: document, ignoreResults: true }), function (mutate, _result) {
return (react.createElement(Mutation, tslib.__assign({}, opts, { mutation: document, ignoreResults: true }), function (mutate, _result) {
var _a, _b;

@@ -840,3 +843,3 @@ var name = operationOptions.name || 'mutate';

}
return (React__default.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
return (react.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
}));

@@ -887,5 +890,5 @@ };

}
return (React__default.createElement(Subscription, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) {
return (react.createElement(Subscription, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) {
var _b, _c;
var data = _a.data, r = tslib.__rest(_a, ["data"]);
var _b, _c;
if (operationOptions.withRef) {

@@ -898,3 +901,3 @@ _this.withRef = true;

if (shouldSkip) {
return (React__default.createElement(WrappedComponent, tslib.__assign({}, props, {})));
return (react.createElement(WrappedComponent, tslib.__assign({}, props, {})));
}

@@ -912,3 +915,3 @@ var result = Object.assign(r, data || {});

}
return (React__default.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
return (react.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
}));

@@ -959,3 +962,3 @@ };

var _this = this;
return (React__default.createElement(ApolloConsumer, null, function (client) {
return (react.createElement(ApolloConsumer, null, function (client) {
var props = Object.assign({}, _this.props, {

@@ -965,3 +968,3 @@ client: client,

});
return React__default.createElement(WrappedComponent, tslib.__assign({}, props));
return react.createElement(WrappedComponent, tslib.__assign({}, props));
}));

@@ -972,3 +975,3 @@ };

return WithApollo;
}(React__default.Component));
}(react.Component));
return hoistNonReactStatics(WithApollo, WrappedComponent, {});

@@ -1057,3 +1060,3 @@ }

return RenderPromisesProvider;
}(React__default.Component));
}(react.Component));
Object.keys(context).forEach(function (key) {

@@ -1063,3 +1066,3 @@ RenderPromisesProvider.childContextTypes[key] = propTypes.any;

function process() {
var html = renderFunction(React__default.createElement(RenderPromisesProvider));
var html = renderFunction(react.createElement(RenderPromisesProvider));
return renderPromises.hasPromises()

@@ -1066,0 +1069,0 @@ ? renderPromises.consumeAndAwaitPromises().then(process)

@@ -1,2 +0,2 @@

import React__default, { createElement, Component } from 'react';
import { createContext, createElement, Component } from 'react';
import { object, func, node, string, bool, number, oneOfType, arrayOf, any } from 'prop-types';

@@ -9,4 +9,4 @@ import { InvariantError, invariant } from 'ts-invariant';

var ApolloContext = React__default.createContext
? React__default.createContext(undefined)
var ApolloContext = createContext
? createContext(undefined)
: null;

@@ -234,2 +234,3 @@

}
var fetchPolicy = _this.queryObservable.options.fetchPolicy;
Object.assign(data, { loading: loading, networkStatus: networkStatus, error: error });

@@ -244,4 +245,7 @@ if (loading) {

}
else if (fetchPolicy === 'no-cache' &&
Object.keys(currentResult.data).length === 0) {
data.data = _this.previousData;
}
else {
var fetchPolicy = _this.queryObservable.options.fetchPolicy;
var partialRefetch = _this.props.partialRefetch;

@@ -751,4 +755,4 @@ if (partialRefetch &&

return (createElement(Query, __assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document, warnUnhandledError: true }), function (_a) {
var _b, _c;
var _ = _a.client, data = _a.data, r = __rest(_a, ["client", "data"]);
var _b, _c;
if (operationOptions.withRef) {

@@ -869,4 +873,4 @@ _this.withRef = true;

return (createElement(Subscription, __assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) {
var _b, _c;
var data = _a.data, r = __rest(_a, ["data"]);
var _b, _c;
if (operationOptions.withRef) {

@@ -873,0 +877,0 @@ _this.withRef = true;

@@ -5,10 +5,9 @@ (function (global, factory) {

(global = global || self, factory(global['react-apollo'] = {}, global.react, global.propTypes, global.invariant, global.tslib, global.apollo.core, global.isEqual, global.hoistNonReactStatics));
}(this, function (exports, React__default, propTypes, tsInvariant, tslib, apolloClient, isEqual, hoistNonReactStatics) { 'use strict';
}(this, function (exports, react, propTypes, tsInvariant, tslib, apolloClient, isEqual, hoistNonReactStatics) { 'use strict';
var React__default__default = 'default' in React__default ? React__default['default'] : React__default;
isEqual = isEqual && isEqual.hasOwnProperty('default') ? isEqual['default'] : isEqual;
hoistNonReactStatics = hoistNonReactStatics && hoistNonReactStatics.hasOwnProperty('default') ? hoistNonReactStatics['default'] : hoistNonReactStatics;
var ApolloContext = React__default__default.createContext
? React__default__default.createContext(undefined)
var ApolloContext = react.createContext
? react.createContext(undefined)
: null;

@@ -24,3 +23,3 @@

}
return ApolloContext ? (React__default.createElement(ApolloContext.Consumer, null, finish)) : (finish(legacyContext));
return ApolloContext ? (react.createElement(ApolloContext.Consumer, null, finish)) : (finish(legacyContext));
};

@@ -53,3 +52,3 @@ ApolloConsumer.contextTypes = {

ApolloProvider.prototype.render = function () {
return ApolloContext ? (React__default.createElement(ApolloContext.Provider, { value: this.getChildContext() }, this.props.children)) : (this.props.children);
return ApolloContext ? (react.createElement(ApolloContext.Provider, { value: this.getChildContext() }, this.props.children)) : (this.props.children);
};

@@ -65,3 +64,3 @@ ApolloProvider.propTypes = {

return ApolloProvider;
}(React__default.Component));
}(react.Component));

@@ -239,2 +238,3 @@ var DocumentType;

}
var fetchPolicy = _this.queryObservable.options.fetchPolicy;
Object.assign(data, { loading: loading, networkStatus: networkStatus, error: error });

@@ -249,4 +249,7 @@ if (loading) {

}
else if (fetchPolicy === 'no-cache' &&
Object.keys(currentResult.data).length === 0) {
data.data = _this.previousData;
}
else {
var fetchPolicy = _this.queryObservable.options.fetchPolicy;
var partialRefetch = _this.props.partialRefetch;

@@ -419,3 +422,3 @@ if (partialRefetch &&

return Query;
}(React__default.Component));
}(react.Component));

@@ -570,3 +573,3 @@ var initialState = {

return Mutation;
}(React__default.Component));
}(react.Component));

@@ -686,3 +689,3 @@ var Subscription = (function (_super) {

return Subscription;
}(React__default.Component));
}(react.Component));

@@ -728,3 +731,3 @@ var defaultMapPropsToOptions = function () { return ({}); };

return GraphQLBase;
}(React__default.Component));
}(react.Component));

@@ -759,5 +762,5 @@ function withQuery(document, operationOptions) {

}
return (React__default.createElement(Query, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document, warnUnhandledError: true }), function (_a) {
return (react.createElement(Query, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document, warnUnhandledError: true }), function (_a) {
var _b, _c;
var _ = _a.client, data = _a.data, r = tslib.__rest(_a, ["client", "data"]);
var _b, _c;
if (operationOptions.withRef) {

@@ -770,3 +773,3 @@ _this.withRef = true;

if (shouldSkip) {
return (React__default.createElement(WrappedComponent, tslib.__assign({}, props, {})));
return (react.createElement(WrappedComponent, tslib.__assign({}, props, {})));
}

@@ -784,3 +787,3 @@ var result = Object.assign(r, data || {});

}
return (React__default.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
return (react.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
}));

@@ -822,3 +825,3 @@ };

}
return (React__default.createElement(Mutation, tslib.__assign({}, opts, { mutation: document, ignoreResults: true }), function (mutate, _result) {
return (react.createElement(Mutation, tslib.__assign({}, opts, { mutation: document, ignoreResults: true }), function (mutate, _result) {
var _a, _b;

@@ -834,3 +837,3 @@ var name = operationOptions.name || 'mutate';

}
return (React__default.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
return (react.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
}));

@@ -881,5 +884,5 @@ };

}
return (React__default.createElement(Subscription, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) {
return (react.createElement(Subscription, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) {
var _b, _c;
var data = _a.data, r = tslib.__rest(_a, ["data"]);
var _b, _c;
if (operationOptions.withRef) {

@@ -892,3 +895,3 @@ _this.withRef = true;

if (shouldSkip) {
return (React__default.createElement(WrappedComponent, tslib.__assign({}, props, {})));
return (react.createElement(WrappedComponent, tslib.__assign({}, props, {})));
}

@@ -906,3 +909,3 @@ var result = Object.assign(r, data || {});

}
return (React__default.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
return (react.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
}));

@@ -953,3 +956,3 @@ };

var _this = this;
return (React__default.createElement(ApolloConsumer, null, function (client) {
return (react.createElement(ApolloConsumer, null, function (client) {
var props = Object.assign({}, _this.props, {

@@ -959,3 +962,3 @@ client: client,

});
return React__default.createElement(WrappedComponent, tslib.__assign({}, props));
return react.createElement(WrappedComponent, tslib.__assign({}, props));
}));

@@ -966,3 +969,3 @@ };

return WithApollo;
}(React__default.Component));
}(react.Component));
return hoistNonReactStatics(WithApollo, WrappedComponent, {});

@@ -1051,3 +1054,3 @@ }

return RenderPromisesProvider;
}(React__default.Component));
}(react.Component));
Object.keys(context).forEach(function (key) {

@@ -1057,3 +1060,3 @@ RenderPromisesProvider.childContextTypes[key] = propTypes.any;

function process() {
var html = renderFunction(React__default.createElement(RenderPromisesProvider));
var html = renderFunction(react.createElement(RenderPromisesProvider));
return renderPromises.hasPromises()

@@ -1060,0 +1063,0 @@ ? renderPromises.consumeAndAwaitPromises().then(process)

@@ -45,4 +45,4 @@ "use strict";

return (React.createElement(Subscriptions_1.default, tslib_1.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) {
var _b, _c;
var data = _a.data, r = tslib_1.__rest(_a, ["data"]);
var _b, _c;
if (operationOptions.withRef) {

@@ -49,0 +49,0 @@ _this.withRef = true;

@@ -7,3 +7,3 @@ "use strict";

var apollo_cache_inmemory_1 = require("apollo-cache-inmemory");
var index_1 = require("./index");
var react_apollo_cjs_1 = require("./react-apollo.cjs");
var test_links_1 = require("./test-links");

@@ -28,3 +28,3 @@ tslib_1.__exportStar(require("./test-links"), exports);

return children
? (React.createElement(index_1.ApolloProvider, { client: this.state.client }, React.cloneElement(React.Children.only(children), tslib_1.__assign({}, childProps))))
? (React.createElement(react_apollo_cjs_1.ApolloProvider, { client: this.state.client }, React.cloneElement(React.Children.only(children), tslib_1.__assign({}, childProps))))
: null;

@@ -31,0 +31,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc