Socket
Socket
Sign inDemoInstall

@apollo/client

Package Overview
Dependencies
Maintainers
1
Versions
574
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.30 to 3.0.0-beta.31

2

cache/inmemory/entityStore.js

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

}
process.env.NODE_ENV === "production" ? invariant(!isReference(existing) || isReference(incoming), 55) : invariant(!isReference(existing) || isReference(incoming), "Store error: the application attempted to write an object with no provided id but the store already contains an id of " + existing.__ref + " for this object.");
process.env.NODE_ENV === "production" ? invariant(!isReference(existing) || isReference(incoming), 51) : invariant(!isReference(existing) || isReference(incoming), "Store error: the application attempted to write an object with no provided id but the store already contains an id of " + existing.__ref + " for this object.");
if (equal(existing, incoming)) {

@@ -288,0 +288,0 @@ return existing;

@@ -42,5 +42,5 @@ import './fixPolyfills';

private maybeBroadcastWatch;
makeLocalVar<T>(value: T): LocalVar<T>;
makeLocalVar<T>(value?: T): LocalVar<T>;
}
export declare type LocalVar<T> = (newValue?: T) => T;
//# sourceMappingURL=inMemoryCache.d.ts.map

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

storage: StorageType;
invalidate(): void;
}

@@ -78,3 +77,2 @@ export declare type FieldReadFunction<TExisting, TReadResult = TExisting> = (existing: Readonly<TExisting> | undefined, options: FieldFunctionOptions) => TReadResult;

private storageTrie;
private fieldDep;
readField<V = StoreValue>(objectOrReference: StoreObject | Reference, nameOrField: string | FieldNode, getFieldValue: FieldValueGetter, variables?: Record<string, any>, typename?: string): Readonly<V>;

@@ -81,0 +79,0 @@ hasMergeFunction(typename: string, fieldName: string): boolean;

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

import { canUseWeakMap } from '../../utilities/common/canUse.js';
import { KeyTrie, dep } from 'optimism';
import { KeyTrie } from 'optimism';
import { maybeDeepFreeze } from '../../utilities/common/maybeDeepFreeze.js';

@@ -42,3 +42,2 @@ import { fieldNameFromStoreName, isFieldValueToBeMerged } from './helpers.js';

this.storageTrie = new KeyTrie(true);
this.fieldDep = dep();
this.config = __assign({ dataIdFromObject: defaultDataIdFromObject }, config);

@@ -134,4 +133,5 @@ if (config.possibleTypes) {

Policies.prototype.getTypePolicy = function (typename, createIfMissing) {
var typePolicies = this.typePolicies;
return typePolicies[typename] || (createIfMissing && (typePolicies[typename] = Object.create(null)));
if (typename) {
return this.typePolicies[typename] || (createIfMissing && (this.typePolicies[typename] = Object.create(null)));
}
};

@@ -194,6 +194,3 @@ Policies.prototype.getSubtypeSet = function (supertype, createIfMissing) {

}
if (process.env.NODE_ENV !== "production") {
maybeDeepFreeze(fieldValue);
}
return fieldValue;
return maybeDeepFreeze(fieldValue);
};

@@ -233,23 +230,6 @@ };

