You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@apollo/client

Package Overview
Dependencies
Maintainers
1
Versions
559
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0-beta.37 to 3.0.0-beta.38

18

ApolloClient.js

@@ -20,14 +20,10 @@ import { __assign } from 'tslib';

if (!link) {
if (uri) {
link = new HttpLink({ uri: uri, credentials: credentials, headers: headers });
}
else if (resolvers) {
link = ApolloLink.empty();
}
link = uri
? new HttpLink({ uri: uri, credentials: credentials, headers: headers })
: ApolloLink.empty();
}
if (!link || !cache) {
throw process.env.NODE_ENV === "production" ? new InvariantError(1) : new InvariantError("To initialize Apollo Client, you must specify 'uri' or 'link' and " +
"'cache' properties in the options object. \n" +
"For more information, please visit: " +
"https://www.apollographql.com/docs/react/");
if (!cache) {
throw process.env.NODE_ENV === "production" ? new InvariantError(1) : new InvariantError("To initialize Apollo Client, you must specify a 'cache' property " +
"in the options object. \n" +
"For more information, please visit: https://go.apollo.dev/c/docs");
}

@@ -34,0 +30,0 @@ this.link = link;

@@ -66,6 +66,2 @@ import { __awaiter, __generator, __assign } from 'tslib';

}
process.env.NODE_ENV === "production" || invariant.warn('Found @client directives in a query but no ApolloClient resolvers ' +
'were specified. This means ApolloClient local resolver handling ' +
'has been disabled, and @client directives will be passed through ' +
'to your link chain.');
}

@@ -75,3 +71,3 @@ return null;

LocalState.prototype.serverQuery = function (document) {
return this.resolvers ? removeClientSetsFromDocument(document) : document;
return removeClientSetsFromDocument(document);
};

@@ -188,3 +184,3 @@ LocalState.prototype.prepareContext = function (context) {

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

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

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

};
var _b = queryManager.transform(this.options.query), hasClientExports = _b.hasClientExports, serverQuery = _b.serverQuery;
var hasClientExports = queryManager.transform(this.options.query).hasClientExports;
queryManager.observeQuery(queryId, this.options, {

@@ -325,3 +325,2 @@ next: function (result) {

fetchPolicy_1 !== 'cache-only' &&
serverQuery &&
!equal(previousVariables, variables)) {

@@ -328,0 +327,0 @@ _this.setVariables(variables).then(function (updatedResult) {

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

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

@@ -61,4 +61,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, 26) : 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', 27) : 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', 18) : invariant(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"');
process.env.NODE_ENV === "production" ? invariant(options.fetchPolicy !== 'standby', 28) : 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, 19) : invariant(options.query, 'query option is required. You must specify your GraphQL document ' +
process.env.NODE_ENV === "production" ? invariant(options.query, 29) : 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', 20) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.');
process.env.NODE_ENV === "production" ? invariant(!options.returnPartialData, 21) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.');
process.env.NODE_ENV === "production" ? invariant(!options.pollInterval, 22) : invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.');
process.env.NODE_ENV === "production" ? invariant(options.query.kind === 'Document', 30) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.');
process.env.NODE_ENV === "production" ? invariant(!options.returnPartialData, 31) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.');
process.env.NODE_ENV === "production" ? invariant(!options.pollInterval, 32) : 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(23) : new InvariantError('Store reset while query was in flight (not completed in link chain)'));
reject(process.env.NODE_ENV === "production" ? new InvariantError(33) : 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, 24) : invariant(foundObservableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable);
process.env.NODE_ENV === "production" ? invariant(foundObservableQuery, 34) : 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, 25) : invariant(pollInterval, 'Attempted to start a polling query without a polling interval.');
process.env.NODE_ENV === "production" ? invariant(pollInterval, 35) : 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), 41) : invariant(!previousQuery ||
equal(previousQuery.document, query.document), 48) : 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(12) : new InvariantError('request is not implemented');
throw process.env.NODE_ENV === "production" ? new InvariantError(5) : 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(14) : new InvariantError('"fetch" has not been found globally and no fetcher has been ' +
throw process.env.NODE_ENV === "production" ? new InvariantError(7) : 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(13) : new InvariantError("Network request failed. " + label + " is not serializable: " + e.message);
var parseError = process.env.NODE_ENV === "production" ? new InvariantError(6) : 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(35) : new InvariantError("illegal argument: " + key);
throw process.env.NODE_ENV === "production" ? new InvariantError(16) : new InvariantError("illegal argument: " + key);
}

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

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

