@apollo/react-common
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -43,3 +43,3 @@ exports.__esModule = true; | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(context.client, 1) : (0, _tsInvariant.invariant)(context.client, 'ApolloProvider was not passed a client instance. Make ' + 'sure you pass in your client via the "client" prop.'); | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(context.client, 5) : (0, _tsInvariant.invariant)(context.client, 'ApolloProvider was not passed a client instance. Make ' + 'sure you pass in your client via the "client" prop.'); | ||
return _react.default.createElement(ApolloContext.Provider, { | ||
@@ -97,3 +97,3 @@ value: context | ||
var variables, type, name; | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!!document && !!document.kind, 2) : (0, _tsInvariant.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 " + "to convert your operation into a document"); | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!!document && !!document.kind, 1) : (0, _tsInvariant.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 " + "to convert your operation into a document"); | ||
var fragments = document.definitions.filter(function (x) { | ||
@@ -111,8 +111,8 @@ return x.kind === 'FragmentDefinition'; | ||
}); | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!fragments.length || queries.length || mutations.length || subscriptions.length, 3) : (0, _tsInvariant.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" ? (0, _tsInvariant.invariant)(queries.length + mutations.length + subscriptions.length <= 1, 4) : (0, _tsInvariant.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 + " ") + ("subscriptions and " + mutations.length + " mutations. ") + "You can use 'compose' to join multiple operation types to a component"); | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!fragments.length || queries.length || mutations.length || subscriptions.length, 2) : (0, _tsInvariant.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" ? (0, _tsInvariant.invariant)(queries.length + mutations.length + subscriptions.length <= 1, 3) : (0, _tsInvariant.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 + " ") + ("subscriptions and " + mutations.length + " mutations. ") + "You can use 'compose' to join multiple operation types to a component"); | ||
type = queries.length ? DocumentType.Query : DocumentType.Mutation; | ||
if (!queries.length && !mutations.length) type = DocumentType.Subscription; | ||
var definitions = queries.length ? queries : mutations.length ? mutations : subscriptions; | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(definitions.length === 1, 5) : (0, _tsInvariant.invariant)(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + (definitions.length + " definitions. ") + "You can use 'compose' to join multiple operation types to a component"); | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(definitions.length === 1, 4) : (0, _tsInvariant.invariant)(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + (definitions.length + " definitions. ") + "You can use 'compose' to join multiple operation types to a component"); | ||
var definition = definitions[0]; | ||
@@ -119,0 +119,0 @@ variables = definition.variableDefinitions || []; |
@@ -1,1 +0,1 @@ | ||
exports.__esModule=!0,exports.getApolloContext=r,exports.operationName=function(e){var n;switch(e){case o.Query:n="Query";break;case o.Mutation:n="Mutation";break;case o.Subscription:n="Subscription"}return n},exports.parser=function(e){var n,t,r,u=a.get(e);if(u)return u;(0,i.invariant)(!!e&&!!e.kind,2);var l=e.definitions.filter(function(e){return"FragmentDefinition"===e.kind}),c=e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&"query"===e.operation}),s=e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}),p=e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&"subscription"===e.operation});(0,i.invariant)(!l.length||c.length||s.length||p.length,3),(0,i.invariant)(c.length+s.length+p.length<=1,4),t=c.length?o.Query:o.Mutation,c.length||s.length||(t=o.Subscription);var f=c.length?c:s.length?s:p;(0,i.invariant)(1===f.length,5);var v=f[0];n=v.variableDefinitions||[],r=v.name&&"Name"===v.name.kind?v.name.value:"data";var d={name:r,type:t,variables:n};return a.set(e,d),d},exports.resetApolloContext=function(){n=t.default.createContext({})},exports.DocumentType=exports.ApolloProvider=exports.ApolloConsumer=void 0;var e,n,t=(e=require("react"))&&e.__esModule?e:{default:e},i=require("ts-invariant");function r(){return n||(n=t.default.createContext({})),n}exports.ApolloProvider=function(e){var n=e.client,o=e.children,a=r();return t.default.createElement(a.Consumer,null,function(e){return void 0===e&&(e={}),n&&e.client!==n&&(e=Object.assign({},e,{client:n})),(0,i.invariant)(e.client,1),t.default.createElement(a.Provider,{value:e},o)})};var o;exports.ApolloConsumer=function(e){var n=r();return t.default.createElement(n.Consumer,null,function(n){return(0,i.invariant)(n&&n.client,6),e.children(n.client)})},exports.DocumentType=o,function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"}(o||(exports.DocumentType=o={}));var a=new Map; | ||
exports.__esModule=!0,exports.getApolloContext=r,exports.operationName=function(e){var n;switch(e){case o.Query:n="Query";break;case o.Mutation:n="Mutation";break;case o.Subscription:n="Subscription"}return n},exports.parser=function(e){var n,t,r,u=a.get(e);if(u)return u;(0,i.invariant)(!!e&&!!e.kind,1);var l=e.definitions.filter(function(e){return"FragmentDefinition"===e.kind}),c=e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&"query"===e.operation}),s=e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}),p=e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&"subscription"===e.operation});(0,i.invariant)(!l.length||c.length||s.length||p.length,2),(0,i.invariant)(c.length+s.length+p.length<=1,3),t=c.length?o.Query:o.Mutation,c.length||s.length||(t=o.Subscription);var f=c.length?c:s.length?s:p;(0,i.invariant)(1===f.length,4);var v=f[0];n=v.variableDefinitions||[],r=v.name&&"Name"===v.name.kind?v.name.value:"data";var d={name:r,type:t,variables:n};return a.set(e,d),d},exports.resetApolloContext=function(){n=t.default.createContext({})},exports.DocumentType=exports.ApolloProvider=exports.ApolloConsumer=void 0;var e,n,t=(e=require("react"))&&e.__esModule?e:{default:e},i=require("ts-invariant");function r(){return n||(n=t.default.createContext({})),n}exports.ApolloProvider=function(e){var n=e.client,o=e.children,a=r();return t.default.createElement(a.Consumer,null,function(e){return void 0===e&&(e={}),n&&e.client!==n&&(e=Object.assign({},e,{client:n})),(0,i.invariant)(e.client,5),t.default.createElement(a.Provider,{value:e},o)})};var o;exports.ApolloConsumer=function(e){var n=r();return t.default.createElement(n.Consumer,null,function(n){return(0,i.invariant)(n&&n.client,6),e.children(n.client)})},exports.DocumentType=o,function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"}(o||(exports.DocumentType=o={}));var a=new Map; |
@@ -23,3 +23,3 @@ import React from 'react'; | ||
} | ||
process.env.NODE_ENV === "production" ? invariant(context.client, 1) : invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' + | ||
process.env.NODE_ENV === "production" ? invariant(context.client, 5) : invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' + | ||
'sure you pass in your client via the "client" prop.'); | ||
@@ -66,3 +66,3 @@ return (React.createElement(ApolloContext.Provider, { value: context }, children)); | ||
var variables, type, name; | ||
process.env.NODE_ENV === "production" ? invariant(!!document && !!document.kind, 2) : invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " + | ||
process.env.NODE_ENV === "production" ? invariant(!!document && !!document.kind, 1) : 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 " + | ||
@@ -81,6 +81,6 @@ "to convert your operation into a document"); | ||
process.env.NODE_ENV === "production" ? invariant(!fragments.length || | ||
(queries.length || mutations.length || subscriptions.length), 3) : invariant(!fragments.length || | ||
(queries.length || mutations.length || subscriptions.length), 2) : 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, 4) : 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, 3) : 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 + " ") + | ||
@@ -97,3 +97,3 @@ ("subscriptions and " + mutations.length + " mutations. ") + | ||
: subscriptions; | ||
process.env.NODE_ENV === "production" ? invariant(definitions.length === 1, 5) : invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + | ||
process.env.NODE_ENV === "production" ? invariant(definitions.length === 1, 4) : invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + | ||
(definitions.length + " definitions. ") + | ||
@@ -100,0 +100,0 @@ "You can use 'compose' to join multiple operation types to a component"); |
@@ -54,3 +54,3 @@ (function (global, factory) { | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(context.client, 1) : (0, _tsInvariant.invariant)(context.client, 'ApolloProvider was not passed a client instance. Make ' + 'sure you pass in your client via the "client" prop.'); | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(context.client, 5) : (0, _tsInvariant.invariant)(context.client, 'ApolloProvider was not passed a client instance. Make ' + 'sure you pass in your client via the "client" prop.'); | ||
return _react.default.createElement(ApolloContext.Provider, { | ||
@@ -108,3 +108,3 @@ value: context | ||
var variables, type, name; | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!!document && !!document.kind, 2) : (0, _tsInvariant.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 " + "to convert your operation into a document"); | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!!document && !!document.kind, 1) : (0, _tsInvariant.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 " + "to convert your operation into a document"); | ||
var fragments = document.definitions.filter(function (x) { | ||
@@ -122,8 +122,8 @@ return x.kind === 'FragmentDefinition'; | ||
}); | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!fragments.length || queries.length || mutations.length || subscriptions.length, 3) : (0, _tsInvariant.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" ? (0, _tsInvariant.invariant)(queries.length + mutations.length + subscriptions.length <= 1, 4) : (0, _tsInvariant.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 + " ") + ("subscriptions and " + mutations.length + " mutations. ") + "You can use 'compose' to join multiple operation types to a component"); | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!fragments.length || queries.length || mutations.length || subscriptions.length, 2) : (0, _tsInvariant.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" ? (0, _tsInvariant.invariant)(queries.length + mutations.length + subscriptions.length <= 1, 3) : (0, _tsInvariant.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 + " ") + ("subscriptions and " + mutations.length + " mutations. ") + "You can use 'compose' to join multiple operation types to a component"); | ||
type = queries.length ? DocumentType.Query : DocumentType.Mutation; | ||
if (!queries.length && !mutations.length) type = DocumentType.Subscription; | ||
var definitions = queries.length ? queries : mutations.length ? mutations : subscriptions; | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(definitions.length === 1, 5) : (0, _tsInvariant.invariant)(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + (definitions.length + " definitions. ") + "You can use 'compose' to join multiple operation types to a component"); | ||
process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(definitions.length === 1, 4) : (0, _tsInvariant.invariant)(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + (definitions.length + " definitions. ") + "You can use 'compose' to join multiple operation types to a component"); | ||
var definition = definitions[0]; | ||
@@ -130,0 +130,0 @@ variables = definition.variableDefinitions || []; |
{ | ||
"name": "@apollo/react-common", | ||
"description": "React Apollo common utilities.", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"author": "opensource@apollographql.com", | ||
@@ -54,6 +54,6 @@ "keywords": [ | ||
"rollup": "1.20.3", | ||
"tsc-watch": "2.4.0", | ||
"tsc-watch": "3.0.1", | ||
"typescript": "3.5.3" | ||
}, | ||
"gitHead": "3bc12b7f5b2064acc7ec0e15ec59cd2acfa61d49" | ||
"gitHead": "1ad1e76c298b8c8ff9a49c03a8dec4b1da812625" | ||
} |
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