if (read) {
var storage_1 = policies.storageTrie.lookup(isReference(objectOrReference)
var storage = policies.storageTrie.lookup(isReference(objectOrReference)
? objectOrReference.__ref
: objectOrReference, storeFieldName);
policies.fieldDep(storage_1);
return read(existing, {
args: typeof nameOrField === "string" ? null :
argumentsObjectFromField(nameOrField, variables),
field: typeof nameOrField === "string" ? null : nameOrField,
fieldName: fieldName,
variables: variables,
policies: policies,
isReference: isReference,
toReference: policies.toReference,
storage: storage_1,
readField: function (nameOrField, foreignObjOrRef) {
return policies.readField(foreignObjOrRef || objectOrReference, nameOrField, getFieldValue, variables);
},
invalidate: function () {
policies.fieldDep.dirty(storage_1);
},
});
return read(existing, makeFieldFunctionOptions(policies, typename, objectOrReference, nameOrField, storage, getFieldValue, variables));
}

@@ -267,34 +247,15 @@ return existing;

var fieldName = field.name.value;
var policy = policies.getFieldPolicy(incoming.__typename, fieldName, false);
var applied = policies.applyMerges(existing, incoming.__value, getFieldValue, variables, storageKeys);
var merge = policy && policy.merge;
if (merge) {
if (process.env.NODE_ENV !== "production") {
maybeDeepFreeze(existing);
}
var storage_2 = storageKeys
? policies.storageTrie.lookupArray(storageKeys)
: null;
return merge(existing, applied, {
args: argumentsObjectFromField(field, variables),
field: field,
fieldName: fieldName,
variables: variables,
policies: policies,
isReference: isReference,
toReference: policies.toReference,
readField: function (nameOrField, foreignObjOrRef) {
return policies.readField(foreignObjOrRef, nameOrField, getFieldValue, variables);
},
storage: storage_2,
invalidate: function () {
if (storage_2) {
policies.fieldDep.dirty(storage_2);
}
},
});
}
return applied;
var merge = policies.getFieldPolicy(incoming.__typename, fieldName, false).merge;
var storage = storageKeys
? policies.storageTrie.lookupArray(storageKeys)
: null;
incoming = merge(existing, incoming.__value, makeFieldFunctionOptions(policies, incoming.__typename, null, field, storage, getFieldValue, variables));
}
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, getFieldValue, variables); });
}
var e_1 = existing;

@@ -313,2 +274,21 @@ var i_1 = incoming;

}());
function makeFieldFunctionOptions(policies, typename, objectOrReference, nameOrField, storage, getFieldValue, variables) {
var storeFieldName = typeof nameOrField === "string" ? nameOrField :
policies.getStoreFieldName(typename, nameOrField, variables);
var fieldName = fieldNameFromStoreName(storeFieldName);
return {
args: typeof nameOrField === "string" ? null :
argumentsObjectFromField(nameOrField, variables),
field: typeof nameOrField === "string" ? null : nameOrField,
fieldName: fieldName,
variables: variables,
policies: policies,
isReference: isReference,
toReference: policies.toReference,
storage: storage,
readField: function (nameOrField, foreignObjOrRef) {
return policies.readField(foreignObjOrRef || objectOrReference, nameOrField, getFieldValue, variables);
},
};
}
function keyArgsFnFromSpecifier(specifier) {

@@ -315,0 +295,0 @@ var topLevelArgNames = Object.create(null);

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

result: {},
missing: [process.env.NODE_ENV === "production" ? new InvariantError(51) : new InvariantError("Dangling reference to missing " + objectOrReference.__ref + " object")],
missing: [process.env.NODE_ENV === "production" ? new InvariantError(52) : new InvariantError("Dangling reference to missing " + objectOrReference.__ref + " object")],
};

@@ -108,3 +108,3 @@ }