@@ -54,3 +54,3 @@ "private": false,

"devDependencies": {
"@testing-library/react": "9.1.4",
"@testing-library/react": "9.4.1",
"@types/fast-json-stable-stringify": "2.0.0",

@@ -72,5 +72,5 @@ "@types/jest": "24.0.25",

"react-dom": "16.12.0",
"recast": "0.18.5",
"recast": "0.18.7",
"rimraf": "3.0.2",
"rollup": "1.29.1",
"rollup": "1.31.1",
"rollup-plugin-invariant": "0.5.6",

@@ -77,0 +77,0 @@ "rollup-plugin-node-resolve": "5.2.0",

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

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

evaledValue = variables && variables[ifArgument.value.name.value];
process.env.NODE_ENV === "production" ? invariant(evaledValue !== void 0, 42) : invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive.");
process.env.NODE_ENV === "production" ? invariant(evaledValue !== void 0, 44) : invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive.");
}

@@ -52,8 +52,8 @@ else {

var directiveName = directive.name.value;
process.env.NODE_ENV === "production" ? invariant(directiveArguments && directiveArguments.length === 1, 43) : invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive.");
process.env.NODE_ENV === "production" ? invariant(directiveArguments && directiveArguments.length === 1, 45) : invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive.");
var ifArgument = directiveArguments[0];
process.env.NODE_ENV === "production" ? invariant(ifArgument.name && ifArgument.name.value === 'if', 44) : invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive.");
process.env.NODE_ENV === "production" ? invariant(ifArgument.name && ifArgument.name.value === 'if', 46) : invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive.");
var ifValue = ifArgument.value;
process.env.NODE_ENV === "production" ? invariant(ifValue &&
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 45) : invariant(ifValue &&
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 47) : invariant(ifValue &&
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value.");

@@ -60,0 +60,0 @@ result.push({ directive: directive, ifArgument: ifArgument });

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

if (definition.kind === 'OperationDefinition') {
throw process.env.NODE_ENV === "production" ? new InvariantError(46) : new InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " +
throw process.env.NODE_ENV === "production" ? new InvariantError(41) : new InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " +
'No operations are allowed when using a fragment as a query. Only fragments are allowed.');

@@ -18,3 +18,3 @@ }

if (typeof actualFragmentName === 'undefined') {
process.env.NODE_ENV === "production" ? invariant(fragments.length === 1, 47) : invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.");
process.env.NODE_ENV === "production" ? invariant(fragments.length === 1, 42) : invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.");
actualFragmentName = fragments[0].name.value;

@@ -56,3 +56,3 @@ }

var fragment = fragmentMap && fragmentMap[selection.name.value];
process.env.NODE_ENV === "production" ? invariant(fragment, 48) : invariant(fragment, "No fragment named " + selection.name.value + ".");
process.env.NODE_ENV === "production" ? invariant(fragment, 43) : invariant(fragment, "No fragment named " + selection.name.value + ".");
return fragment;

@@ -59,0 +59,0 @@ }

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

function checkDocument(doc) {
process.env.NODE_ENV === "production" ? invariant(doc && doc.kind === 'Document', 27) : 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', 17) : 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

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

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

@@ -35,10 +35,10 @@ }

var queryDef = getOperationDefinition(doc);
process.env.NODE_ENV === "production" ? invariant(queryDef && queryDef.operation === 'query', 30) : invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.');
process.env.NODE_ENV === "production" ? invariant(queryDef && queryDef.operation === 'query', 20) : invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.');
return queryDef;
}
function getFragmentDefinition(doc) {
process.env.NODE_ENV === "production" ? invariant(doc.kind === 'Document', 31) : 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, 32) : invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.');
process.env.NODE_ENV === "production" ? invariant(doc.kind === 'Document', 21) : 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, 22) : 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', 33) : invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.');
process.env.NODE_ENV === "production" ? invariant(fragmentDef.kind === 'FragmentDefinition', 23) : invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.');
return fragmentDef;

