Socket
Socket
Sign inDemoInstall

@apollo/client

Package Overview
Dependencies
Maintainers
1
Versions
575
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apollo/client - npm Package Compare versions

Comparing version 3.0.0-beta.46 to 3.0.0-beta.47

4

cache/inmemory/entityStore.d.ts

@@ -19,4 +19,4 @@ import { KeyTrie } from 'optimism';

modify(dataId: string, modifiers: Modifier<any> | Modifiers): boolean;
delete(dataId: string, fieldName?: string): boolean;
evict(dataId: string, fieldName?: string): boolean;
delete(dataId: string, fieldName?: string, args?: Record<string, any>): boolean;
evict(dataId: string, fieldName?: string, args?: Record<string, any>): boolean;
clear(): void;

@@ -23,0 +23,0 @@ replace(newData: NormalizedCacheObject | null): void;

@@ -100,3 +100,3 @@ import { __assign, __extends } from 'tslib';

? modifiers
: modifiers[fieldName];
: modifiers[storeFieldName] || modifiers[fieldName];
if (modify) {

@@ -140,15 +140,18 @@ var newValue = modify === delModifier ? DELETE :

};
EntityStore.prototype.delete = function (dataId, fieldName) {
EntityStore.prototype.delete = function (dataId, fieldName, args) {
var _a;
return this.modify(dataId, fieldName ? (_a = {},
_a[fieldName] = delModifier,
var storeFieldName = fieldName && args
? this.policies.getStoreFieldName(dataId, fieldName, args)
: fieldName;
return this.modify(dataId, storeFieldName ? (_a = {},
_a[storeFieldName] = delModifier,
_a) : delModifier);
};
EntityStore.prototype.evict = function (dataId, fieldName) {
EntityStore.prototype.evict = function (dataId, fieldName, args) {
var evicted = false;
if (hasOwn.call(this.data, dataId)) {
evicted = this.delete(dataId, fieldName);
evicted = this.delete(dataId, fieldName, args);
}
if (this instanceof Layer) {
evicted = this.parent.evict(dataId, fieldName) || evicted;
evicted = this.parent.evict(dataId, fieldName, args) || evicted;
}

@@ -155,0 +158,0 @@ this.group.dirty(dataId, fieldName || "__exists");

@@ -12,4 +12,5 @@ import { FieldNode } from 'graphql';

}
export declare function storeValueIsStoreObject(value: StoreValue): value is StoreObject;
export declare function isFieldValueToBeMerged(value: any): value is FieldValueToBeMerged;
export declare function makeProcessedFieldsMerger(): DeepMerger<[]>;
//# sourceMappingURL=helpers.d.ts.map

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

import { isField, isReference } from '../../utilities/graphql/storeUtils.js';
import { isReference, isField } from '../../utilities/graphql/storeUtils.js';
import { DeepMerger } from '../../utilities/common/mergeDeep.js';

@@ -14,2 +14,8 @@

}
function storeValueIsStoreObject(value) {
return value !== null &&
typeof value === "object" &&
!isReference(value) &&
!Array.isArray(value);
}
function isFieldValueToBeMerged(value) {

@@ -38,3 +44,3 @@ var field = value && value.__field;

export { fieldNameFromStoreName, getTypenameFromStoreObject, isFieldValueToBeMerged, makeProcessedFieldsMerger };
export { fieldNameFromStoreName, getTypenameFromStoreObject, isFieldValueToBeMerged, makeProcessedFieldsMerger, storeValueIsStoreObject };
//# sourceMappingURL=helpers.js.map

@@ -36,3 +36,3 @@ import './fixPolyfills';

identify(object: StoreObject): string | undefined;
evict(dataId: string, fieldName?: string): boolean;
evict(dataId: string, fieldName?: string, args?: Record<string, any>): boolean;
reset(): Promise<void>;

@@ -39,0 +39,0 @@ removeOptimistic(idToRemove: string): void;

@@ -137,4 +137,4 @@ import { __extends, __assign } from 'tslib';

};
InMemoryCache.prototype.evict = function (dataId, fieldName) {
var evicted = this.optimisticData.evict(dataId, fieldName);
InMemoryCache.prototype.evict = function (dataId, fieldName, args) {
var evicted = this.optimisticData.evict(dataId, fieldName, args);
this.broadcastWatches();

@@ -141,0 +141,0 @@ return evicted;

@@ -32,4 +32,3 @@ import { InlineFragmentNode, FragmentDefinitionNode, SelectionSetNode, FieldNode } from "graphql";

fieldName: string;
field: FieldNode;
variables: Record<string, any>;
field: FieldNode | null;
policies: Policies;

@@ -81,3 +80,3 @@ }) => KeySpecifier | ReturnType<IdGetter>;

fragmentMatches(fragment: InlineFragmentNode | FragmentDefinitionNode, typename: string | undefined): boolean;
getStoreFieldName(typename: string | undefined, field: FieldNode, variables: Record<string, any>): string;
getStoreFieldName(typename: string | undefined, nameOrField: string | FieldNode, argsOrVars: Record<string, any>): string;
private storageTrie;

@@ -84,0 +83,0 @@ readField<V = StoreValue>(objectOrReference: StoreObject | Reference, nameOrField: string | FieldNode, context: ReadMergeContext, typename?: string): SafeReadonly<V>;

import { __assign } from 'tslib';
import { invariant, InvariantError } from 'ts-invariant';
import { getFragmentFromSelection } from '../../utilities/graphql/fragments.js';
import { getTypenameFromResult, argumentsObjectFromField, storeKeyNameFromField, isReference, isField } from '../../utilities/graphql/storeUtils.js';
import { getTypenameFromResult, argumentsObjectFromField, storeKeyNameFromField, getStoreKeyName, isReference, isField } from '../../utilities/graphql/storeUtils.js';
import { canUseWeakMap } from '../../utilities/common/canUse.js';
import { KeyTrie } from 'optimism';
import { fieldNameFromStoreName, isFieldValueToBeMerged } from './helpers.js';
import { fieldNameFromStoreName, storeValueIsStoreObject, isFieldValueToBeMerged } from './helpers.js';

@@ -82,3 +82,4 @@ var hasOwn = Object.prototype.hasOwnProperty;

Array.isArray(keyFields) ? keyFieldsFnFromSpecifier(keyFields) :
typeof keyFields === "function" ? keyFields : void 0;
typeof keyFields === "function" ? keyFields :
existing.keyFn;
if (fields) {

@@ -175,4 +176,13 @@ Object.keys(fields).forEach(function (fieldName) {

};
Policies.prototype.getStoreFieldName = function (typename, field, variables) {
var fieldName = field.name.value;
Policies.prototype.getStoreFieldName = function (typename, nameOrField, argsOrVars) {
var field;
var fieldName;
if (typeof nameOrField === "string") {
field = null;
fieldName = nameOrField;
}
else {
field = nameOrField;
fieldName = field.name.value;
}
var policy = this.getFieldPolicy(typename, fieldName, false);

@@ -182,4 +192,4 @@ var storeFieldName;

if (keyFn && typename) {
var args = argumentsObjectFromField(field, variables);
var context = { typename: typename, fieldName: fieldName, field: field, variables: variables, policies: this };
var args = field ? argumentsObjectFromField(field, argsOrVars) : argsOrVars;
var context = { typename: typename, fieldName: fieldName, field: field, policies: this };
while (keyFn) {

@@ -197,3 +207,5 @@ var specifierOrString = keyFn(args, context);

if (storeFieldName === void 0) {
storeFieldName = storeKeyNameFromField(field, variables);
storeFieldName = field
? storeKeyNameFromField(field, argsOrVars)
: getStoreKeyName(fieldName, argsOrVars);
}

@@ -237,9 +249,6 @@ return fieldName === fieldNameFromStoreName(storeFieldName)

}
if (incoming && typeof incoming === "object") {
if (isReference(incoming)) {
return incoming;
}
if (Array.isArray(incoming)) {
return incoming.map(function (item) { return policies.applyMerges(void 0, item, context); });
}
if (Array.isArray(incoming)) {
return incoming.map(function (item) { return policies.applyMerges(void 0, item, context); });
}
if (storeValueIsStoreObject(incoming)) {
var e_1 = existing;

@@ -250,5 +259,14 @@ var i_1 = incoming;

: typeof e_1 === "object" && e_1;
var newFields_1;
Object.keys(i_1).forEach(function (storeFieldName) {
i_1[storeFieldName] = policies.applyMerges(context.getFieldValue(e_1, storeFieldName), i_1[storeFieldName], context, firstStorageKey_1 ? [firstStorageKey_1, storeFieldName] : void 0);
var incomingValue = i_1[storeFieldName];
var appliedValue = policies.applyMerges(context.getFieldValue(e_1, storeFieldName), incomingValue, context, firstStorageKey_1 ? [firstStorageKey_1, storeFieldName] : void 0);
if (appliedValue !== incomingValue) {
newFields_1 = newFields_1 || Object.create(null);
newFields_1[storeFieldName] = appliedValue;
}
});
if (newFields_1) {
return __assign(__assign({}, i_1), newFields_1);
}
}

@@ -289,4 +307,4 @@ return incoming;

if (typesDiffer ||
!canBeMerged(existing) ||
!canBeMerged(applied)) {
!storeValueIsStoreObject(existing) ||
!storeValueIsStoreObject(applied)) {
return applied;

@@ -300,13 +318,5 @@ }

}
function canBeMerged(obj) {
return !!(obj &&
typeof obj === "object" &&
!isReference(obj) &&
!Array.isArray(obj));
}
function keyArgsFnFromSpecifier(specifier) {
return function (args, context) {
var field = context.field;
var fieldName = field.name.value;
return args ? fieldName + ":" + JSON.stringify(computeKeyObject(args, specifier)) : fieldName;
return args ? context.fieldName + ":" + JSON.stringify(computeKeyObject(args, specifier)) : context.fieldName;
};

@@ -313,0 +323,0 @@ }

@@ -54,5 +54,2 @@ import { DocumentNode, FieldNode, ASTNode } from 'graphql';

getCacheKey(obj: StoreObject): string | undefined;
} | {
cache: ApolloCache<TCacheShape>;
getCacheKey(obj: StoreObject): string | undefined;
};

@@ -59,0 +56,0 @@ addExportedVariables(document: DocumentNode, variables?: OperationVariables, context?: {}): Promise<{

@@ -182,3 +182,3 @@ import { __awaiter, __generator, __assign } from 'tslib';

fragment = fragmentMap[selection.name.value];
process.env.NODE_ENV === "production" ? invariant(fragment, 14) : invariant(fragment, "No fragment named " + selection.name.value);
process.env.NODE_ENV === "production" ? invariant(fragment, 22) : invariant(fragment, "No fragment named " + selection.name.value);
}

@@ -185,0 +185,0 @@ if (fragment && fragment.typeCondition) {

@@ -26,3 +26,2 @@ /// <reference types="zen-observable" />

readonly queryName?: string;
readonly watching: boolean;
get variables(): TVariables | undefined;

@@ -36,6 +35,5 @@ private isTornDown;

private lastError;
constructor({ queryManager, options, shouldSubscribe, }: {
constructor({ queryManager, options, }: {
queryManager: QueryManager<any>;
options: WatchQueryOptions<TVariables>;
shouldSubscribe?: boolean;
});

@@ -42,0 +40,0 @@ result(): Promise<ApolloQueryResult<TData>>;

@@ -23,3 +23,3 @@ import { __extends, __assign } from 'tslib';

function ObservableQuery(_a) {
var queryManager = _a.queryManager, options = _a.options, _b = _a.shouldSubscribe, shouldSubscribe = _b === void 0 ? true : _b;
var queryManager = _a.queryManager, options = _a.options;
var _this = _super.call(this, function (observer) {

@@ -45,3 +45,2 @@ return _this.onSubscribe(observer);

_this.queryId = queryManager.generateQueryId();
_this.watching = shouldSubscribe;
var opDef = getOperationDefinition(options.query);

@@ -48,0 +47,0 @@ _this.queryName = opDef && opDef.name && opDef.name.value;

@@ -50,6 +50,5 @@ import { equal } from '@wry/equality';

QueryInfo.prototype.setDiff = function (diff) {
var _a, _b;
var oldDiff = this.diff;
this.diff = diff;
if (!this.dirty && ((_a = diff) === null || _a === void 0 ? void 0 : _a.result) !== ((_b = oldDiff) === null || _b === void 0 ? void 0 : _b.result)) {
if (!this.dirty && (diff === null || diff === void 0 ? void 0 : diff.result) !== (oldDiff === null || oldDiff === void 0 ? void 0 : oldDiff.result)) {
this.setDirty();

@@ -56,0 +55,0 @@ }

@@ -26,3 +26,2 @@ /// <reference types="zen-observable" />

private queries;
private queryCancelFns;
private fetchCancelFns;

@@ -55,4 +54,4 @@ constructor({ cache, link, queryDeduplication, onBroadcast, ssrMode, clientAwareness, localState, assumeImmutableResults, }: {

private getVariables;
watchQuery<T, TVariables = OperationVariables>(options: WatchQueryOptions<TVariables>, shouldSubscribe?: boolean): ObservableQuery<T, TVariables>;
query<T>(options: QueryOptions): Promise<ApolloQueryResult<T>>;
watchQuery<T, TVariables = OperationVariables>(options: WatchQueryOptions<TVariables>): ObservableQuery<T, TVariables>;
query<TData, TVars = OperationVariables>(options: QueryOptions<TVars>): Promise<ApolloQueryResult<TData>>;
private queryIdCounter;

@@ -59,0 +58,0 @@ generateQueryId(): string;

@@ -29,3 +29,2 @@ import { __awaiter, __generator, __assign } from 'tslib';

this.queries = new Map();
this.queryCancelFns = new Map();
this.fetchCancelFns = new Map();

@@ -51,8 +50,6 @@ this.transformCache = new (canUseWeakMap ? WeakMap : Map)();

});
this.cancelPendingFetches(process.env.NODE_ENV === "production" ? new InvariantError(15) : new InvariantError('QueryManager stopped while query was in flight'));
this.cancelPendingFetches(process.env.NODE_ENV === "production" ? new InvariantError(14) : new InvariantError('QueryManager stopped while query was in flight'));
};
QueryManager.prototype.cancelPendingFetches = function (error) {
this.queryCancelFns.forEach(function (cancel) { return cancel(error); });
this.fetchCancelFns.forEach(function (cancel) { return cancel(error); });
this.queryCancelFns.clear();
this.fetchCancelFns.clear();

@@ -68,4 +65,4 @@ };

case 0:
process.env.NODE_ENV === "production" ? invariant(mutation, 16) : invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.');
process.env.NODE_ENV === "production" ? invariant(!fetchPolicy || fetchPolicy === 'no-cache', 17) : invariant(!fetchPolicy || fetchPolicy === 'no-cache', "Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior.");
process.env.NODE_ENV === "production" ? invariant(mutation, 15) : invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.');
process.env.NODE_ENV === "production" ? invariant(!fetchPolicy || fetchPolicy === 'no-cache', 16) : invariant(!fetchPolicy || fetchPolicy === 'no-cache', "Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior.");
mutationId = this.generateMutationId();

@@ -85,4 +82,3 @@ mutation = this.transform(mutation).document;

var observableQuery = _a.observableQuery;
if (observableQuery &&
observableQuery.watching) {
if (observableQuery) {
var queryName = observableQuery.queryName;

@@ -183,3 +179,2 @@ if (queryName &&

if (observableQuery &&
observableQuery.watching &&
observableQuery.queryName === refetchQuery) {

@@ -266,4 +261,3 @@ refetchQueryPromises.push(observableQuery.refetch());

};
QueryManager.prototype.watchQuery = function (options, shouldSubscribe) {
if (shouldSubscribe === void 0) { shouldSubscribe = true; }
QueryManager.prototype.watchQuery = function (options) {
options = __assign(__assign({}, options), { variables: this.getVariables(options.query, options.variables) });

@@ -276,3 +270,2 @@ if (typeof options.notifyOnNetworkStatusChange === 'undefined') {

options: options,
shouldSubscribe: shouldSubscribe,
});

@@ -288,16 +281,9 @@ this.getQuery(observable.queryId).init({

var _this = this;
process.env.NODE_ENV === "production" ? invariant(options.query, 18) : invariant(options.query, 'query option is required. You must specify your GraphQL document ' +
process.env.NODE_ENV === "production" ? invariant(options.query, 17) : invariant(options.query, 'query option is required. You must specify your GraphQL document ' +
'in the query option.');
process.env.NODE_ENV === "production" ? invariant(options.query.kind === 'Document', 19) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.');
process.env.NODE_ENV === "production" ? invariant(!options.returnPartialData, 20) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.');
process.env.NODE_ENV === "production" ? invariant(!options.pollInterval, 21) : invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.');
return new Promise(function (resolve, reject) {
var watchedQuery = _this.watchQuery(options, false);
var queryId = watchedQuery.queryId;
_this.queryCancelFns.set(queryId, reject);
watchedQuery
.result()
.then(resolve, reject)
.then(function () { return _this.queryCancelFns.delete(queryId); });
});
process.env.NODE_ENV === "production" ? invariant(options.query.kind === 'Document', 18) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.');
process.env.NODE_ENV === "production" ? invariant(!options.returnPartialData, 19) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.');
process.env.NODE_ENV === "production" ? invariant(!options.pollInterval, 20) : invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.');
var queryId = this.generateQueryId();
return this.fetchQuery(queryId, options).finally(function () { return _this.stopQuery(queryId); });
};

@@ -326,6 +312,5 @@ QueryManager.prototype.generateQueryId = function () {

QueryManager.prototype.clearStore = function () {
this.cancelPendingFetches(process.env.NODE_ENV === "production" ? new InvariantError(22) : new InvariantError('Store reset while query was in flight (not completed in link chain)'));
this.cancelPendingFetches(process.env.NODE_ENV === "production" ? new InvariantError(21) : new InvariantError('Store reset while query was in flight (not completed in link chain)'));
this.queries.forEach(function (queryInfo) {
if (queryInfo.observableQuery &&
queryInfo.observableQuery.watching) {
if (queryInfo.observableQuery) {
queryInfo.networkStatus = NetworkStatus.loading;

@@ -352,4 +337,3 @@ }

var observableQuery = _a.observableQuery;
if (observableQuery &&
observableQuery.watching) {
if (observableQuery) {
var fetchPolicy = observableQuery.options.fetchPolicy;

@@ -415,3 +399,2 @@ observableQuery.resetLastResults();

QueryManager.prototype.removeQuery = function (queryId) {
this.queryCancelFns.delete(queryId);
this.fetchCancelFns.delete(queryId);

@@ -552,8 +535,8 @@ this.getQuery(queryId).subscriptions.forEach(function (x) { return x.unsubscribe(); });

};
this.fetchCancelFns.set(queryId, function (reason) {
Promise.resolve().then(function () { return concast.cancel(reason); });
});
var concast = new Concast(this.transform(normalized.query).hasClientExports
? this.localState.addExportedVariables(normalized.query, normalized.variables, normalized.context).then(fromVariables)
: fromVariables(normalized.variables));
this.fetchCancelFns.set(queryId, function (reason) {
Promise.resolve().then(function () { return concast.cancel(reason); });
});
concast.cleanup(function () { return _this.fetchCancelFns.delete(queryId); });

@@ -690,3 +673,3 @@ return concast;

}), currentQueryResult = _c.result, complete = _c.complete;
if (complete) {
if (complete && currentQueryResult) {
var nextQueryResult = tryFunctionOrLogError(function () { return updater(currentQueryResult, {

@@ -693,0 +676,0 @@ mutationResult: mutation.result,

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

context?: any;
fetchPolicy?: FetchPolicy;
fetchPolicy?: Extract<FetchPolicy, 'no-cache'>;
}

@@ -69,0 +69,0 @@ export declare type MutationUpdaterFn<T = {

@@ -88,3 +88,3 @@ import { __extends } from 'tslib';

ApolloLink.prototype.request = function (operation, forward) {
throw process.env.NODE_ENV === "production" ? new InvariantError(4) : new InvariantError('request is not implemented');
throw process.env.NODE_ENV === "production" ? new InvariantError(11) : new InvariantError('request is not implemented');
};

@@ -91,0 +91,0 @@ ApolloLink.prototype.onError = function (reason) {

@@ -8,3 +8,3 @@ import { InvariantError } from 'ts-invariant';

library = 'node-fetch';
throw process.env.NODE_ENV === "production" ? new InvariantError(5) : new InvariantError('"fetch" has not been found globally and no fetcher has been ' +
throw process.env.NODE_ENV === "production" ? new InvariantError(13) : new InvariantError('"fetch" has not been found globally and no fetcher has been ' +
'configured. To fix this, install a fetch package ' +

@@ -11,0 +11,0 @@ ("(like https://www.npmjs.com/package/" + library + "), instantiate the ") +

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

catch (e) {
var parseError = process.env.NODE_ENV === "production" ? new InvariantError(6) : new InvariantError("Network request failed. " + label + " is not serializable: " + e.message);
var parseError = process.env.NODE_ENV === "production" ? new InvariantError(12) : new InvariantError("Network request failed. " + label + " is not serializable: " + e.message);
parseError.parseError = e;

@@ -12,0 +12,0 @@ throw parseError;

{
"name": "@apollo/client",
"version": "3.0.0-beta.46",
"version": "3.0.0-beta.47",
"description": "A fully-featured caching GraphQL client.",

@@ -63,3 +63,2 @@ "private": false,

"bundlesize": "0.18.0",
"codecov": "3.6.5",
"fetch-mock": "7.7.3",

@@ -70,2 +69,3 @@ "graphql": "14.6.0",

"lodash": "4.17.15",
"node-fetch": "2.6.0",
"prop-types": "15.7.2",

@@ -83,3 +83,3 @@ "react": "^16.13.1",

"tsc-watch": "3.0.1",
"typescript": "3.7.4"
"typescript": "3.8.3"
},

@@ -86,0 +86,0 @@ "publishConfig": {

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

return React.createElement(ApolloContext.Consumer, null, function (context) {
process.env.NODE_ENV === "production" ? invariant(context && context.client, 9) : invariant(context && context.client, 'Could not find "client" in the context of ApolloConsumer. ' +
process.env.NODE_ENV === "production" ? invariant(context && context.client, 5) : invariant(context && context.client, 'Could not find "client" in the context of ApolloConsumer. ' +
'Wrap the root component in an <ApolloProvider>.');

@@ -12,0 +12,0 @@ return props.children(context.client);

@@ -14,3 +14,3 @@ import { invariant } from 'ts-invariant';

}
process.env.NODE_ENV === "production" ? invariant(context.client, 7) : invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
process.env.NODE_ENV === "production" ? invariant(context.client, 4) : invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
'sure you pass in your client via the "client" prop.');

@@ -17,0 +17,0 @@ return (React.createElement(ApolloContext.Provider, { value: context }, children));

@@ -8,3 +8,3 @@ import { invariant } from 'ts-invariant';

var client = React.useContext(getApolloContext()).client;
process.env.NODE_ENV === "production" ? invariant(client, 8) : invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +
process.env.NODE_ENV === "production" ? invariant(client, 6) : invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +
'have called `ApolloProvider` higher up in your tree.');

@@ -11,0 +11,0 @@ return client;

@@ -30,3 +30,3 @@ import { invariant } from 'ts-invariant';

var variables, type, name;
process.env.NODE_ENV === "production" ? invariant(!!document && !!document.kind, 10) : invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " +
process.env.NODE_ENV === "production" ? invariant(!!document && !!document.kind, 7) : invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " +
"DocumentNode. You may need to use 'graphql-tag' or another method " +

@@ -45,6 +45,6 @@ "to convert your operation into a document");

process.env.NODE_ENV === "production" ? invariant(!fragments.length ||
(queries.length || mutations.length || subscriptions.length), 11) : invariant(!fragments.length ||
(queries.length || mutations.length || subscriptions.length), 8) : invariant(!fragments.length ||
(queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " +
"You must include a query, subscription or mutation as well");
process.env.NODE_ENV === "production" ? invariant(queries.length + mutations.length + subscriptions.length <= 1, 12) : invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " +
process.env.NODE_ENV === "production" ? invariant(queries.length + mutations.length + subscriptions.length <= 1, 9) : invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " +
(document + " had " + queries.length + " queries, " + subscriptions.length + " ") +

@@ -61,3 +61,3 @@ ("subscriptions and " + mutations.length + " mutations. ") +

: subscriptions;
process.env.NODE_ENV === "production" ? invariant(definitions.length === 1, 13) : invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " +
process.env.NODE_ENV === "production" ? invariant(definitions.length === 1, 10) : invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " +
(definitions.length + " definitions. ") +

@@ -64,0 +64,0 @@ "You can use 'compose' to join multiple operation types to a component");

@@ -96,3 +96,3 @@ /// <reference types="zen-observable" />

onError?: (error: ApolloError) => void;
fetchPolicy?: WatchQueryFetchPolicy;
fetchPolicy?: Extract<WatchQueryFetchPolicy, 'no-cache'>;
ignoreResults?: boolean;

@@ -99,0 +99,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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

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

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

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 too big to display

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