if (!addTypenameToDocument.added(selection)) {
getMissing().push(process.env.NODE_ENV === "production" ? new InvariantError(52) : new InvariantError("Can't find field " + selection.name.value + " on " + (isReference(objectOrReference)
getMissing().push(process.env.NODE_ENV === "production" ? new InvariantError(53) : new InvariantError("Can't find field " + selection.name.value + " on " + (isReference(objectOrReference)
? objectOrReference.__ref + " object"

@@ -146,3 +146,3 @@ : "object " + JSON.stringify(objectOrReference, null, 2))));

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

@@ -210,3 +210,3 @@ if (policies.fragmentMatches(fragment, typename)) {

if (value && typeof value === "object") {
process.env.NODE_ENV === "production" ? invariant(!isReference(value), 54) : invariant(!isReference(value), "Missing selection set for object of type " + getTypenameFromStoreObject(store, value) + " returned for query field " + field.name.value);
process.env.NODE_ENV === "production" ? invariant(!isReference(value), 55) : invariant(!isReference(value), "Missing selection set for object of type " + getTypenameFromStoreObject(store, value) + " returned for query field " + field.name.value);
Object.values(value).forEach(workSet_1.add, workSet_1);

@@ -213,0 +213,0 @@ }

@@ -27,6 +27,6 @@ export { ApolloClient, ApolloClientOptions, DefaultOptions } from '../ApolloClient';

export { ServerError, throwServerError } from '../link/utils/throwServerError';
export { Observable } from '../utilities/observables/Observable';
export { Observable, Observer, ObservableSubscription } from '../utilities/observables/Observable';
import gql from 'graphql-tag';
declare const resetCaches: typeof gql.resetCaches, disableFragmentWarnings: typeof gql.disableFragmentWarnings, enableExperimentalFragmentVariables: typeof gql.enableExperimentalFragmentVariables, disableExperimentalFragmentVariables: typeof gql.disableExperimentalFragmentVariables;
export { gql, resetCaches, disableFragmentWarnings, enableExperimentalFragmentVariables, disableExperimentalFragmentVariables };
export declare const resetCaches: typeof gql.resetCaches, disableFragmentWarnings: typeof gql.disableFragmentWarnings, enableExperimentalFragmentVariables: typeof gql.enableExperimentalFragmentVariables, disableExperimentalFragmentVariables: typeof gql.disableExperimentalFragmentVariables;
export { gql };
//# sourceMappingURL=index.d.ts.map

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

if (fetchPolicy === 'cache-only') {
return Promise.reject(process.env.NODE_ENV === "production" ? new InvariantError(3) : new InvariantError('cache-only fetchPolicy option should not be used together with query refetch.'));
return Promise.reject(process.env.NODE_ENV === "production" ? new InvariantError(10) : new InvariantError('cache-only fetchPolicy option should not be used together with query refetch.'));
}

@@ -364,3 +364,3 @@ if (fetchPolicy !== 'no-cache' &&

var fetchPolicy = obsQuery.options.fetchPolicy;
process.env.NODE_ENV === "production" ? invariant(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 4) : invariant(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.');
process.env.NODE_ENV === "production" ? invariant(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 11) : invariant(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.');
}

@@ -367,0 +367,0 @@

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

import { Cache } from '../cache/core/types/Cache';
import { Observer, Subscription, Observable } from '../utilities/observables/Observable';
import { Observer, ObservableSubscription, Observable } from '../utilities/observables/Observable';
import { MutationStore } from '../data/mutations';

@@ -22,3 +22,3 @@ import { QueryStore } from '../data/queries';

observableQuery: ObservableQuery<any> | null;
subscriptions: Set<Subscription>;
subscriptions: Set<ObservableSubscription>;
cancel?: () => void;

@@ -25,0 +25,0 @@ }

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

this.fetchQueryRejectFns.forEach(function (reject) {
reject(process.env.NODE_ENV === "production" ? new InvariantError(17) : new InvariantError('QueryManager stopped while query was in flight'));
reject(process.env.NODE_ENV === "production" ? new InvariantError(26) : new InvariantError('QueryManager stopped while query was in flight'));
});

@@ -61,4 +61,4 @@ };

case 0:
process.env.NODE_ENV === "production" ? invariant(mutation, 18) : 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', 19) : 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, 27) : 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', 28) : 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.generateQueryId();

@@ -458,3 +458,3 @@ mutation = this.transform(mutation).document;

if (shouldSubscribe === void 0) { shouldSubscribe = true; }
process.env.NODE_ENV === "production" ? invariant(options.fetchPolicy !== 'standby', 20) : invariant(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"');
process.env.NODE_ENV === "production" ? invariant(options.fetchPolicy !== 'standby', 29) : invariant(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"');
options.variables = this.getVariables(options.query, options.variables);

@@ -484,7 +484,7 @@ if (typeof options.notifyOnNetworkStatusChange === 'undefined') {

var _this = this;
process.env.NODE_ENV === "production" ? invariant(options.query, 21) : invariant(options.query, 'query option is required. You must specify your GraphQL document ' +
process.env.NODE_ENV === "production" ? invariant(options.query, 30) : 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', 22) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.');
process.env.NODE_ENV === "production" ? invariant(!options.returnPartialData, 23) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.');
process.env.NODE_ENV === "production" ? invariant(!options.pollInterval, 24) : invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.');
process.env.NODE_ENV === "production" ? invariant(options.query.kind === 'Document', 31) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.');
process.env.NODE_ENV === "production" ? invariant(!options.returnPartialData, 32) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.');
process.env.NODE_ENV === "production" ? invariant(!options.pollInterval, 33) : invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.');
return new Promise(function (resolve, reject) {

@@ -557,3 +557,3 @@ var watchedQuery = _this.watchQuery(options, false);

this.fetchQueryRejectFns.forEach(function (reject) {
reject(process.env.NODE_ENV === "production" ? new InvariantError(25) : new InvariantError('Store reset while query was in flight (not completed in link chain)'));
reject(process.env.NODE_ENV === "production" ? new InvariantError(34) : new InvariantError('Store reset while query was in flight (not completed in link chain)'));
});

@@ -677,3 +677,3 @@ var resetIds = [];

var foundObservableQuery = this.getQuery(queryIdOrObservable).observableQuery;
process.env.NODE_ENV === "production" ? invariant(foundObservableQuery, 26) : invariant(foundObservableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable);
process.env.NODE_ENV === "production" ? invariant(foundObservableQuery, 35) : invariant(foundObservableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable);
observableQuery = foundObservableQuery;

@@ -867,3 +867,3 @@ }

var pollInterval = options.pollInterval;
process.env.NODE_ENV === "production" ? invariant(pollInterval, 27) : invariant(pollInterval, 'Attempted to start a polling query without a polling interval.');
process.env.NODE_ENV === "production" ? invariant(pollInterval, 36) : invariant(pollInterval, 'Attempted to start a polling query without a polling interval.');
if (!this.ssrMode) {

@@ -870,0 +870,0 @@ var info = this.pollingInfoByQueryId.get(queryId);

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

previousQuery.document === query.document ||
equal(previousQuery.document, query.document), 48) : invariant(!previousQuery ||
equal(previousQuery.document, query.document), 50) : invariant(!previousQuery ||
previousQuery.document === query.document ||

@@ -23,0 +23,0 @@ equal(previousQuery.document, query.document), 'Internal Error: may not update existing query string in store');

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

ApolloLink.prototype.request = function (operation, forward) {
throw process.env.NODE_ENV === "production" ? new InvariantError(5) : new InvariantError('request is not implemented');
throw process.env.NODE_ENV === "production" ? new InvariantError(12) : 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(7) : new InvariantError('"fetch" has not been found globally and no fetcher has been ' +
throw process.env.NODE_ENV === "production" ? new InvariantError(14) : 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(13) : new InvariantError("Network request failed. " + label + " is not serializable: " + e.message);
parseError.parseError = e;

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

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

if (OPERATION_FIELDS.indexOf(key) < 0) {
throw process.env.NODE_ENV === "production" ? new InvariantError(36) : new InvariantError("illegal argument: " + key);
throw process.env.NODE_ENV === "production" ? new InvariantError(17) : new InvariantError("illegal argument: " + key);
}

@@ -17,0 +17,0 @@ }

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

@@ -5,0 +5,0 @@ "private": false,

@@ -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, 4) : 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, 8) : invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
process.env.NODE_ENV === "production" ? invariant(context.client, 3) : 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));

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

(this.context && this.context.client);
process.env.NODE_ENV === "production" ? invariant(!!client, 49) : invariant(!!client, 'Could not find "client" in the context or passed in as an option. ' +
process.env.NODE_ENV === "production" ? invariant(!!client, 48) : invariant(!!client, 'Could not find "client" in the context or passed in as an option. ' +
'Wrap the root component in an <ApolloProvider>, or pass an ' +

@@ -49,3 +49,3 @@ 'ApolloClient instance in via options.');

var usedOperationName = operationName(operation.type);
process.env.NODE_ENV === "production" ? invariant(operation.type === type, 50) : invariant(operation.type === type, "Running a " + requiredOperationName + " requires a graphql " +
process.env.NODE_ENV === "production" ? invariant(operation.type === type, 49) : invariant(operation.type === type, "Running a " + requiredOperationName + " requires a graphql " +
(requiredOperationName + ", but a " + usedOperationName + " was used instead."));

@@ -52,0 +52,0 @@ };

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

var client = React.useContext(getApolloContext()).client;
process.env.NODE_ENV === "production" ? invariant(client, 10) : invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +
process.env.NODE_ENV === "production" ? invariant(client, 5) : 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, 11) : invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " +
process.env.NODE_ENV === "production" ? invariant(!!document && !!document.kind, 6) : 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), 12) : invariant(!fragments.length ||
(queries.length || mutations.length || subscriptions.length), 7) : 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, 13) : 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, 8) : 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, 14) : invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " +
process.env.NODE_ENV === "production" ? invariant(definitions.length === 1, 9) : 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");

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