@@ -66,3 +66,3 @@ }

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

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

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

evaledValue = variables && variables[ifArgument.value.name.value];
process.env.NODE_ENV === "production" ? tsInvariant.invariant(evaledValue !== void 0, 42) : tsInvariant.invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive.");
process.env.NODE_ENV === "production" ? tsInvariant.invariant(evaledValue !== void 0, 44) : tsInvariant.invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive.");
}

@@ -60,8 +60,8 @@ else {

var directiveName = directive.name.value;
process.env.NODE_ENV === "production" ? tsInvariant.invariant(directiveArguments && directiveArguments.length === 1, 43) : tsInvariant.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive.");
process.env.NODE_ENV === "production" ? tsInvariant.invariant(directiveArguments && directiveArguments.length === 1, 45) : tsInvariant.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive.");
var ifArgument = directiveArguments[0];
process.env.NODE_ENV === "production" ? tsInvariant.invariant(ifArgument.name && ifArgument.name.value === 'if', 44) : tsInvariant.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive.");
process.env.NODE_ENV === "production" ? tsInvariant.invariant(ifArgument.name && ifArgument.name.value === 'if', 46) : tsInvariant.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive.");
var ifValue = ifArgument.value;
process.env.NODE_ENV === "production" ? tsInvariant.invariant(ifValue &&
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 45) : tsInvariant.invariant(ifValue &&
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 47) : tsInvariant.invariant(ifValue &&
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value.");

@@ -79,3 +79,3 @@ result.push({ directive: directive, ifArgument: ifArgument });

if (definition.kind === 'OperationDefinition') {
throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(46) : new tsInvariant.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " +
throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(41) : new tsInvariant.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " +
'No operations are allowed when using a fragment as a query. Only fragments are allowed.');

@@ -88,3 +88,3 @@ }

if (typeof actualFragmentName === 'undefined') {
process.env.NODE_ENV === "production" ? tsInvariant.invariant(fragments.length === 1, 47) : tsInvariant.invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.");
process.env.NODE_ENV === "production" ? tsInvariant.invariant(fragments.length === 1, 42) : tsInvariant.invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.");
actualFragmentName = fragments[0].name.value;

@@ -126,3 +126,3 @@ }

var fragment = fragmentMap && fragmentMap[selection.name.value];
process.env.NODE_ENV === "production" ? tsInvariant.invariant(fragment, 48) : tsInvariant.invariant(fragment, "No fragment named " + selection.name.value + ".");
process.env.NODE_ENV === "production" ? tsInvariant.invariant(fragment, 43) : tsInvariant.invariant(fragment, "No fragment named " + selection.name.value + ".");
return fragment;

@@ -318,3 +318,3 @@ }

function checkDocument(doc) {
process.env.NODE_ENV === "production" ? tsInvariant.invariant(doc && doc.kind === 'Document', 27) : 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', 17) : 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

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

if (definition.kind !== 'OperationDefinition') {
throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(28) : new tsInvariant.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"");
throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(18) : 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, 29) : tsInvariant.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations");
process.env.NODE_ENV === "production" ? tsInvariant.invariant(operations.length <= 1, 19) : tsInvariant.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations");
return doc;

@@ -348,10 +348,10 @@ }

var queryDef = getOperationDefinition(doc);
process.env.NODE_ENV === "production" ? tsInvariant.invariant(queryDef && queryDef.operation === 'query', 30) : tsInvariant.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.');
process.env.NODE_ENV === "production" ? tsInvariant.invariant(queryDef && queryDef.operation === 'query', 20) : 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', 31) : 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, 32) : tsInvariant.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.');
process.env.NODE_ENV === "production" ? tsInvariant.invariant(doc.kind === 'Document', 21) : 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, 22) : 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', 33) : tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.');
process.env.NODE_ENV === "production" ? tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 23) : tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.');
return fragmentDef;

@@ -379,3 +379,3 @@ }

}
throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(34) : 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(24) : new tsInvariant.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.');
}

@@ -382,0 +382,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 too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc