@apollo/client 3.4.0-rc.7 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apollo-client.cjs.js +300 -263
- package/apollo-client.cjs.js.map +1 -1
- package/apollo-client.cjs.min.js +1 -1
- package/cache/cache.cjs.js +105 -41
- package/cache/cache.cjs.js.map +1 -1
- package/cache/core/types/DataProxy.js +1 -0
- package/cache/index.d.ts +0 -1
- package/cache/index.d.ts.map +1 -1
- package/cache/index.js +3 -1
- package/cache/index.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts +3 -2
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js +22 -10
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/fixPolyfills.native.js +1 -0
- package/cache/inmemory/helpers.d.ts +1 -1
- package/cache/inmemory/helpers.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +5 -1
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js +24 -3
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/object-canon.d.ts +3 -1
- package/cache/inmemory/object-canon.d.ts.map +1 -1
- package/cache/inmemory/object-canon.js +12 -7
- package/cache/inmemory/object-canon.js.map +1 -1
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +23 -10
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +5 -2
- package/cache/inmemory/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +9 -6
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.js +1 -0
- package/cache/inmemory/writeToStore.d.ts +1 -0
- package/cache/inmemory/writeToStore.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.js +16 -7
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js +3 -0
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +2 -4
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +7 -6
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +116 -78
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +0 -1
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js +3 -6
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +3 -3
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +13 -10
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs.js +137 -181
- package/core/core.cjs.js.map +1 -1
- package/core/index.d.ts +0 -1
- package/core/index.d.ts.map +1 -1
- package/core/index.js +2 -2
- package/core/index.js.map +1 -1
- package/core/types.d.ts +4 -1
- package/core/types.d.ts.map +1 -1
- package/core/types.js +1 -0
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.js +1 -0
- package/errors/errors.cjs.js +2 -0
- package/errors/errors.cjs.js.map +1 -1
- package/errors/index.d.ts.map +1 -1
- package/errors/index.js +3 -0
- package/errors/index.js.map +1 -1
- package/invariantErrorCodes.js +82 -57
- package/link/context/context.cjs.js +4 -0
- package/link/context/context.cjs.js.map +1 -1
- package/link/context/index.d.ts.map +1 -1
- package/link/context/index.js +4 -0
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.js +1 -1
- package/link/core/core.cjs.js +4 -2
- package/link/core/core.cjs.js.map +1 -1
- package/link/core/index.d.ts.map +1 -1
- package/link/core/index.js +3 -0
- package/link/core/index.js.map +1 -1
- package/link/core/types.js +1 -0
- package/link/http/checkFetcher.js +1 -1
- package/link/http/http.cjs.js +13 -3
- package/link/http/http.cjs.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js +11 -1
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.d.ts.map +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/persisted-queries/persisted-queries.cjs.js +2 -2
- package/link/persisted-queries/persisted-queries.cjs.js.map +1 -1
- package/link/utils/utils.cjs.js +1 -1
- package/link/utils/utils.cjs.js.map +1 -1
- package/link/utils/validateOperation.js +1 -1
- package/package.json +20 -20
- package/react/components/Mutation.d.ts +1 -1
- package/react/components/Query.js +1 -1
- package/react/components/Query.js.map +1 -1
- package/react/components/components.cjs.js +45 -31
- package/react/components/components.cjs.js.map +1 -1
- package/react/components/types.js +1 -0
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs.js +22 -8
- package/react/context/context.cjs.js.map +1 -1
- package/react/data/OperationData.js +2 -2
- package/react/data/QueryData.d.ts +1 -2
- package/react/data/QueryData.d.ts.map +1 -1
- package/react/data/QueryData.js +65 -72
- package/react/data/QueryData.js.map +1 -1
- package/react/data/data.cjs.js +65 -71
- package/react/data/data.cjs.js.map +1 -1
- package/react/hoc/hoc-utils.d.ts +2 -1
- package/react/hoc/hoc-utils.d.ts.map +1 -1
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs.js +35 -18
- package/react/hoc/hoc.cjs.js.map +1 -1
- package/react/hoc/mutation-hoc.d.ts.map +1 -1
- package/react/hoc/query-hoc.d.ts.map +1 -1
- package/react/hoc/subscription-hoc.d.ts.map +1 -1
- package/react/hoc/types.js +1 -0
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs.js +56 -10
- package/react/hooks/hooks.cjs.js.map +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useSubscription.d.ts.map +1 -1
- package/react/hooks/useSubscription.js +16 -6
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/utils/useAfterFastRefresh.d.ts +2 -0
- package/react/hooks/utils/useAfterFastRefresh.d.ts.map +1 -0
- package/react/hooks/utils/useAfterFastRefresh.js +18 -0
- package/react/hooks/utils/useAfterFastRefresh.js.map +1 -0
- package/react/hooks/utils/useBaseQuery.d.ts.map +1 -1
- package/react/hooks/utils/useBaseQuery.js +10 -3
- package/react/hooks/utils/useBaseQuery.js.map +1 -1
- package/react/index.d.ts +0 -1
- package/react/index.d.ts.map +1 -1
- package/react/index.js +3 -1
- package/react/index.js.map +1 -1
- package/react/parser/index.js +4 -4
- package/react/parser/parser.cjs.js +4 -4
- package/react/parser/parser.cjs.js.map +1 -1
- package/react/react.cjs.js +2 -2
- package/react/react.cjs.js.map +1 -1
- package/react/ssr/ssr.cjs.js +15 -1
- package/react/ssr/ssr.cjs.js.map +1 -1
- package/react/types/types.d.ts +9 -3
- package/react/types/types.d.ts.map +1 -1
- package/react/types/types.js +1 -0
- package/react/types/types.js.map +1 -1
- package/testing/index.d.ts.map +1 -1
- package/testing/index.js +3 -0
- package/testing/index.js.map +1 -1
- package/testing/testing.cjs.js +68 -17
- package/testing/testing.cjs.js.map +1 -1
- package/utilities/common/canUse.d.ts +1 -0
- package/utilities/common/canUse.d.ts.map +1 -1
- package/utilities/common/canUse.js +1 -0
- package/utilities/common/canUse.js.map +1 -1
- package/utilities/common/global.d.ts.map +1 -1
- package/utilities/common/mergeDeep.js +2 -2
- package/utilities/common/mergeDeep.js.map +1 -1
- package/utilities/common/stringifyForDisplay.d.ts +2 -0
- package/utilities/common/stringifyForDisplay.d.ts.map +1 -0
- package/utilities/common/stringifyForDisplay.js +8 -0
- package/utilities/common/stringifyForDisplay.js.map +1 -0
- package/utilities/globals/DEV.d.ts +3 -0
- package/utilities/globals/DEV.d.ts.map +1 -0
- package/utilities/globals/DEV.js +20 -0
- package/utilities/globals/DEV.js.map +1 -0
- package/utilities/globals/graphql.d.ts +1 -1
- package/utilities/globals/graphql.d.ts.map +1 -1
- package/utilities/globals/graphql.js +3 -3
- package/utilities/globals/graphql.js.map +1 -1
- package/utilities/globals/index.d.ts +4 -2
- package/utilities/globals/index.d.ts.map +1 -1
- package/utilities/globals/index.js +5 -4
- package/utilities/globals/index.js.map +1 -1
- package/utilities/graphql/directives.js +4 -4
- package/utilities/graphql/fragments.js +5 -5
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +3 -1
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +5 -1
- package/utilities/index.js.map +1 -1
- package/utilities/package.json +3 -1
- package/utilities/policies/pagination.d.ts.map +1 -1
- package/utilities/policies/pagination.js +10 -11
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/testing/index.d.ts +1 -0
- package/utilities/testing/index.d.ts.map +1 -1
- package/utilities/testing/index.js +1 -0
- package/utilities/testing/index.js.map +1 -1
- package/utilities/testing/itAsync.d.ts +5 -8
- package/utilities/testing/itAsync.d.ts.map +1 -1
- package/utilities/testing/itAsync.js +6 -7
- package/utilities/testing/itAsync.js.map +1 -1
- package/utilities/testing/mocking/mockFetch.js +2 -2
- package/utilities/testing/mocking/mockFetch.js.map +1 -1
- package/utilities/testing/mocking/mockLink.d.ts.map +1 -1
- package/utilities/testing/mocking/mockLink.js +2 -8
- package/utilities/testing/mocking/mockLink.js.map +1 -1
- package/utilities/testing/mocking/mockWatchQuery.d.ts.map +1 -1
- package/utilities/testing/mocking/mockWatchQuery.js +2 -2
- package/utilities/testing/mocking/mockWatchQuery.js.map +1 -1
- package/utilities/testing/observableToPromise.js +2 -2
- package/utilities/testing/observableToPromise.js.map +1 -1
- package/utilities/testing/withConsoleSpy.d.ts +4 -0
- package/utilities/testing/withConsoleSpy.d.ts.map +1 -0
- package/utilities/testing/withConsoleSpy.js +39 -0
- package/utilities/testing/withConsoleSpy.js.map +1 -0
- package/utilities/types/IsStrictlyAny.js +1 -0
- package/utilities/utilities.cjs.js +56 -48
- package/utilities/utilities.cjs.js.map +1 -1
- package/version.js +1 -1
- package/core/Reobserver.d.ts +0 -18
- package/core/Reobserver.d.ts.map +0 -1
- package/core/Reobserver.js +0 -87
- package/core/Reobserver.js.map +0 -1
- package/utilities/globals/__DEV__.d.ts +0 -3
- package/utilities/globals/__DEV__.d.ts.map +0 -1
- package/utilities/globals/__DEV__.js +0 -32
- package/utilities/globals/__DEV__.js.map +0 -1
- package/utilities/globals/process.d.ts +0 -2
- package/utilities/globals/process.d.ts.map +0 -1
- package/utilities/globals/process.js +0 -31
- package/utilities/globals/process.js.map +0 -1
package/core/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { __DEV__ } from "../utilities";
|
|
2
1
|
export { ApolloClient, ApolloClientOptions, DefaultOptions, mergeOptions, } from './ApolloClient';
|
|
3
2
|
export { ObservableQuery, FetchMoreOptions, UpdateQueryOptions, applyNextFetchPolicy, } from './ObservableQuery';
|
|
4
3
|
export { QueryOptions, WatchQueryOptions, MutationOptions, SubscriptionOptions, FetchPolicy, WatchQueryFetchPolicy, ErrorPolicy, FetchMoreQueryOptions, SubscribeToMoreOptions, } from './watchQueryOptions';
|
package/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,WAAW,EACX,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,QAAQ,EACR,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIvD,OAAO,EAGL,KAAK,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,WAAW,EACX,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAElB,cAAc,yBAAyB,CAAC;AAIxC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,EACX,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAIvB,OAAO,EACL,UAAU,EACV,QAAQ,EACR,sBAAsB,EACtB,SAAS,EACT,WAAW,EACX,aAAa,EACb,WAAW,GACZ,MAAM,cAAc,CAAC;AAQtB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,CAAA;AAe1C,OAAO,EACL,GAAG,EACH,WAAW,EACX,uBAAuB,EACvB,mCAAmC,EACnC,oCAAoC,GACrC,MAAM,aAAa,CAAC"}
|
package/core/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { DEV } from "../utilities/index.js";
|
|
2
2
|
export { ApolloClient, mergeOptions, } from "./ApolloClient.js";
|
|
3
3
|
export { ObservableQuery, applyNextFetchPolicy, } from "./ObservableQuery.js";
|
|
4
4
|
export { NetworkStatus } from "./networkStatus.js";
|
|
@@ -12,6 +12,6 @@ export { fromError, toPromise, fromPromise, throwServerError, } from "../link/ut
|
|
|
12
12
|
export { Observable, isReference, makeReference, } from "../utilities/index.js";
|
|
13
13
|
import { setVerbosity } from "ts-invariant";
|
|
14
14
|
export { setVerbosity as setLogVerbosity };
|
|
15
|
-
setVerbosity("log");
|
|
15
|
+
setVerbosity(DEV ? "log" : "silent");
|
|
16
16
|
export { gql, resetCaches, disableFragmentWarnings, enableExperimentalFragmentVariables, disableExperimentalFragmentVariables, } from 'graphql-tag';
|
|
17
17
|
//# sourceMappingURL=index.js.map
|
package/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EACL,YAAY,EAGZ,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EAGf,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAY3B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,SAAS,CAAC;AAKxB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIvD,OAAO,EAGL,KAAK,EACL,WAAW,EAGX,aAAa,EAEb,iBAAiB,EACjB,uBAAuB,EAEvB,OAAO,GAQR,MAAM,UAAU,CAAC;AAElB,cAAc,yBAAyB,CAAC;AAIxC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,SAAS,EACT,SAAS,EACT,WAAW,EAEX,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAIvB,OAAO,EACL,UAAU,EAIV,WAAW,EACX,aAAa,GAEd,MAAM,cAAc,CAAC;AAQtB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,CAAA;AAC1C,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAcrC,OAAO,EACL,GAAG,EACH,WAAW,EACX,uBAAuB,EACvB,mCAAmC,EACnC,oCAAoC,GACrC,MAAM,aAAa,CAAC","sourcesContent":["/* Core */\n\nimport { DEV } from \"../utilities\";\n\nexport {\n ApolloClient,\n ApolloClientOptions,\n DefaultOptions,\n mergeOptions,\n} from './ApolloClient';\nexport {\n ObservableQuery,\n FetchMoreOptions,\n UpdateQueryOptions,\n applyNextFetchPolicy,\n} from './ObservableQuery';\nexport {\n QueryOptions,\n WatchQueryOptions,\n MutationOptions,\n SubscriptionOptions,\n FetchPolicy,\n WatchQueryFetchPolicy,\n ErrorPolicy,\n FetchMoreQueryOptions,\n SubscribeToMoreOptions,\n} from './watchQueryOptions';\nexport { NetworkStatus } from './networkStatus';\nexport * from './types';\nexport {\n Resolver,\n FragmentMatcher,\n} from './LocalState';\nexport { isApolloError, ApolloError } from '../errors';\n\n/* Cache */\n\nexport {\n // All the exports (types and values) from ../cache, minus cacheSlot,\n // which we want to keep semi-private.\n Cache,\n ApolloCache,\n Transaction,\n DataProxy,\n InMemoryCache,\n InMemoryCacheConfig,\n MissingFieldError,\n defaultDataIdFromObject,\n ReactiveVar,\n makeVar,\n TypePolicies,\n TypePolicy,\n FieldPolicy,\n FieldReadFunction,\n FieldMergeFunction,\n FieldFunctionOptions,\n PossibleTypesMap,\n} from '../cache';\n\nexport * from '../cache/inmemory/types';\n\n/* Link */\n\nexport * from '../link/core';\nexport * from '../link/http';\nexport {\n fromError,\n toPromise,\n fromPromise,\n ServerError,\n throwServerError,\n} from '../link/utils';\n\n/* Utilities */\n\nexport {\n Observable,\n Observer,\n ObservableSubscription,\n Reference,\n isReference,\n makeReference,\n StoreObject,\n} from '../utilities';\n\n/* Supporting */\n\n// The verbosity of invariant.{log,warn,error} can be controlled globally\n// (for anyone using the same ts-invariant package) by passing \"log\",\n// \"warn\", \"error\", or \"silent\" to setVerbosity (\"log\" is the default).\n// Note that all invariant.* logging is hidden in production.\nimport { setVerbosity } from \"ts-invariant\";\nexport { setVerbosity as setLogVerbosity }\nsetVerbosity(DEV ? \"log\" : \"silent\");\n\n// Note that importing `gql` by itself, then destructuring\n// additional properties separately before exporting, is intentional.\n// Due to the way the `graphql-tag` library is setup, certain bundlers\n// can't find the properties added to the exported `gql` function without\n// additional guidance (e.g. Rollup - see\n// https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module).\n// Instead of having people that are using bundlers with `@apollo/client` add\n// extra bundler config to help `graphql-tag` exports be found (which would be\n// awkward since they aren't importing `graphql-tag` themselves), this\n// workaround of pulling the extra properties off the `gql` function,\n// then re-exporting them separately, helps keeps bundlers happy without any\n// additional config changes.\nexport {\n gql,\n resetCaches,\n disableFragmentWarnings,\n enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables,\n} from 'graphql-tag';\n"]}
|
package/core/types.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface InternalRefetchQueriesOptions<TCache extends ApolloCache<any>,
|
|
|
33
33
|
include?: InternalRefetchQueriesInclude;
|
|
34
34
|
removeOptimistic?: string;
|
|
35
35
|
}
|
|
36
|
-
export declare type InternalRefetchQueriesResult<TResult> = TResult
|
|
36
|
+
export declare type InternalRefetchQueriesResult<TResult> = TResult extends boolean ? Promise<ApolloQueryResult<any>> : TResult;
|
|
37
37
|
export declare type InternalRefetchQueriesMap<TResult> = Map<ObservableQuery<any>, InternalRefetchQueriesResult<TResult>>;
|
|
38
38
|
export type { QueryOptions as PureQueryOptions };
|
|
39
39
|
export declare type OperationVariables = Record<string, any>;
|
|
@@ -55,6 +55,9 @@ export declare type MutationQueryReducersMap<T = {
|
|
|
55
55
|
}> = {
|
|
56
56
|
[queryName: string]: MutationQueryReducer<T>;
|
|
57
57
|
};
|
|
58
|
+
export declare type MutationUpdaterFn<T = {
|
|
59
|
+
[key: string]: any;
|
|
60
|
+
}> = (cache: ApolloCache<T>, mutationResult: FetchResult<T>) => void;
|
|
58
61
|
export declare type MutationUpdaterFunction<TData, TVariables, TContext, TCache extends ApolloCache<any>> = (cache: TCache, result: Omit<FetchResult<TData>, 'context'>, options: {
|
|
59
62
|
context?: TContext;
|
|
60
63
|
variables?: TVariables;
|
package/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,oBAAY,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEjD,oBAAY,aAAa,GAAG,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;AAE3D,oBAAY,cAAc,CAAC,OAAO,IAAI,CACpC,eAAe,EAAE,eAAe,CAAC,GAAG,CAAC,EACrC,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAC3B,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;AAGF,oBAAY,iBAAiB,CAAC,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,IAAI,CAI1D,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EACrB,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,KAC3B,IAAI,CAAC;AAEV,oBAAY,uBAAuB,CACjC,KAAK,EACL,UAAU,EACV,QAAQ,EACR,MAAM,SAAS,WAAW,CAAC,GAAG,CAAC,IAC7B,CACF,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,EAC3C,OAAO,EAAE;IACP,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB,KACE,IAAI,CAAC;AACV,MAAM,WAAW,SAAS;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,CAAE,KAAK,EAAE,MAAM,GAAI,QAAQ,CAAC;KAC7B,CAAC;CACH"}
|
package/core/types.js
CHANGED
package/core/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"","sourcesContent":["import { DocumentNode, GraphQLError } from 'graphql';\n\nimport { ApolloCache } from '../cache';\nimport { FetchResult } from '../link/core';\nimport { ApolloError } from '../errors';\nimport { QueryInfo } from './QueryInfo';\nimport { NetworkStatus } from './networkStatus';\nimport { Resolver } from './LocalState';\nimport { ObservableQuery } from './ObservableQuery';\nimport { QueryOptions } from './watchQueryOptions';\nimport { Cache } from '../cache';\nimport { IsStrictlyAny } from '../utilities';\n\nexport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nexport type DefaultContext = Record<string, any>;\n\nexport type QueryListener = (queryInfo: QueryInfo) => void;\n\nexport type OnQueryUpdated<TResult> = (\n observableQuery: ObservableQuery<any>,\n diff: Cache.DiffResult<any>,\n lastDiff: Cache.DiffResult<any> | undefined,\n) => boolean | TResult;\n\nexport type RefetchQueryDescriptor = string | DocumentNode;\nexport type InternalRefetchQueryDescriptor = RefetchQueryDescriptor | QueryOptions;\n\ntype RefetchQueriesIncludeShorthand = \"all\" | \"active\";\n\nexport type RefetchQueriesInclude =\n | RefetchQueryDescriptor[]\n | RefetchQueriesIncludeShorthand;\n\nexport type InternalRefetchQueriesInclude =\n | InternalRefetchQueryDescriptor[]\n | RefetchQueriesIncludeShorthand;\n\n// Used by ApolloClient[\"refetchQueries\"]\n// TODO Improve documentation comments for this public type.\nexport interface RefetchQueriesOptions<\n TCache extends ApolloCache<any>,\n TResult,\n> {\n updateCache?: (cache: TCache) => void;\n // The client.refetchQueries method discourages passing QueryOptions, by\n // restricting the public type of options.include to exclude QueryOptions as\n // an available array element type (see InternalRefetchQueriesInclude for a\n // version of RefetchQueriesInclude that allows legacy QueryOptions objects).\n include?: RefetchQueriesInclude;\n optimistic?: boolean;\n // If no onQueryUpdated function is provided, any queries affected by the\n // updateCache function or included in the options.include array will be\n // refetched by default. Passing null instead of undefined disables this\n // default refetching behavior for affected queries, though included queries\n // will still be refetched.\n onQueryUpdated?: OnQueryUpdated<TResult> | null;\n}\n\n// The client.refetchQueries method returns a thenable (PromiseLike) object\n// whose result is an array of Promise.resolve'd TResult values, where TResult\n// is whatever type the (optional) onQueryUpdated function returns. When no\n// onQueryUpdated function is given, TResult defaults to ApolloQueryResult<any>\n// (thanks to default type parameters for client.refetchQueries).\nexport type RefetchQueriesPromiseResults<TResult> =\n // If onQueryUpdated returns any, all bets are off, so the results array must\n // be a generic any[] array, which is much less confusing than the union type\n // we get if we don't check for any. I hoped `any extends TResult` would do\n // the trick here, instead of IsStrictlyAny, but you can see for yourself what\n // fails in the refetchQueries tests if you try making that simplification.\n IsStrictlyAny<TResult> extends true ? any[] :\n // If the onQueryUpdated function passed to client.refetchQueries returns true\n // or false, that means either to refetch the query (true) or to skip the\n // query (false). Since refetching produces an ApolloQueryResult<any>, and\n // skipping produces nothing, the fully-resolved array of all results produced\n // will be an ApolloQueryResult<any>[], when TResult extends boolean.\n TResult extends boolean ? ApolloQueryResult<any>[] :\n // If onQueryUpdated returns a PromiseLike<U>, that thenable will be passed as\n // an array element to Promise.all, so we infer/unwrap the array type U here.\n TResult extends PromiseLike<infer U> ? U[] :\n // All other onQueryUpdated results end up in the final Promise.all array as\n // themselves, with their original TResult type. Note that TResult will\n // default to ApolloQueryResult<any> if no onQueryUpdated function is passed\n // to client.refetchQueries.\n TResult[];\n\n// The result of client.refetchQueries is thenable/awaitable, if you just want\n// an array of fully resolved results, but you can also access the raw results\n// immediately by examining the additional { queries, results } properties of\n// the RefetchQueriesResult<TResult> object.\nexport interface RefetchQueriesResult<TResult>\nextends Promise<RefetchQueriesPromiseResults<TResult>> {\n // An array of ObservableQuery objects corresponding 1:1 to TResult values\n // in the results arrays (both the TResult[] array below, and the results\n // array resolved by the Promise above).\n queries: ObservableQuery<any>[];\n // These are the raw TResult values returned by any onQueryUpdated functions\n // that were invoked by client.refetchQueries.\n results: InternalRefetchQueriesResult<TResult>[];\n}\n\n// Used by QueryManager[\"refetchQueries\"]\nexport interface InternalRefetchQueriesOptions<\n TCache extends ApolloCache<any>,\n TResult,\n> extends Omit<RefetchQueriesOptions<TCache, TResult>, \"include\"> {\n // Just like the refetchQueries option for a mutation, an array of strings,\n // DocumentNode objects, and/or QueryOptions objects, or one of the shorthand\n // strings \"all\" or \"active\", to select every (active) query.\n include?: InternalRefetchQueriesInclude;\n // This part of the API is a (useful) implementation detail, but need not be\n // exposed in the public client.refetchQueries API (above).\n removeOptimistic?: string;\n}\n\nexport type InternalRefetchQueriesResult<TResult> =\n TResult
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"","sourcesContent":["import { DocumentNode, GraphQLError } from 'graphql';\n\nimport { ApolloCache } from '../cache';\nimport { FetchResult } from '../link/core';\nimport { ApolloError } from '../errors';\nimport { QueryInfo } from './QueryInfo';\nimport { NetworkStatus } from './networkStatus';\nimport { Resolver } from './LocalState';\nimport { ObservableQuery } from './ObservableQuery';\nimport { QueryOptions } from './watchQueryOptions';\nimport { Cache } from '../cache';\nimport { IsStrictlyAny } from '../utilities';\n\nexport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nexport type DefaultContext = Record<string, any>;\n\nexport type QueryListener = (queryInfo: QueryInfo) => void;\n\nexport type OnQueryUpdated<TResult> = (\n observableQuery: ObservableQuery<any>,\n diff: Cache.DiffResult<any>,\n lastDiff: Cache.DiffResult<any> | undefined,\n) => boolean | TResult;\n\nexport type RefetchQueryDescriptor = string | DocumentNode;\nexport type InternalRefetchQueryDescriptor = RefetchQueryDescriptor | QueryOptions;\n\ntype RefetchQueriesIncludeShorthand = \"all\" | \"active\";\n\nexport type RefetchQueriesInclude =\n | RefetchQueryDescriptor[]\n | RefetchQueriesIncludeShorthand;\n\nexport type InternalRefetchQueriesInclude =\n | InternalRefetchQueryDescriptor[]\n | RefetchQueriesIncludeShorthand;\n\n// Used by ApolloClient[\"refetchQueries\"]\n// TODO Improve documentation comments for this public type.\nexport interface RefetchQueriesOptions<\n TCache extends ApolloCache<any>,\n TResult,\n> {\n updateCache?: (cache: TCache) => void;\n // The client.refetchQueries method discourages passing QueryOptions, by\n // restricting the public type of options.include to exclude QueryOptions as\n // an available array element type (see InternalRefetchQueriesInclude for a\n // version of RefetchQueriesInclude that allows legacy QueryOptions objects).\n include?: RefetchQueriesInclude;\n optimistic?: boolean;\n // If no onQueryUpdated function is provided, any queries affected by the\n // updateCache function or included in the options.include array will be\n // refetched by default. Passing null instead of undefined disables this\n // default refetching behavior for affected queries, though included queries\n // will still be refetched.\n onQueryUpdated?: OnQueryUpdated<TResult> | null;\n}\n\n// The client.refetchQueries method returns a thenable (PromiseLike) object\n// whose result is an array of Promise.resolve'd TResult values, where TResult\n// is whatever type the (optional) onQueryUpdated function returns. When no\n// onQueryUpdated function is given, TResult defaults to ApolloQueryResult<any>\n// (thanks to default type parameters for client.refetchQueries).\nexport type RefetchQueriesPromiseResults<TResult> =\n // If onQueryUpdated returns any, all bets are off, so the results array must\n // be a generic any[] array, which is much less confusing than the union type\n // we get if we don't check for any. I hoped `any extends TResult` would do\n // the trick here, instead of IsStrictlyAny, but you can see for yourself what\n // fails in the refetchQueries tests if you try making that simplification.\n IsStrictlyAny<TResult> extends true ? any[] :\n // If the onQueryUpdated function passed to client.refetchQueries returns true\n // or false, that means either to refetch the query (true) or to skip the\n // query (false). Since refetching produces an ApolloQueryResult<any>, and\n // skipping produces nothing, the fully-resolved array of all results produced\n // will be an ApolloQueryResult<any>[], when TResult extends boolean.\n TResult extends boolean ? ApolloQueryResult<any>[] :\n // If onQueryUpdated returns a PromiseLike<U>, that thenable will be passed as\n // an array element to Promise.all, so we infer/unwrap the array type U here.\n TResult extends PromiseLike<infer U> ? U[] :\n // All other onQueryUpdated results end up in the final Promise.all array as\n // themselves, with their original TResult type. Note that TResult will\n // default to ApolloQueryResult<any> if no onQueryUpdated function is passed\n // to client.refetchQueries.\n TResult[];\n\n// The result of client.refetchQueries is thenable/awaitable, if you just want\n// an array of fully resolved results, but you can also access the raw results\n// immediately by examining the additional { queries, results } properties of\n// the RefetchQueriesResult<TResult> object.\nexport interface RefetchQueriesResult<TResult>\nextends Promise<RefetchQueriesPromiseResults<TResult>> {\n // An array of ObservableQuery objects corresponding 1:1 to TResult values\n // in the results arrays (both the TResult[] array below, and the results\n // array resolved by the Promise above).\n queries: ObservableQuery<any>[];\n // These are the raw TResult values returned by any onQueryUpdated functions\n // that were invoked by client.refetchQueries.\n results: InternalRefetchQueriesResult<TResult>[];\n}\n\n// Used by QueryManager[\"refetchQueries\"]\nexport interface InternalRefetchQueriesOptions<\n TCache extends ApolloCache<any>,\n TResult,\n> extends Omit<RefetchQueriesOptions<TCache, TResult>, \"include\"> {\n // Just like the refetchQueries option for a mutation, an array of strings,\n // DocumentNode objects, and/or QueryOptions objects, or one of the shorthand\n // strings \"all\" or \"active\", to select every (active) query.\n include?: InternalRefetchQueriesInclude;\n // This part of the API is a (useful) implementation detail, but need not be\n // exposed in the public client.refetchQueries API (above).\n removeOptimistic?: string;\n}\n\nexport type InternalRefetchQueriesResult<TResult> =\n // If onQueryUpdated returns a boolean, that's equivalent to refetching the\n // query when the boolean is true and skipping the query when false, so the\n // internal type of refetched results is Promise<ApolloQueryResult<any>>.\n TResult extends boolean ? Promise<ApolloQueryResult<any>> :\n // Otherwise, onQueryUpdated returns whatever it returns. If onQueryUpdated is\n // not provided, TResult defaults to Promise<ApolloQueryResult<any>> (see the\n // generic type parameters of client.refetchQueries).\n TResult;\n\nexport type InternalRefetchQueriesMap<TResult> =\n Map<ObservableQuery<any>,\n InternalRefetchQueriesResult<TResult>>;\n\n// TODO Remove this unnecessary type in Apollo Client 4.\nexport type { QueryOptions as PureQueryOptions };\n\nexport type OperationVariables = Record<string, any>;\n\nexport type ApolloQueryResult<T> = {\n data: T;\n errors?: ReadonlyArray<GraphQLError>;\n error?: ApolloError;\n loading: boolean;\n networkStatus: NetworkStatus;\n // If result.data was read from the cache with missing fields,\n // result.partial will be true. Otherwise, result.partial will be falsy\n // (usually because the property is absent from the result object).\n partial?: boolean;\n};\n\n// This is part of the public API, people write these functions in `updateQueries`.\nexport type MutationQueryReducer<T> = (\n previousResult: Record<string, any>,\n options: {\n mutationResult: FetchResult<T>;\n queryName: string | undefined;\n queryVariables: Record<string, any>;\n },\n) => Record<string, any>;\n\nexport type MutationQueryReducersMap<T = { [key: string]: any }> = {\n [queryName: string]: MutationQueryReducer<T>;\n};\n\n// @deprecated Use MutationUpdaterFunction instead.\nexport type MutationUpdaterFn<T = { [key: string]: any }> = (\n // The MutationUpdaterFn type is broken because it mistakenly uses the same\n // type parameter T for both the cache and the mutationResult. Do not use this\n // type unless you absolutely need it for backwards compatibility.\n cache: ApolloCache<T>,\n mutationResult: FetchResult<T>,\n) => void;\n\nexport type MutationUpdaterFunction<\n TData,\n TVariables,\n TContext,\n TCache extends ApolloCache<any>\n> = (\n cache: TCache,\n result: Omit<FetchResult<TData>, 'context'>,\n options: {\n context?: TContext,\n variables?: TVariables,\n },\n) => void;\nexport interface Resolvers {\n [key: string]: {\n [ field: string ]: Resolver;\n };\n}\n"]}
|
package/errors/errors.cjs.js
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
|
+
var tsInvariant = require('ts-invariant');
|
|
6
7
|
var utilities = require('../utilities');
|
|
7
8
|
|
|
9
|
+
__DEV__ ? tsInvariant.invariant("boolean" === typeof utilities.DEV, utilities.DEV) : tsInvariant.invariant("boolean" === typeof utilities.DEV, 22);
|
|
8
10
|
function isApolloError(err) {
|
|
9
11
|
return err.hasOwnProperty('graphQLErrors');
|
|
10
12
|
}
|
package/errors/errors.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.cjs.js","sources":["index.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { isNonEmptyArray } from '../utilities';\nexport function isApolloError(err) {\n return err.hasOwnProperty('graphQLErrors');\n}\nvar generateErrorMessage = function (err) {\n var message = '';\n if (isNonEmptyArray(err.graphQLErrors) || isNonEmptyArray(err.clientErrors)) {\n var errors = (err.graphQLErrors || [])\n .concat(err.clientErrors || []);\n errors.forEach(function (error) {\n var errorMessage = error\n ? error.message\n : 'Error message not found.';\n message += errorMessage + \"\\n\";\n });\n }\n if (err.networkError) {\n message += err.networkError.message + \"\\n\";\n }\n message = message.replace(/\\n$/, '');\n return message;\n};\nvar ApolloError = (function (_super) {\n __extends(ApolloError, _super);\n function ApolloError(_a) {\n var graphQLErrors = _a.graphQLErrors, clientErrors = _a.clientErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo;\n var _this = _super.call(this, errorMessage) || this;\n _this.graphQLErrors = graphQLErrors || [];\n _this.clientErrors = clientErrors || [];\n _this.networkError = networkError || null;\n _this.message = errorMessage || generateErrorMessage(_this);\n _this.extraInfo = extraInfo;\n _this.__proto__ = ApolloError.prototype;\n return _this;\n }\n return ApolloError;\n}(Error));\nexport { ApolloError };\n//# sourceMappingURL=index.js.map"],"names":["isNonEmptyArray","__extends"],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.cjs.js","sources":["index.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { invariant } from \"ts-invariant\";\nimport { DEV } from \"../utilities\";\n__DEV__ ? invariant(\"boolean\" === typeof DEV, DEV) : invariant(\"boolean\" === typeof DEV, 22);\nimport { isNonEmptyArray } from '../utilities';\nexport function isApolloError(err) {\n return err.hasOwnProperty('graphQLErrors');\n}\nvar generateErrorMessage = function (err) {\n var message = '';\n if (isNonEmptyArray(err.graphQLErrors) || isNonEmptyArray(err.clientErrors)) {\n var errors = (err.graphQLErrors || [])\n .concat(err.clientErrors || []);\n errors.forEach(function (error) {\n var errorMessage = error\n ? error.message\n : 'Error message not found.';\n message += errorMessage + \"\\n\";\n });\n }\n if (err.networkError) {\n message += err.networkError.message + \"\\n\";\n }\n message = message.replace(/\\n$/, '');\n return message;\n};\nvar ApolloError = (function (_super) {\n __extends(ApolloError, _super);\n function ApolloError(_a) {\n var graphQLErrors = _a.graphQLErrors, clientErrors = _a.clientErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo;\n var _this = _super.call(this, errorMessage) || this;\n _this.graphQLErrors = graphQLErrors || [];\n _this.clientErrors = clientErrors || [];\n _this.networkError = networkError || null;\n _this.message = errorMessage || generateErrorMessage(_this);\n _this.extraInfo = extraInfo;\n _this.__proto__ = ApolloError.prototype;\n return _this;\n }\n return ApolloError;\n}(Error));\nexport { ApolloError };\n//# sourceMappingURL=index.js.map"],"names":["invariant","DEV","isNonEmptyArray","__extends"],"mappings":";;;;;;;;AAGA,OAAO,GAAGA,qBAAS,CAAC,SAAS,KAAK,OAAOC,aAAG,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E,CAAC,YAAY,EAAE,YAAY,GAAG,EAAE,CAAC,YAAY,EAAE,YAAY,GAAG,EAAE,CAAC,YAAY,EAAE,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC;AACvK,QAAQ,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,IAAI,CAAC;AAC5D,QAAQ,KAAK,CAAC,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;AAClD,QAAQ,KAAK,CAAC,YAAY,GAAG,YAAY,IAAI,EAAE,CAAC;AAChD,QAAQ,KAAK,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC;AAClD,QAAQ,KAAK,CAAC,OAAO,GAAG,YAAY,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC;AACpE,QAAQ,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;AACpC,QAAQ,KAAK,CAAC,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;AAChD,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,WAAW,CAAC;AACvB,CAAC,CAAC,KAAK,CAAC;;;;;"}
|
package/errors/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,wBAAgB,aAAa,CAAC,GAAG,EAAE,KAAK,GAAG,GAAG,IAAI,WAAW,CAE5D;AA6BD,qBAAa,WAAY,SAAQ,KAAK;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC3C,YAAY,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IACnC,YAAY,EAAE,KAAK,GAAG,gBAAgB,GAAG,WAAW,GAAG,IAAI,CAAC;IAK5D,SAAS,EAAE,GAAG,CAAC;gBAKV,EACV,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,SAAS,GACV,EAAE;QACD,aAAa,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;QAC5C,YAAY,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QACpC,YAAY,CAAC,EAAE,KAAK,GAAG,gBAAgB,GAAG,WAAW,GAAG,IAAI,CAAC;QAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,GAAG,CAAC;KACjB;CAYF"}
|
package/errors/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
|
+
import { invariant } from "ts-invariant";
|
|
3
|
+
import { DEV } from "../utilities/index.js";
|
|
4
|
+
__DEV__ ? invariant("boolean" === typeof DEV, DEV) : invariant("boolean" === typeof DEV, 22);
|
|
2
5
|
import { isNonEmptyArray } from "../utilities/index.js";
|
|
3
6
|
export function isApolloError(err) {
|
|
4
7
|
return err.hasOwnProperty('graphQLErrors');
|
package/errors/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,SAAS,CAAC,SAAS,KAAK,OAAO,GAAG,EAAE,GAAG,CAAC,CAAC;AAIzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;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CAAC,CAAC;QAC1D,KAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAI1B,KAAY,CAAC,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;;IAClD,CAAC;IACH,kBAAC;AAAD,CAAC,AAtCD,CAAiC,KAAK,GAsCrC","sourcesContent":["import { invariant } from \"ts-invariant\";\nimport { DEV } from \"../utilities\";\ninvariant(\"boolean\" === typeof DEV, DEV);\n\nimport { GraphQLError } from 'graphql';\n\nimport { isNonEmptyArray } from '../utilities';\nimport { ServerParseError } from '../link/http';\nimport { ServerError } from '../link/utils';\n\nexport function isApolloError(err: Error): err is ApolloError {\n return err.hasOwnProperty('graphQLErrors');\n}\n\n// Sets the error message on this error according to the\n// the GraphQL and network errors that are present.\n// If the error message has already been set through the\n// constructor or otherwise, this function is a nop.\nconst generateErrorMessage = (err: ApolloError) => {\n let message = '';\n // If we have GraphQL errors present, add that to the error message.\n if (isNonEmptyArray(err.graphQLErrors) || isNonEmptyArray(err.clientErrors)) {\n const errors = ((err.graphQLErrors || []) as readonly Error[])\n .concat(err.clientErrors || []);\n errors.forEach((error: Error) => {\n const errorMessage = error\n ? error.message\n : 'Error message not found.';\n message += `${errorMessage}\\n`;\n });\n }\n\n if (err.networkError) {\n message += `${err.networkError.message}\\n`;\n }\n\n // strip newline from the end of the message\n message = message.replace(/\\n$/, '');\n return message;\n};\n\nexport class ApolloError extends Error {\n public message: string;\n public graphQLErrors: ReadonlyArray<GraphQLError>;\n public clientErrors: ReadonlyArray<Error>;\n public networkError: Error | ServerParseError | ServerError | null;\n\n // An object that can be used to provide some additional information\n // about an error, e.g. specifying the type of error this is. Used\n // internally within Apollo Client.\n public extraInfo: any;\n\n // Constructs an instance of ApolloError given a GraphQLError\n // or a network error. Note that one of these has to be a valid\n // value or the constructed error will be meaningless.\n constructor({\n graphQLErrors,\n clientErrors,\n networkError,\n errorMessage,\n extraInfo,\n }: {\n graphQLErrors?: ReadonlyArray<GraphQLError>;\n clientErrors?: ReadonlyArray<Error>;\n networkError?: Error | ServerParseError | ServerError | null;\n errorMessage?: string;\n extraInfo?: any;\n }) {\n super(errorMessage);\n this.graphQLErrors = graphQLErrors || [];\n this.clientErrors = clientErrors || [];\n this.networkError = networkError || null;\n this.message = errorMessage || generateErrorMessage(this);\n this.extraInfo = extraInfo;\n\n // We're not using `Object.setPrototypeOf` here as it isn't fully\n // supported on Android (see issue #3236).\n (this as any).__proto__ = ApolloError.prototype;\n }\n}\n"]}
|
package/invariantErrorCodes.js
CHANGED
|
@@ -5,34 +5,39 @@
|
|
|
5
5
|
// consult the @apollo/client/invariantErrorCodes.js file specific to
|
|
6
6
|
// your @apollo/client version. This file is not meant to be imported.
|
|
7
7
|
{
|
|
8
|
-
"@apollo/client version": "3.4.
|
|
8
|
+
"@apollo/client version": "3.4.1",
|
|
9
9
|
|
|
10
10
|
1: {
|
|
11
|
+
file: "@apollo/client/cache/index.js",
|
|
12
|
+
node: invariant("boolean" === typeof DEV, DEV)
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
2: {
|
|
11
16
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
12
17
|
node: invariant(typeof dataId === "string", "store.merge expects a string ID")
|
|
13
18
|
},
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
3: {
|
|
16
21
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
17
22
|
node: invariant(!old || old === which, "Cannot change root " + which + " __typename more than once")
|
|
18
23
|
},
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
4: {
|
|
21
26
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
22
27
|
node: new InvariantError("Cannot automatically merge arrays")
|
|
23
28
|
},
|
|
24
29
|
|
|
25
|
-
|
|
30
|
+
5: {
|
|
26
31
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
27
32
|
node: invariant(!strict, "Missing field '" + responseName + "' while computing key fields")
|
|
28
33
|
},
|
|
29
34
|
|
|
30
|
-
|
|
35
|
+
6: {
|
|
31
36
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
32
37
|
node: new InvariantError("Dangling reference to missing " + objectOrReference.__ref + " object")
|
|
33
38
|
},
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
7: {
|
|
36
41
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
37
42
|
|
|
38
43
|
node: new InvariantError("Can't find field '" + selection.name.value + "' on " + (isReference(objectOrReference)
|
|
@@ -40,19 +45,14 @@
|
|
|
40
45
|
: "object " + JSON.stringify(objectOrReference, null, 2)))
|
|
41
46
|
},
|
|
42
47
|
|
|
43
|
-
|
|
48
|
+
8: {
|
|
44
49
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
45
50
|
node: invariant(!isReference(value), "Missing selection set for object of type " + getTypenameFromStoreObject(store, value) + " returned for query field " + field.name.value)
|
|
46
51
|
},
|
|
47
52
|
|
|
48
|
-
8: {
|
|
49
|
-
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
50
|
-
node: new InvariantError("Could not identify object " + JSON.stringify(result))
|
|
51
|
-
},
|
|
52
|
-
|
|
53
53
|
9: {
|
|
54
54
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
55
|
-
node: new InvariantError("
|
|
55
|
+
node: new InvariantError("Could not identify object " + JSON.stringify(result))
|
|
56
56
|
},
|
|
57
57
|
|
|
58
58
|
10: {
|
|
@@ -78,68 +78,78 @@
|
|
|
78
78
|
},
|
|
79
79
|
|
|
80
80
|
13: {
|
|
81
|
+
file: "@apollo/client/core/ObservableQuery.js",
|
|
82
|
+
node: invariant(pollInterval, 'Attempted to start a polling query without a polling interval.')
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
14: {
|
|
81
86
|
file: "@apollo/client/core/QueryManager.js",
|
|
82
87
|
node: new InvariantError('QueryManager stopped while query was in flight')
|
|
83
88
|
},
|
|
84
89
|
|
|
85
|
-
|
|
90
|
+
15: {
|
|
86
91
|
file: "@apollo/client/core/QueryManager.js",
|
|
87
92
|
node: invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.')
|
|
88
93
|
},
|
|
89
94
|
|
|
90
|
-
|
|
95
|
+
16: {
|
|
91
96
|
file: "@apollo/client/core/QueryManager.js",
|
|
92
97
|
node: 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.")
|
|
93
98
|
},
|
|
94
99
|
|
|
95
|
-
|
|
100
|
+
17: {
|
|
96
101
|
file: "@apollo/client/core/QueryManager.js",
|
|
97
102
|
|
|
98
103
|
node: invariant(options.query, 'query option is required. You must specify your GraphQL document ' +
|
|
99
104
|
'in the query option.')
|
|
100
105
|
},
|
|
101
106
|
|
|
102
|
-
|
|
107
|
+
18: {
|
|
103
108
|
file: "@apollo/client/core/QueryManager.js",
|
|
104
109
|
node: invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.')
|
|
105
110
|
},
|
|
106
111
|
|
|
107
|
-
|
|
112
|
+
19: {
|
|
108
113
|
file: "@apollo/client/core/QueryManager.js",
|
|
109
114
|
node: invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.')
|
|
110
115
|
},
|
|
111
116
|
|
|
112
|
-
|
|
117
|
+
20: {
|
|
113
118
|
file: "@apollo/client/core/QueryManager.js",
|
|
114
119
|
node: invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.')
|
|
115
120
|
},
|
|
116
121
|
|
|
117
|
-
|
|
122
|
+
21: {
|
|
118
123
|
file: "@apollo/client/core/QueryManager.js",
|
|
119
124
|
node: new InvariantError('Store reset while query was in flight (not completed in link chain)')
|
|
120
125
|
},
|
|
121
126
|
|
|
122
|
-
|
|
123
|
-
file: "@apollo/client/
|
|
124
|
-
node: invariant(
|
|
127
|
+
22: {
|
|
128
|
+
file: "@apollo/client/errors/index.js",
|
|
129
|
+
node: invariant("boolean" === typeof DEV, DEV)
|
|
125
130
|
},
|
|
126
131
|
|
|
127
|
-
|
|
132
|
+
23: {
|
|
128
133
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
129
134
|
node: new InvariantError('request is not implemented')
|
|
130
135
|
},
|
|
131
136
|
|
|
132
|
-
|
|
137
|
+
24: {
|
|
138
|
+
file: "@apollo/client/link/core/index.js",
|
|
139
|
+
node: invariant("boolean" === typeof DEV, DEV)
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
25: {
|
|
133
143
|
file: "@apollo/client/link/http/checkFetcher.js",
|
|
134
144
|
node: new InvariantError("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n ")
|
|
135
145
|
},
|
|
136
146
|
|
|
137
|
-
|
|
147
|
+
26: {
|
|
138
148
|
file: "@apollo/client/link/http/serializeFetchParameter.js",
|
|
139
149
|
node: new InvariantError("Network request failed. " + label + " is not serializable: " + e.message)
|
|
140
150
|
},
|
|
141
151
|
|
|
142
|
-
|
|
152
|
+
27: {
|
|
143
153
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
144
154
|
|
|
145
155
|
node: invariant(options && (typeof options.sha256 === 'function' ||
|
|
@@ -148,31 +158,31 @@
|
|
|
148
158
|
'parameter.')
|
|
149
159
|
},
|
|
150
160
|
|
|
151
|
-
|
|
161
|
+
28: {
|
|
152
162
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
153
163
|
node: invariant(forward, 'PersistedQueryLink cannot be the last link in the chain.')
|
|
154
164
|
},
|
|
155
165
|
|
|
156
|
-
|
|
166
|
+
29: {
|
|
157
167
|
file: "@apollo/client/link/utils/validateOperation.js",
|
|
158
168
|
node: new InvariantError("illegal argument: " + key)
|
|
159
169
|
},
|
|
160
170
|
|
|
161
|
-
|
|
171
|
+
30: {
|
|
162
172
|
file: "@apollo/client/react/context/ApolloConsumer.js",
|
|
163
173
|
|
|
164
174
|
node: invariant(context && context.client, 'Could not find "client" in the context of ApolloConsumer. ' +
|
|
165
175
|
'Wrap the root component in an <ApolloProvider>.')
|
|
166
176
|
},
|
|
167
177
|
|
|
168
|
-
|
|
178
|
+
31: {
|
|
169
179
|
file: "@apollo/client/react/context/ApolloProvider.js",
|
|
170
180
|
|
|
171
181
|
node: invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
|
|
172
182
|
'sure you pass in your client via the "client" prop.')
|
|
173
183
|
},
|
|
174
184
|
|
|
175
|
-
|
|
185
|
+
32: {
|
|
176
186
|
file: "@apollo/client/react/data/OperationData.js",
|
|
177
187
|
|
|
178
188
|
node: invariant(!!client, 'Could not find "client" in the context or passed in as an option. ' +
|
|
@@ -180,35 +190,40 @@
|
|
|
180
190
|
'ApolloClient instance in via options.')
|
|
181
191
|
},
|
|
182
192
|
|
|
183
|
-
|
|
193
|
+
33: {
|
|
184
194
|
file: "@apollo/client/react/data/OperationData.js",
|
|
185
195
|
|
|
186
196
|
node: invariant(operation.type === type, "Running a " + requiredOperationName + " requires a graphql " +
|
|
187
197
|
(requiredOperationName + ", but a " + usedOperationName + " was used instead."))
|
|
188
198
|
},
|
|
189
199
|
|
|
190
|
-
|
|
200
|
+
34: {
|
|
191
201
|
file: "@apollo/client/react/hoc/hoc-utils.js",
|
|
192
202
|
|
|
193
203
|
node: invariant(this.withRef, "To access the wrapped instance, you need to specify " +
|
|
194
204
|
"{ withRef: true } in the options")
|
|
195
205
|
},
|
|
196
206
|
|
|
197
|
-
|
|
207
|
+
35: {
|
|
198
208
|
file: "@apollo/client/react/hoc/withApollo.js",
|
|
199
209
|
|
|
200
210
|
node: invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " +
|
|
201
211
|
"{ withRef: true } in the options")
|
|
202
212
|
},
|
|
203
213
|
|
|
204
|
-
|
|
214
|
+
36: {
|
|
205
215
|
file: "@apollo/client/react/hooks/useApolloClient.js",
|
|
206
216
|
|
|
207
217
|
node: invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +
|
|
208
218
|
'have called `ApolloProvider` higher up in your tree.')
|
|
209
219
|
},
|
|
210
220
|
|
|
211
|
-
|
|
221
|
+
37: {
|
|
222
|
+
file: "@apollo/client/react/index.js",
|
|
223
|
+
node: invariant("boolean" === typeof DEV, DEV)
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
38: {
|
|
212
227
|
file: "@apollo/client/react/parser/index.js",
|
|
213
228
|
|
|
214
229
|
node: invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " +
|
|
@@ -216,7 +231,7 @@
|
|
|
216
231
|
"to convert your operation into a document")
|
|
217
232
|
},
|
|
218
233
|
|
|
219
|
-
|
|
234
|
+
39: {
|
|
220
235
|
file: "@apollo/client/react/parser/index.js",
|
|
221
236
|
|
|
222
237
|
node: invariant(!fragments.length ||
|
|
@@ -224,7 +239,7 @@
|
|
|
224
239
|
"You must include a query, subscription or mutation as well")
|
|
225
240
|
},
|
|
226
241
|
|
|
227
|
-
|
|
242
|
+
40: {
|
|
228
243
|
file: "@apollo/client/react/parser/index.js",
|
|
229
244
|
|
|
230
245
|
node: invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " +
|
|
@@ -233,7 +248,7 @@
|
|
|
233
248
|
"You can use 'compose' to join multiple operation types to a component")
|
|
234
249
|
},
|
|
235
250
|
|
|
236
|
-
|
|
251
|
+
41: {
|
|
237
252
|
file: "@apollo/client/react/parser/index.js",
|
|
238
253
|
|
|
239
254
|
node: invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " +
|
|
@@ -241,86 +256,91 @@
|
|
|
241
256
|
"You can use 'compose' to join multiple operation types to a component")
|
|
242
257
|
},
|
|
243
258
|
|
|
244
|
-
|
|
259
|
+
42: {
|
|
260
|
+
file: "@apollo/client/testing/index.js",
|
|
261
|
+
node: invariant("boolean" === typeof DEV, DEV)
|
|
262
|
+
},
|
|
263
|
+
|
|
264
|
+
43: {
|
|
245
265
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
246
266
|
node: invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive.")
|
|
247
267
|
},
|
|
248
268
|
|
|
249
|
-
|
|
269
|
+
44: {
|
|
250
270
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
251
271
|
node: invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive.")
|
|
252
272
|
},
|
|
253
273
|
|
|
254
|
-
|
|
274
|
+
45: {
|
|
255
275
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
256
276
|
node: invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive.")
|
|
257
277
|
},
|
|
258
278
|
|
|
259
|
-
|
|
279
|
+
46: {
|
|
260
280
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
261
281
|
|
|
262
282
|
node: invariant(ifValue &&
|
|
263
283
|
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value.")
|
|
264
284
|
},
|
|
265
285
|
|
|
266
|
-
|
|
286
|
+
47: {
|
|
267
287
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
268
288
|
|
|
269
289
|
node: new InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " +
|
|
270
290
|
'No operations are allowed when using a fragment as a query. Only fragments are allowed.')
|
|
271
291
|
},
|
|
272
292
|
|
|
273
|
-
|
|
293
|
+
48: {
|
|
274
294
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
275
295
|
node: invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")
|
|
276
296
|
},
|
|
277
297
|
|
|
278
|
-
|
|
298
|
+
49: {
|
|
279
299
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
280
300
|
node: invariant(fragment, "No fragment named " + selection.name.value + ".")
|
|
281
301
|
},
|
|
282
302
|
|
|
283
|
-
|
|
303
|
+
50: {
|
|
284
304
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
285
305
|
node: 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")
|
|
286
306
|
},
|
|
287
307
|
|
|
288
|
-
|
|
308
|
+
51: {
|
|
289
309
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
290
310
|
node: new InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"")
|
|
291
311
|
},
|
|
292
312
|
|
|
293
|
-
|
|
313
|
+
52: {
|
|
294
314
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
295
315
|
node: invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations")
|
|
296
316
|
},
|
|
297
317
|
|
|
298
|
-
|
|
318
|
+
53: {
|
|
299
319
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
300
320
|
node: invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.')
|
|
301
321
|
},
|
|
302
322
|
|
|
303
|
-
|
|
323
|
+
54: {
|
|
304
324
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
305
325
|
node: 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")
|
|
306
326
|
},
|
|
307
327
|
|
|
308
|
-
|
|
328
|
+
55: {
|
|
309
329
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
310
330
|
node: invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.')
|
|
311
331
|
},
|
|
312
332
|
|
|
313
|
-
|
|
333
|
+
56: {
|
|
314
334
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
315
335
|
node: invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.')
|
|
316
336
|
},
|
|
317
337
|
|
|
318
|
-
|
|
338
|
+
57: {
|
|
319
339
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
320
340
|
node: new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.')
|
|
321
341
|
},
|
|
322
342
|
|
|
323
|
-
|
|
343
|
+
58: {
|
|
324
344
|
file: "@apollo/client/utilities/graphql/storeUtils.js",
|
|
325
345
|
|
|
326
346
|
node: new InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" +
|
|
@@ -328,7 +348,12 @@
|
|
|
328
348
|
'overcome this limitation.')
|
|
329
349
|
},
|
|
330
350
|
|
|
331
|
-
|
|
351
|
+
59: {
|
|
352
|
+
file: "@apollo/client/utilities/index.js",
|
|
353
|
+
node: invariant("boolean" === typeof DEV, DEV)
|
|
354
|
+
},
|
|
355
|
+
|
|
356
|
+
60: {
|
|
332
357
|
file: "@apollo/client/utilities/testing/mocking/mockLink.js",
|
|
333
358
|
node: invariant(queryWithoutConnection, "query is required")
|
|
334
359
|
}
|
|
@@ -11,10 +11,13 @@ function setContext(setter) {
|
|
|
11
11
|
var request = tslib.__rest(operation, []);
|
|
12
12
|
return new utilities.Observable(function (observer) {
|
|
13
13
|
var handle;
|
|
14
|
+
var closed = false;
|
|
14
15
|
Promise.resolve(request)
|
|
15
16
|
.then(function (req) { return setter(req, operation.getContext()); })
|
|
16
17
|
.then(operation.setContext)
|
|
17
18
|
.then(function () {
|
|
19
|
+
if (closed)
|
|
20
|
+
return;
|
|
18
21
|
handle = forward(operation).subscribe({
|
|
19
22
|
next: observer.next.bind(observer),
|
|
20
23
|
error: observer.error.bind(observer),
|
|
@@ -23,6 +26,7 @@ function setContext(setter) {
|
|
|
23
26
|
})
|
|
24
27
|
.catch(observer.error.bind(observer));
|
|
25
28
|
return function () {
|
|
29
|
+
closed = true;
|
|
26
30
|
if (handle)
|
|
27
31
|
handle.unsubscribe();
|
|
28
32
|
};
|