export declare function maybeDeepFreeze(obj: any): any;
export declare function maybeDeepFreeze<T>(obj: T): T;
//# sourceMappingURL=maybeDeepFreeze.d.ts.map

@@ -21,3 +21,3 @@ import { isDevelopment, isTest } from './environment.js';

function maybeDeepFreeze(obj) {
if (isDevelopment() || isTest()) {
if (process.env.NODE_ENV !== "production" && (isDevelopment() || isTest())) {
deepFreeze(obj);

@@ -24,0 +24,0 @@ }

@@ -7,3 +7,3 @@ import { __spreadArrays } from 'tslib';

function checkDocument(doc) {
process.env.NODE_ENV === "production" ? invariant(doc && doc.kind === 'Document', 28) : invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql");
process.env.NODE_ENV === "production" ? invariant(doc && doc.kind === 'Document', 18) : invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql");
var operations = doc.definitions

@@ -13,7 +13,7 @@ .filter(function (d) { return d.kind !== 'FragmentDefinition'; })

if (definition.kind !== 'OperationDefinition') {
throw process.env.NODE_ENV === "production" ? new InvariantError(29) : new InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"");
throw process.env.NODE_ENV === "production" ? new InvariantError(19) : new InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"");
}
return definition;
});
process.env.NODE_ENV === "production" ? invariant(operations.length <= 1, 30) : invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations");
process.env.NODE_ENV === "production" ? invariant(operations.length <= 1, 20) : invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations");
return doc;

