@apollo/client
Advanced tools
Comparing version 3.0.0-beta.0 to 3.0.0-beta.1
@@ -107,3 +107,3 @@ import { __assign } from 'tslib'; | ||
if (typename !== old) { | ||
process.env.NODE_ENV === "production" ? invariant(old === which, 16) : invariant(old === which, "Cannot change root " + which + " __typename more than once"); | ||
process.env.NODE_ENV === "production" ? invariant(old === which, 15) : invariant(old === which, "Cannot change root " + which + " __typename more than once"); | ||
this.rootTypenamesById[rootId] = typename; | ||
@@ -285,3 +285,3 @@ } | ||
var responseName = aliases && aliases[s] || s; | ||
process.env.NODE_ENV === "production" ? invariant(hasOwn.call(response, responseName), 17) : invariant(hasOwn.call(response, responseName), "Missing field " + responseName + " while computing key fields"); | ||
process.env.NODE_ENV === "production" ? invariant(hasOwn.call(response, responseName), 16) : invariant(hasOwn.call(response, responseName), "Missing field " + responseName + " while computing key fields"); | ||
keyObj[prevKey = s] = response[responseName]; | ||
@@ -288,0 +288,0 @@ } |
@@ -192,3 +192,3 @@ import { __assign } from 'tslib'; | ||
else if (isReference(existing)) { | ||
throw process.env.NODE_ENV === "production" ? new InvariantError(39) : new InvariantError("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."); | ||
throw process.env.NODE_ENV === "production" ? new InvariantError(35) : new InvariantError("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."); | ||
} | ||
@@ -195,0 +195,0 @@ if (Array.isArray(incoming)) { |
@@ -85,3 +85,3 @@ import { __awaiter, __generator, __assign } from 'tslib'; | ||
else { | ||
process.env.NODE_ENV === "production" ? invariant(false, 18) : invariant(false, 'To use context.getCacheKey, you need to use a cache that has ' + | ||
process.env.NODE_ENV === "production" ? invariant(false, 17) : invariant(false, 'To use context.getCacheKey, you need to use a cache that has ' + | ||
'a configurable dataIdFromObject, like apollo-cache-inmemory.'); | ||
@@ -194,3 +194,3 @@ } | ||
fragment = fragmentMap[selection.name.value]; | ||
process.env.NODE_ENV === "production" ? invariant(fragment, 19) : invariant(fragment, "No fragment named " + selection.name.value); | ||
process.env.NODE_ENV === "production" ? invariant(fragment, 18) : invariant(fragment, "No fragment named " + selection.name.value); | ||
} | ||
@@ -197,0 +197,0 @@ if (fragment && fragment.typeCondition) { |
@@ -20,3 +20,3 @@ /// <reference types="zen-observable" /> | ||
export interface FetchMoreOptions<TData = any, TVariables = OperationVariables> { | ||
updateQuery: (previousQueryResult: TData, options: { | ||
updateQuery?: (previousQueryResult: TData, options: { | ||
fetchMoreResult?: TData; | ||
@@ -23,0 +23,0 @@ variables?: TVariables; |
@@ -159,3 +159,2 @@ import { __extends, __assign } from 'tslib'; | ||
var _this = this; | ||
process.env.NODE_ENV === "production" ? invariant(fetchMoreOptions.updateQuery, 4) : invariant(fetchMoreOptions.updateQuery, 'updateQuery option is required. This function defines how to update the query data with the new results.'); | ||
var combinedOptions = __assign(__assign({}, (fetchMoreOptions.query ? fetchMoreOptions : __assign(__assign(__assign({}, this.options), fetchMoreOptions), { variables: __assign(__assign({}, this.variables), fetchMoreOptions.variables) }))), { fetchPolicy: 'network-only' }); | ||
@@ -167,6 +166,8 @@ var qid = this.queryManager.generateQueryId(); | ||
_this.updateQuery(function (previousResult) { | ||
return fetchMoreOptions.updateQuery(previousResult, { | ||
fetchMoreResult: fetchMoreResult.data, | ||
var data = fetchMoreResult.data; | ||
var updateQuery = fetchMoreOptions.updateQuery; | ||
return updateQuery ? updateQuery(previousResult, { | ||
fetchMoreResult: data, | ||
variables: combinedOptions.variables, | ||
}); | ||
}) : data; | ||
}); | ||
@@ -367,3 +368,3 @@ _this.queryManager.stopQuery(qid); | ||
var fetchPolicy = obsQuery.options.fetchPolicy; | ||
process.env.NODE_ENV === "production" ? invariant(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 5) : 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', 4) : invariant(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.'); | ||
} | ||
@@ -370,0 +371,0 @@ |
@@ -49,3 +49,3 @@ import { __awaiter, __generator, __assign } from 'tslib'; | ||
this.fetchQueryRejectFns.forEach(function (reject) { | ||
reject(process.env.NODE_ENV === "production" ? new InvariantError(40) : new InvariantError('QueryManager stopped while query was in flight')); | ||
reject(process.env.NODE_ENV === "production" ? new InvariantError(39) : new InvariantError('QueryManager stopped while query was in flight')); | ||
}); | ||
@@ -61,4 +61,4 @@ }; | ||
case 0: | ||
process.env.NODE_ENV === "production" ? invariant(mutation, 41) : 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', 42) : 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, 40) : 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', 41) : 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(); | ||
@@ -457,3 +457,3 @@ mutation = this.transform(mutation).document; | ||
if (shouldSubscribe === void 0) { shouldSubscribe = true; } | ||
process.env.NODE_ENV === "production" ? invariant(options.fetchPolicy !== 'standby', 43) : invariant(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"'); | ||
process.env.NODE_ENV === "production" ? invariant(options.fetchPolicy !== 'standby', 42) : invariant(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"'); | ||
options.variables = this.getVariables(options.query, options.variables); | ||
@@ -472,7 +472,7 @@ if (typeof options.notifyOnNetworkStatusChange === 'undefined') { | ||
var _this = this; | ||
process.env.NODE_ENV === "production" ? invariant(options.query, 44) : invariant(options.query, 'query option is required. You must specify your GraphQL document ' + | ||
process.env.NODE_ENV === "production" ? invariant(options.query, 43) : 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', 45) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.'); | ||
process.env.NODE_ENV === "production" ? invariant(!options.returnPartialData, 46) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); | ||
process.env.NODE_ENV === "production" ? invariant(!options.pollInterval, 47) : invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.'); | ||
process.env.NODE_ENV === "production" ? invariant(options.query.kind === 'Document', 44) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.'); | ||
process.env.NODE_ENV === "production" ? invariant(!options.returnPartialData, 45) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); | ||
process.env.NODE_ENV === "production" ? invariant(!options.pollInterval, 46) : invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.'); | ||
return new Promise(function (resolve, reject) { | ||
@@ -545,3 +545,3 @@ var watchedQuery = _this.watchQuery(options, false); | ||
this.fetchQueryRejectFns.forEach(function (reject) { | ||
reject(process.env.NODE_ENV === "production" ? new InvariantError(48) : new InvariantError('Store reset while query was in flight (not completed in link chain)')); | ||
reject(process.env.NODE_ENV === "production" ? new InvariantError(47) : new InvariantError('Store reset while query was in flight (not completed in link chain)')); | ||
}); | ||
@@ -665,3 +665,3 @@ var resetIds = []; | ||
var foundObservableQuery = this.getQuery(queryIdOrObservable).observableQuery; | ||
process.env.NODE_ENV === "production" ? invariant(foundObservableQuery, 49) : invariant(foundObservableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable); | ||
process.env.NODE_ENV === "production" ? invariant(foundObservableQuery, 48) : invariant(foundObservableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable); | ||
observableQuery = foundObservableQuery; | ||
@@ -855,3 +855,3 @@ } | ||
var pollInterval = options.pollInterval; | ||
process.env.NODE_ENV === "production" ? invariant(pollInterval, 50) : invariant(pollInterval, 'Attempted to start a polling query without a polling interval.'); | ||
process.env.NODE_ENV === "production" ? invariant(pollInterval, 49) : invariant(pollInterval, 'Attempted to start a polling query without a polling interval.'); | ||
if (!this.ssrMode) { | ||
@@ -858,0 +858,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), 57) : invariant(!previousQuery || | ||
equal(previousQuery.document, query.document), 56) : 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(13) : 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 @@ return ApolloLink; |
@@ -8,3 +8,3 @@ import { InvariantError } from 'ts-invariant'; | ||
library = 'node-fetch'; | ||
throw process.env.NODE_ENV === "production" ? new InvariantError(15) : 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(14) : 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(20) : new InvariantError("illegal argument: " + key); | ||
throw process.env.NODE_ENV === "production" ? new InvariantError(19) : new InvariantError("illegal argument: " + key); | ||
} | ||
@@ -17,0 +17,0 @@ } |
{ | ||
"name": "@apollo/client", | ||
"version": "3.0.0-beta.0", | ||
"version": "3.0.0-beta.1", | ||
"description": "A fully-featured caching GraphQL client.", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -8,3 +8,3 @@ import { invariant } from 'ts-invariant'; | ||
return React.createElement(ApolloContext.Consumer, null, function (context) { | ||
process.env.NODE_ENV === "production" ? invariant(context && context.client, 7) : 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>.'); | ||
@@ -11,0 +11,0 @@ return props.children(context.client); |
@@ -30,3 +30,3 @@ import { invariant } from 'ts-invariant'; | ||
(this.context && this.context.client); | ||
process.env.NODE_ENV === "production" ? invariant(!!client, 55) : invariant(!!client, 'Could not find "client" in the context or passed in as an option. ' + | ||
process.env.NODE_ENV === "production" ? invariant(!!client, 54) : 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, 56) : invariant(operation.type === type, "Running a " + requiredOperationName + " requires a graphql " + | ||
process.env.NODE_ENV === "production" ? invariant(operation.type === type, 55) : invariant(operation.type === type, "Running a " + requiredOperationName + " requires a graphql " + | ||
(requiredOperationName + ", but a " + usedOperationName + " was used instead.")); | ||
@@ -52,0 +52,0 @@ }; |
@@ -7,3 +7,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, 7) : invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' + | ||
'have called `ApolloProvider` higher up in your tree.'); | ||
@@ -10,0 +10,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, 9) : invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " + | ||
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 " + | ||
"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), 10) : invariant(!fragments.length || | ||
(queries.length || mutations.length || subscriptions.length), 9) : 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, 11) : 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, 10) : 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, 12) : invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + | ||
process.env.NODE_ENV === "production" ? invariant(definitions.length === 1, 11) : 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"); |
@@ -12,3 +12,3 @@ import { invariant } from 'ts-invariant'; | ||
evaledValue = variables[ifArgument.value.name.value]; | ||
process.env.NODE_ENV === "production" ? invariant(evaledValue !== void 0, 51) : invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive."); | ||
process.env.NODE_ENV === "production" ? invariant(evaledValue !== void 0, 50) : invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive."); | ||
} | ||
@@ -46,8 +46,8 @@ else { | ||
var directiveName = directive.name.value; | ||
process.env.NODE_ENV === "production" ? invariant(directiveArguments && directiveArguments.length === 1, 52) : invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive."); | ||
process.env.NODE_ENV === "production" ? invariant(directiveArguments && directiveArguments.length === 1, 51) : 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', 53) : 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', 52) : 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'), 54) : invariant(ifValue && | ||
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 53) : invariant(ifValue && | ||
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value."); | ||
@@ -54,0 +54,0 @@ return { 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(21) : new InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " + | ||
throw process.env.NODE_ENV === "production" ? new InvariantError(30) : 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, 22) : 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, 31) : 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, 23) : invariant(fragment, "No fragment named " + selection.name.value + "."); | ||
process.env.NODE_ENV === "production" ? invariant(fragment, 32) : invariant(fragment, "No fragment named " + selection.name.value + "."); | ||
return fragment; | ||
@@ -59,0 +59,0 @@ } |
@@ -7,3 +7,3 @@ import { __spreadArrays } from 'tslib'; | ||
function checkDocument(doc) { | ||
process.env.NODE_ENV === "production" ? invariant(doc && doc.kind === 'Document', 25) : 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', 21) : 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(26) : new InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); | ||
throw process.env.NODE_ENV === "production" ? new InvariantError(22) : new InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); | ||
} | ||
return definition; | ||
}); | ||
process.env.NODE_ENV === "production" ? invariant(operations.length <= 1, 27) : invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations"); | ||
process.env.NODE_ENV === "production" ? invariant(operations.length <= 1, 23) : 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', 29) : invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); | ||
process.env.NODE_ENV === "production" ? invariant(queryDef && queryDef.operation === 'query', 25) : invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); | ||
return queryDef; | ||
} | ||
function getFragmentDefinition(doc) { | ||
process.env.NODE_ENV === "production" ? invariant(doc.kind === 'Document', 30) : 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, 31) : invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.'); | ||
process.env.NODE_ENV === "production" ? invariant(doc.kind === 'Document', 26) : 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, 27) : 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', 32) : invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.'); | ||
process.env.NODE_ENV === "production" ? invariant(fragmentDef.kind === 'FragmentDefinition', 28) : invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.'); | ||
return fragmentDef; | ||
@@ -68,3 +68,3 @@ } | ||
} | ||
throw process.env.NODE_ENV === "production" ? new InvariantError(33) : new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.'); | ||
throw process.env.NODE_ENV === "production" ? new InvariantError(29) : new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.'); | ||
} | ||
@@ -71,0 +71,0 @@ function getDefaultValues(definition) { |
@@ -70,3 +70,3 @@ import { InvariantError } from 'ts-invariant'; | ||
else { | ||
throw process.env.NODE_ENV === "production" ? new InvariantError(34) : new InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" + | ||
throw process.env.NODE_ENV === "production" ? new InvariantError(33) : new InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" + | ||
'is not supported. Use variables instead of inline arguments to ' + | ||
@@ -73,0 +73,0 @@ 'overcome this limitation.'); |
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 too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18146
199
1888683