@@ -37,10 +37,10 @@ }

var queryDef = getOperationDefinition(doc);
process.env.NODE_ENV === "production" ? invariant(queryDef && queryDef.operation === 'query', 31) : invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.');
process.env.NODE_ENV === "production" ? invariant(queryDef && queryDef.operation === 'query', 21) : invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.');
return queryDef;
}
function getFragmentDefinition(doc) {
process.env.NODE_ENV === "production" ? invariant(doc.kind === 'Document', 32) : invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql");
process.env.NODE_ENV === "production" ? invariant(doc.definitions.length <= 1, 33) : invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.');
process.env.NODE_ENV === "production" ? invariant(doc.kind === 'Document', 22) : invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql");
process.env.NODE_ENV === "production" ? invariant(doc.definitions.length <= 1, 23) : invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.');
var fragmentDef = doc.definitions[0];
process.env.NODE_ENV === "production" ? invariant(fragmentDef.kind === 'FragmentDefinition', 34) : invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.');
process.env.NODE_ENV === "production" ? invariant(fragmentDef.kind === 'FragmentDefinition', 24) : invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.');
return fragmentDef;

@@ -68,3 +68,3 @@ }

}
throw process.env.NODE_ENV === "production" ? new InvariantError(35) : new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.');
throw process.env.NODE_ENV === "production" ? new InvariantError(25) : new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.');
}

@@ -71,0 +71,0 @@ function getDefaultValues(definition) {

import Observable from 'zen-observable';
import 'symbol-observable';
export declare type Subscription = ZenObservable.Subscription;
export declare type ObservableSubscription = ZenObservable.Subscription;
export declare type Observer<T> = ZenObservable.Observer<T>;

@@ -5,0 +5,0 @@ declare global {

import { ObservableQuery } from '../../core/ObservableQuery';
import { ApolloQueryResult } from '../../core/types';
import { Subscription } from '../../utilities/observables/Observable';
import { ObservableSubscription } from '../../utilities/observables/Observable';
export declare type Options = {

@@ -13,5 +13,5 @@ observable: ObservableQuery<any>;

promise: Promise<any[]>;
subscription: Subscription;
subscription: ObservableSubscription;
};
export default function (options: Options, ...cbs: ResultCallback[]): Promise<any[]>;
//# sourceMappingURL=observableToPromise.d.ts.map
import { ObservableQuery } from '../../core/ObservableQuery';
import { ApolloQueryResult } from '../../core/types';
import { Subscription } from '../../utilities/observables/Observable';
export default function subscribeAndCount(reject: (reason: any) => any, observable: ObservableQuery<any>, cb: (handleCount: number, result: ApolloQueryResult<any>) => any): Subscription;
import { ObservableSubscription } from '../../utilities/observables/Observable';
export default function subscribeAndCount(reject: (reason: any) => any, observable: ObservableQuery<any>, cb: (handleCount: number, result: ApolloQueryResult<any>) => any): ObservableSubscription;
//# sourceMappingURL=subscribeAndCount.d.ts.map

@@ -320,3 +320,3 @@ 'use strict';

function checkDocument(doc) {
process.env.NODE_ENV === "production" ? tsInvariant.invariant(doc && doc.kind === 'Document', 28) : tsInvariant.invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql");
process.env.NODE_ENV === "production" ? tsInvariant.invariant(doc && doc.kind === 'Document', 18) : tsInvariant.invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql");
var operations = doc.definitions

@@ -326,7 +326,7 @@ .filter(function (d) { return d.kind !== 'FragmentDefinition'; })

if (definition.kind !== 'OperationDefinition') {
throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(29) : new tsInvariant.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"");
throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(19) : new tsInvariant.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"");
}
return definition;
});
process.env.NODE_ENV === "production" ? tsInvariant.invariant(operations.length <= 1, 30) : tsInvariant.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations");
process.env.NODE_ENV === "production" ? tsInvariant.invariant(operations.length <= 1, 20) : tsInvariant.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations");
return doc;

@@ -350,10 +350,10 @@ }

var queryDef = getOperationDefinition(doc);
process.env.NODE_ENV === "production" ? tsInvariant.invariant(queryDef && queryDef.operation === 'query', 31) : tsInvariant.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.');
process.env.NODE_ENV === "production" ? tsInvariant.invariant(queryDef && queryDef.operation === 'query', 21) : tsInvariant.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.');
return queryDef;
}
function getFragmentDefinition(doc) {
process.env.NODE_ENV === "production" ? tsInvariant.invariant(doc.kind === 'Document', 32) : tsInvariant.invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql");
process.env.NODE_ENV === "production" ? tsInvariant.invariant(doc.definitions.length <= 1, 33) : tsInvariant.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.');
process.env.NODE_ENV === "production" ? tsInvariant.invariant(doc.kind === 'Document', 22) : tsInvariant.invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql");
process.env.NODE_ENV === "production" ? tsInvariant.invariant(doc.definitions.length <= 1, 23) : tsInvariant.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.');
var fragmentDef = doc.definitions[0];
process.env.NODE_ENV === "production" ? tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 34) : tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.');
process.env.NODE_ENV === "production" ? tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 24) : tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.');
return fragmentDef;

@@ -381,3 +381,3 @@ }

}
throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(35) : new tsInvariant.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.');
throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(25) : new tsInvariant.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.');
}

@@ -384,0 +384,0 @@ function getDefaultValues(definition) {

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 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

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