@apollo/client 3.6.9 → 3.6.10

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.
Files changed (58) hide show
  1. package/README.md +3 -0
  2. package/apollo-client.cjs +31 -17
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/cache.cjs +10 -6
  6. package/cache/cache.cjs.map +1 -1
  7. package/cache/cache.cjs.native.js +10 -6
  8. package/cache/core/types/common.d.ts +1 -1
  9. package/cache/core/types/common.d.ts.map +1 -1
  10. package/cache/core/types/common.js +11 -6
  11. package/cache/core/types/common.js.map +1 -1
  12. package/cache/index.d.ts +1 -1
  13. package/cache/index.d.ts.map +1 -1
  14. package/cache/index.js.map +1 -1
  15. package/core/core.cjs +1 -1
  16. package/core/core.cjs.map +1 -1
  17. package/core/core.cjs.native.js +1 -1
  18. package/core/types.d.ts.map +1 -1
  19. package/core/types.js.map +1 -1
  20. package/invariantErrorCodes.js +1 -1
  21. package/link/http/http.cjs +11 -3
  22. package/link/http/http.cjs.map +1 -1
  23. package/link/http/http.cjs.native.js +11 -3
  24. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  25. package/link/http/parseAndCheckHttpResponse.js +11 -3
  26. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  27. package/package.json +38 -30
  28. package/react/hooks/hooks.cjs +9 -7
  29. package/react/hooks/hooks.cjs.map +1 -1
  30. package/react/hooks/hooks.cjs.native.js +9 -7
  31. package/react/hooks/useMutation.d.ts.map +1 -1
  32. package/react/hooks/useMutation.js +8 -6
  33. package/react/hooks/useMutation.js.map +1 -1
  34. package/react/hooks/useQuery.d.ts.map +1 -1
  35. package/react/hooks/useQuery.js +1 -1
  36. package/react/hooks/useQuery.js.map +1 -1
  37. package/react/ssr/getDataFromTree.d.ts.map +1 -1
  38. package/react/ssr/getDataFromTree.js +3 -2
  39. package/react/ssr/getDataFromTree.js.map +1 -1
  40. package/react/ssr/renderToStringWithData.d.ts.map +1 -1
  41. package/react/ssr/renderToStringWithData.js +2 -1
  42. package/react/ssr/renderToStringWithData.js.map +1 -1
  43. package/react/ssr/ssr.cjs +4 -3
  44. package/react/ssr/ssr.cjs.map +1 -1
  45. package/react/ssr/ssr.cjs.native.js +4 -3
  46. package/react/types/types.d.ts +2 -3
  47. package/react/types/types.d.ts.map +1 -1
  48. package/react/types/types.js.map +1 -1
  49. package/testing/core/core.cjs +1 -1
  50. package/testing/core/core.cjs.map +1 -1
  51. package/testing/core/core.cjs.native.js +1 -1
  52. package/testing/core/itAsync.d.ts +3 -3
  53. package/testing/core/itAsync.d.ts.map +1 -1
  54. package/testing/core/mocking/mockLink.js +1 -1
  55. package/testing/core/mocking/mockLink.js.map +1 -1
  56. package/utilities/graphql/storeUtils.d.ts +1 -1
  57. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  58. package/version.js +1 -1
@@ -15,7 +15,7 @@ var utils = require('../link/utils');
15
15
  var tsInvariant = require('ts-invariant');
16
16
  var graphqlTag = require('graphql-tag');
17
17
 
18
- var version = '3.6.9';
18
+ var version = '3.6.10';
19
19
 
20
20
  exports.NetworkStatus = void 0;
21
21
  (function (NetworkStatus) {
@@ -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,CA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AAK,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.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 // 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"]}
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 /**\n * A list of any errors that occurred during server-side execution of a GraphQL operation.\n * See https://www.apollographql.com/docs/react/data/error-handling/ for more information.\n */\n errors?: ReadonlyArray<GraphQLError>;\n /**\n * The single Error object that is passed to onError and useQuery hooks, and is often thrown during manual `client.query` calls. \n * This will contain both a NetworkError field and any GraphQLErrors.\n * See https://www.apollographql.com/docs/react/data/error-handling/ for more information.\n */\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"]}
@@ -5,7 +5,7 @@
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.6.9",
8
+ "@apollo/client version": "3.6.10",
9
9
 
10
10
  1: {
11
11
  file: "@apollo/client/cache/inmemory/entityStore.js",
@@ -14,6 +14,17 @@ function parseAndCheckHttpResponse(operations) {
14
14
  return function (response) { return response
15
15
  .text()
16
16
  .then(function (bodyText) {
17
+ if (response.status >= 300) {
18
+ var getResult = function () {
19
+ try {
20
+ return JSON.parse(bodyText);
21
+ }
22
+ catch (err) {
23
+ return bodyText;
24
+ }
25
+ };
26
+ utils.throwServerError(response, getResult(), "Response not successful: Received status code ".concat(response.status));
27
+ }
17
28
  try {
18
29
  return JSON.parse(bodyText);
19
30
  }
@@ -27,9 +38,6 @@ function parseAndCheckHttpResponse(operations) {
27
38
  }
28
39
  })
29
40
  .then(function (result) {
30
- if (response.status >= 300) {
31
- utils.throwServerError(response, result, "Response not successful: Received status code ".concat(response.status));
32
- }
33
41
  if (!Array.isArray(result) &&
34
42
  !hasOwnProperty.call(result, 'data') &&
35
43
  !hasOwnProperty.call(result, 'errors')) {
@@ -1 +1 @@
1
- {"version":3,"file":"http.cjs","sources":["parseAndCheckHttpResponse.js","serializeFetchParameter.js","selectHttpOptionsAndBody.js","checkFetcher.js","createSignalIfSupported.js","selectURI.js","rewriteURIForGET.js","createHttpLink.js","HttpLink.js"],"sourcesContent":["import { throwServerError } from '../utils';\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nexport function parseAndCheckHttpResponse(operations) {\n return function (response) { return response\n .text()\n .then(function (bodyText) {\n try {\n return JSON.parse(bodyText);\n }\n catch (err) {\n var parseError = err;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n throw parseError;\n }\n })\n .then(function (result) {\n if (response.status >= 300) {\n throwServerError(response, result, \"Response not successful: Received status code \".concat(response.status));\n }\n if (!Array.isArray(result) &&\n !hasOwnProperty.call(result, 'data') &&\n !hasOwnProperty.call(result, 'errors')) {\n throwServerError(response, result, \"Server response was missing for query '\".concat(Array.isArray(operations)\n ? operations.map(function (op) { return op.operationName; })\n : operations.operationName, \"'.\"));\n }\n return result;\n }); };\n}\n//# sourceMappingURL=parseAndCheckHttpResponse.js.map","import { InvariantError } from '../../utilities/globals';\nexport var serializeFetchParameter = function (p, label) {\n var serialized;\n try {\n serialized = JSON.stringify(p);\n }\n catch (e) {\n var parseError = __DEV__ ? new InvariantError(\"Network request failed. \".concat(label, \" is not serializable: \").concat(e.message)) : new InvariantError(21);\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n//# sourceMappingURL=serializeFetchParameter.js.map","import { __assign, __spreadArray } from \"tslib\";\nimport { print } from 'graphql';\n;\nvar defaultHttpOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\nvar defaultHeaders = {\n accept: '*/*',\n 'content-type': 'application/json',\n};\nvar defaultOptions = {\n method: 'POST',\n};\nexport var fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\nexport var defaultPrinter = function (ast, printer) { return printer(ast); };\nexport function selectHttpOptionsAndBody(operation, fallbackConfig) {\n var configs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n configs[_i - 2] = arguments[_i];\n }\n configs.unshift(fallbackConfig);\n return selectHttpOptionsAndBodyInternal.apply(void 0, __spreadArray([operation,\n defaultPrinter], configs, false));\n}\nexport function selectHttpOptionsAndBodyInternal(operation, printer) {\n var configs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n configs[_i - 2] = arguments[_i];\n }\n var options = {};\n var http = {};\n configs.forEach(function (config) {\n options = __assign(__assign(__assign({}, options), config.options), { headers: __assign(__assign({}, options.headers), headersToLowerCase(config.headers)) });\n if (config.credentials) {\n options.credentials = config.credentials;\n }\n http = __assign(__assign({}, http), config.http);\n });\n var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query;\n var body = { operationName: operationName, variables: variables };\n if (http.includeExtensions)\n body.extensions = extensions;\n if (http.includeQuery)\n body.query = printer(query, print);\n return {\n options: options,\n body: body,\n };\n}\n;\nfunction headersToLowerCase(headers) {\n if (headers) {\n var normalized_1 = Object.create(null);\n Object.keys(Object(headers)).forEach(function (name) {\n normalized_1[name.toLowerCase()] = headers[name];\n });\n return normalized_1;\n }\n return headers;\n}\n//# sourceMappingURL=selectHttpOptionsAndBody.js.map","import { InvariantError } from '../../utilities/globals';\nexport var checkFetcher = function (fetcher) {\n if (!fetcher && typeof fetch === 'undefined') {\n throw __DEV__ ? 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 \") : new InvariantError(20);\n }\n};\n//# sourceMappingURL=checkFetcher.js.map","export var createSignalIfSupported = function () {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n var controller = new AbortController();\n var signal = controller.signal;\n return { controller: controller, signal: signal };\n};\n//# sourceMappingURL=createSignalIfSupported.js.map","export var selectURI = function (operation, fallbackURI) {\n var context = operation.getContext();\n var contextURI = context.uri;\n if (contextURI) {\n return contextURI;\n }\n else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n }\n else {\n return fallbackURI || '/graphql';\n }\n};\n//# sourceMappingURL=selectURI.js.map","import { serializeFetchParameter } from './serializeFetchParameter';\nexport function rewriteURIForGET(chosenURI, body) {\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(\"\".concat(key, \"=\").concat(encodeURIComponent(value)));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = serializeFetchParameter(body.variables, 'Variables map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = serializeFetchParameter(body.extensions, 'Extensions map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n var fragment = '', preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}\n//# sourceMappingURL=rewriteURIForGET.js.map","import { __assign, __rest } from \"tslib\";\nimport '../../utilities/globals';\nimport { visit } from 'graphql';\nimport { ApolloLink } from '../core';\nimport { Observable } from '../../utilities';\nimport { serializeFetchParameter } from './serializeFetchParameter';\nimport { selectURI } from './selectURI';\nimport { parseAndCheckHttpResponse } from './parseAndCheckHttpResponse';\nimport { checkFetcher } from './checkFetcher';\nimport { selectHttpOptionsAndBodyInternal, defaultPrinter, fallbackHttpConfig } from './selectHttpOptionsAndBody';\nimport { createSignalIfSupported } from './createSignalIfSupported';\nimport { rewriteURIForGET } from './rewriteURIForGET';\nimport { fromError } from '../utils';\nimport { maybe } from '../../utilities';\nvar backupFetch = maybe(function () { return fetch; });\nexport var createHttpLink = function (linkOptions) {\n if (linkOptions === void 0) { linkOptions = {}; }\n var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, preferredFetch = linkOptions.fetch, _b = linkOptions.print, print = _b === void 0 ? defaultPrinter : _b, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, _c = linkOptions.includeUnusedVariables, includeUnusedVariables = _c === void 0 ? false : _c, requestOptions = __rest(linkOptions, [\"uri\", \"fetch\", \"print\", \"includeExtensions\", \"useGETForQueries\", \"includeUnusedVariables\"]);\n if (__DEV__) {\n checkFetcher(preferredFetch || backupFetch);\n }\n var linkConfig = {\n http: { includeExtensions: includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n return new ApolloLink(function (operation) {\n var chosenURI = selectURI(operation, uri);\n var context = operation.getContext();\n var clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;\n if (name_1) {\n clientAwarenessHeaders['apollographql-client-name'] = name_1;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n var contextHeaders = __assign(__assign({}, clientAwarenessHeaders), context.headers);\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n var _b = selectHttpOptionsAndBodyInternal(operation, print, fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body;\n if (body.variables && !includeUnusedVariables) {\n var unusedNames_1 = new Set(Object.keys(body.variables));\n visit(operation.query, {\n Variable: function (node, _key, parent) {\n if (parent && parent.kind !== 'VariableDefinition') {\n unusedNames_1.delete(node.name.value);\n }\n },\n });\n if (unusedNames_1.size) {\n body.variables = __assign({}, body.variables);\n unusedNames_1.forEach(function (name) {\n delete body.variables[name];\n });\n }\n }\n var controller;\n if (!options.signal) {\n var _c = createSignalIfSupported(), _controller = _c.controller, signal = _c.signal;\n controller = _controller;\n if (controller)\n options.signal = signal;\n }\n var definitionIsMutation = function (d) {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)) {\n options.method = 'GET';\n }\n if (options.method === 'GET') {\n var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError;\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n }\n else {\n try {\n options.body = serializeFetchParameter(body, 'Payload');\n }\n catch (parseError) {\n return fromError(parseError);\n }\n }\n return new Observable(function (observer) {\n var currentFetch = preferredFetch || maybe(function () { return fetch; }) || backupFetch;\n currentFetch(chosenURI, options)\n .then(function (response) {\n operation.setContext({ response: response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(function (result) {\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(function (err) {\n if (err.name === 'AbortError')\n return;\n if (err.result && err.result.errors && err.result.data) {\n observer.next(err.result);\n }\n observer.error(err);\n });\n return function () {\n if (controller)\n controller.abort();\n };\n });\n });\n};\n//# sourceMappingURL=createHttpLink.js.map","import { __extends } from \"tslib\";\nimport { ApolloLink } from '../core';\nimport { createHttpLink } from './createHttpLink';\nvar HttpLink = (function (_super) {\n __extends(HttpLink, _super);\n function HttpLink(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, createHttpLink(options).request) || this;\n _this.options = options;\n return _this;\n }\n return HttpLink;\n}(ApolloLink));\nexport { HttpLink };\n//# sourceMappingURL=HttpLink.js.map"],"names":["throwServerError","InvariantError","__spreadArray","__assign","print","maybe","__rest","ApolloLink","visit","fromError","Observable","__extends"],"mappings":";;;;;;;;;;;AACA,IAAI,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AAC9C,SAAS,yBAAyB,CAAC,UAAU,EAAE;AACtD,IAAI,OAAO,UAAU,QAAQ,EAAE,EAAE,OAAO,QAAQ;AAChD,SAAS,IAAI,EAAE;AACf,SAAS,IAAI,CAAC,UAAU,QAAQ,EAAE;AAClC,QAAQ,IAAI;AACZ,YAAY,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AACxC,SAAS;AACT,QAAQ,OAAO,GAAG,EAAE;AACpB,YAAY,IAAI,UAAU,GAAG,GA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AAC;AAChC,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC;AACpB,CAAC,CAACJ,eAAU,CAAC;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"http.cjs","sources":["parseAndCheckHttpResponse.js","serializeFetchParameter.js","selectHttpOptionsAndBody.js","checkFetcher.js","createSignalIfSupported.js","selectURI.js","rewriteURIForGET.js","createHttpLink.js","HttpLink.js"],"sourcesContent":["import { throwServerError } from '../utils';\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nexport function parseAndCheckHttpResponse(operations) {\n return function (response) { return response\n .text()\n .then(function (bodyText) {\n if (response.status >= 300) {\n var getResult = function () {\n try {\n return JSON.parse(bodyText);\n }\n catch (err) {\n return bodyText;\n }\n };\n throwServerError(response, getResult(), \"Response not successful: Received status code \".concat(response.status));\n }\n try {\n return JSON.parse(bodyText);\n }\n catch (err) {\n var parseError = err;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n throw parseError;\n }\n })\n .then(function (result) {\n if (!Array.isArray(result) &&\n !hasOwnProperty.call(result, 'data') &&\n !hasOwnProperty.call(result, 'errors')) {\n throwServerError(response, result, \"Server response was missing for query '\".concat(Array.isArray(operations)\n ? operations.map(function (op) { return op.operationName; })\n : operations.operationName, \"'.\"));\n }\n return result;\n }); };\n}\n//# sourceMappingURL=parseAndCheckHttpResponse.js.map","import { InvariantError } from '../../utilities/globals';\nexport var serializeFetchParameter = function (p, label) {\n var serialized;\n try {\n serialized = JSON.stringify(p);\n }\n catch (e) {\n var parseError = __DEV__ ? new InvariantError(\"Network request failed. \".concat(label, \" is not serializable: \").concat(e.message)) : new InvariantError(21);\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n//# sourceMappingURL=serializeFetchParameter.js.map","import { __assign, __spreadArray } from \"tslib\";\nimport { print } from 'graphql';\n;\nvar defaultHttpOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\nvar defaultHeaders = {\n accept: '*/*',\n 'content-type': 'application/json',\n};\nvar defaultOptions = {\n method: 'POST',\n};\nexport var fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\nexport var defaultPrinter = function (ast, printer) { return printer(ast); };\nexport function selectHttpOptionsAndBody(operation, fallbackConfig) {\n var configs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n configs[_i - 2] = arguments[_i];\n }\n configs.unshift(fallbackConfig);\n return selectHttpOptionsAndBodyInternal.apply(void 0, __spreadArray([operation,\n defaultPrinter], configs, false));\n}\nexport function selectHttpOptionsAndBodyInternal(operation, printer) {\n var configs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n configs[_i - 2] = arguments[_i];\n }\n var options = {};\n var http = {};\n configs.forEach(function (config) {\n options = __assign(__assign(__assign({}, options), config.options), { headers: __assign(__assign({}, options.headers), headersToLowerCase(config.headers)) });\n if (config.credentials) {\n options.credentials = config.credentials;\n }\n http = __assign(__assign({}, http), config.http);\n });\n var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query;\n var body = { operationName: operationName, variables: variables };\n if (http.includeExtensions)\n body.extensions = extensions;\n if (http.includeQuery)\n body.query = printer(query, print);\n return {\n options: options,\n body: body,\n };\n}\n;\nfunction headersToLowerCase(headers) {\n if (headers) {\n var normalized_1 = Object.create(null);\n Object.keys(Object(headers)).forEach(function (name) {\n normalized_1[name.toLowerCase()] = headers[name];\n });\n return normalized_1;\n }\n return headers;\n}\n//# sourceMappingURL=selectHttpOptionsAndBody.js.map","import { InvariantError } from '../../utilities/globals';\nexport var checkFetcher = function (fetcher) {\n if (!fetcher && typeof fetch === 'undefined') {\n throw __DEV__ ? 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 \") : new InvariantError(20);\n }\n};\n//# sourceMappingURL=checkFetcher.js.map","export var createSignalIfSupported = function () {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n var controller = new AbortController();\n var signal = controller.signal;\n return { controller: controller, signal: signal };\n};\n//# sourceMappingURL=createSignalIfSupported.js.map","export var selectURI = function (operation, fallbackURI) {\n var context = operation.getContext();\n var contextURI = context.uri;\n if (contextURI) {\n return contextURI;\n }\n else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n }\n else {\n return fallbackURI || '/graphql';\n }\n};\n//# sourceMappingURL=selectURI.js.map","import { serializeFetchParameter } from './serializeFetchParameter';\nexport function rewriteURIForGET(chosenURI, body) {\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(\"\".concat(key, \"=\").concat(encodeURIComponent(value)));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = serializeFetchParameter(body.variables, 'Variables map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = serializeFetchParameter(body.extensions, 'Extensions map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n var fragment = '', preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}\n//# sourceMappingURL=rewriteURIForGET.js.map","import { __assign, __rest } from \"tslib\";\nimport '../../utilities/globals';\nimport { visit } from 'graphql';\nimport { ApolloLink } from '../core';\nimport { Observable } from '../../utilities';\nimport { serializeFetchParameter } from './serializeFetchParameter';\nimport { selectURI } from './selectURI';\nimport { parseAndCheckHttpResponse } from './parseAndCheckHttpResponse';\nimport { checkFetcher } from './checkFetcher';\nimport { selectHttpOptionsAndBodyInternal, defaultPrinter, fallbackHttpConfig } from './selectHttpOptionsAndBody';\nimport { createSignalIfSupported } from './createSignalIfSupported';\nimport { rewriteURIForGET } from './rewriteURIForGET';\nimport { fromError } from '../utils';\nimport { maybe } from '../../utilities';\nvar backupFetch = maybe(function () { return fetch; });\nexport var createHttpLink = function (linkOptions) {\n if (linkOptions === void 0) { linkOptions = {}; }\n var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, preferredFetch = linkOptions.fetch, _b = linkOptions.print, print = _b === void 0 ? defaultPrinter : _b, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, _c = linkOptions.includeUnusedVariables, includeUnusedVariables = _c === void 0 ? false : _c, requestOptions = __rest(linkOptions, [\"uri\", \"fetch\", \"print\", \"includeExtensions\", \"useGETForQueries\", \"includeUnusedVariables\"]);\n if (__DEV__) {\n checkFetcher(preferredFetch || backupFetch);\n }\n var linkConfig = {\n http: { includeExtensions: includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n return new ApolloLink(function (operation) {\n var chosenURI = selectURI(operation, uri);\n var context = operation.getContext();\n var clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;\n if (name_1) {\n clientAwarenessHeaders['apollographql-client-name'] = name_1;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n var contextHeaders = __assign(__assign({}, clientAwarenessHeaders), context.headers);\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n var _b = selectHttpOptionsAndBodyInternal(operation, print, fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body;\n if (body.variables && !includeUnusedVariables) {\n var unusedNames_1 = new Set(Object.keys(body.variables));\n visit(operation.query, {\n Variable: function (node, _key, parent) {\n if (parent && parent.kind !== 'VariableDefinition') {\n unusedNames_1.delete(node.name.value);\n }\n },\n });\n if (unusedNames_1.size) {\n body.variables = __assign({}, body.variables);\n unusedNames_1.forEach(function (name) {\n delete body.variables[name];\n });\n }\n }\n var controller;\n if (!options.signal) {\n var _c = createSignalIfSupported(), _controller = _c.controller, signal = _c.signal;\n controller = _controller;\n if (controller)\n options.signal = signal;\n }\n var definitionIsMutation = function (d) {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)) {\n options.method = 'GET';\n }\n if (options.method === 'GET') {\n var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError;\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n }\n else {\n try {\n options.body = serializeFetchParameter(body, 'Payload');\n }\n catch (parseError) {\n return fromError(parseError);\n }\n }\n return new Observable(function (observer) {\n var currentFetch = preferredFetch || maybe(function () { return fetch; }) || backupFetch;\n currentFetch(chosenURI, options)\n .then(function (response) {\n operation.setContext({ response: response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(function (result) {\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(function (err) {\n if (err.name === 'AbortError')\n return;\n if (err.result && err.result.errors && err.result.data) {\n observer.next(err.result);\n }\n observer.error(err);\n });\n return function () {\n if (controller)\n controller.abort();\n };\n });\n });\n};\n//# sourceMappingURL=createHttpLink.js.map","import { __extends } from \"tslib\";\nimport { ApolloLink } from '../core';\nimport { createHttpLink } from './createHttpLink';\nvar HttpLink = (function (_super) {\n __extends(HttpLink, _super);\n function HttpLink(options) {\n if (options === void 0) { options = {}; }\n var _this = _super.call(this, createHttpLink(options).request) || this;\n _this.options = options;\n return _this;\n }\n return HttpLink;\n}(ApolloLink));\nexport { HttpLink };\n//# sourceMappingURL=HttpLink.js.map"],"names":["throwServerError","InvariantError","__spreadArray","__assign","print","maybe","__rest","ApolloLink","visit","fromError","Observable","__extends"],"mappings":";;;;;;;;;;;AACA,IAAI,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AAC9C,SAAS,yBAAyB,CAAC,UAAU,EAAE;AACtD,IAAI,OAAO,UAAU,QAAQ,EAAE,EAAE,OAAO,QAAQ;AAChD,SAAS,IAAI,EAAE;AACf,SAAS,IAAI,CAAC,UAAU,QAAQ,EAAE;AAClC,QAAQ,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE;AACpC,YAAY,IAAI,SAAS,GAAG,YAAY;AACxC,gBAAgB,IAAI;AACpB,oBAAoB,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAChD,iBAAiB;AACjB,gBAAgB,OAAO,GAAG,EAAE;AAC5B,oBAAoB,OAAO,QAAQ,CAAC;AACpC,iBAAiB;AACjB,aAAa,CAAC;AACd,YAAYA,sBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,gDAAgD,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9H,SAAS;AACT,QAAQ,IAAI;AACZ,YAAY,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AACxC,SAAS;AACT,QAAQ,OAAO,GAAG,EAAE;AACpB,YAAY,IAAI,UAAU,GAAG,GAAG,CAAC;AACjC,YAAY,UAAU,CAAC,IAAI,GAAG,kBAAkB,CAAC;AACjD,YAAY,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC3C,YAAY,UAAU,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;AACpD,YAAY,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC3C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M,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE;AACxE,oBAAoB,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC9C,iBAAiB;AACjB,gBAAgB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACpC,aAAa,CAAC,CAAC;AACf,YAAY,OAAO,YAAY;AAC/B,gBAAgB,IAAI,UAAU;AAC9B,oBAAoB,UAAU,CAAC,KAAK,EAAE,CAAC;AACvC,aAAa,CAAC;AACd,SAAS,CAAC,CAAC;AACX,KAAK,CAAC,CAAC;AACP;;ACrHG,IAAC,QAAQ,IAAI,UAAU,MAAM,EAAE;AAClC,IAAIM,eAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChC,IAAI,SAAS,QAAQ,CAAC,OAAO,EAAE;AAC/B,QAAQ,IAAI,OAAO,KAAK,KAAK,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,CAAC,EAAE;AACjD,QAAQ,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;AAC/E,QAAQ,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;AAChC,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC;AACpB,CAAC,CAACJ,eAAU,CAAC;;;;;;;;;;;;;;;"}
@@ -14,6 +14,17 @@ function parseAndCheckHttpResponse(operations) {
14
14
  return function (response) { return response
15
15
  .text()
16
16
  .then(function (bodyText) {
17
+ if (response.status >= 300) {
18
+ var getResult = function () {
19
+ try {
20
+ return JSON.parse(bodyText);
21
+ }
22
+ catch (err) {
23
+ return bodyText;
24
+ }
25
+ };
26
+ utils.throwServerError(response, getResult(), "Response not successful: Received status code ".concat(response.status));
27
+ }
17
28
  try {
18
29
  return JSON.parse(bodyText);
19
30
  }
@@ -27,9 +38,6 @@ function parseAndCheckHttpResponse(operations) {
27
38
  }
28
39
  })
29
40
  .then(function (result) {
30
- if (response.status >= 300) {
31
- utils.throwServerError(response, result, "Response not successful: Received status code ".concat(response.status));
32
- }
33
41
  if (!Array.isArray(result) &&
34
42
  !hasOwnProperty.call(result, 'data') &&
35
43
  !hasOwnProperty.call(result, 'errors')) {
@@ -1 +1 @@
1
- {"version":3,"file":"parseAndCheckHttpResponse.d.ts","sourceRoot":"","sources":["../../../src/link/http/parseAndCheckHttpResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKpC,oBAAY,gBAAgB,GAAG,KAAK,GAAG;IACrC,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,SAAS,GAAG,SAAS,EAAE,cAEjB,QAAQ,kBA0C3B"}
1
+ {"version":3,"file":"parseAndCheckHttpResponse.d.ts","sourceRoot":"","sources":["../../../src/link/http/parseAndCheckHttpResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKpC,oBAAY,gBAAgB,GAAG,KAAK,GAAG;IACrC,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,SAAS,GAAG,SAAS,EAAE,cAEjB,QAAQ,kBAiD3B"}
@@ -4,6 +4,17 @@ export function parseAndCheckHttpResponse(operations) {
4
4
  return function (response) { return response
5
5
  .text()
6
6
  .then(function (bodyText) {
7
+ if (response.status >= 300) {
8
+ var getResult = function () {
9
+ try {
10
+ return JSON.parse(bodyText);
11
+ }
12
+ catch (err) {
13
+ return bodyText;
14
+ }
15
+ };
16
+ throwServerError(response, getResult(), "Response not successful: Received status code ".concat(response.status));
17
+ }
7
18
  try {
8
19
  return JSON.parse(bodyText);
9
20
  }
@@ -17,9 +28,6 @@ export function parseAndCheckHttpResponse(operations) {
17
28
  }
18
29
  })
19
30
  .then(function (result) {
20
- if (response.status >= 300) {
21
- throwServerError(response, result, "Response not successful: Received status code ".concat(response.status));
22
- }
23
31
  if (!Array.isArray(result) &&
24
32
  !hasOwnProperty.call(result, 'data') &&
25
33
  !hasOwnProperty.call(result, 'errors')) {
@@ -1 +1 @@
1
- {"version":3,"file":"parseAndCheckHttpResponse.js","sourceRoot":"","sources":["../../../src/link/http/parseAndCheckHttpResponse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEpC,IAAA,cAAc,GAAK,MAAM,CAAC,SAAS,eAArB,CAAsB;AAQ5C,MAAM,UAAU,yBAAyB,CACvC,UAAmC;IAEnC,OAAO,UAAC,QAAkB,IAAK,OAAA,QAAQ;SACpC,IAAI,EAAE;SACN,IAAI,CAAC,UAAA,QAAQ;QACZ,IAAI;YACF,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SAC7B;QAAC,OAAO,GAAG,EAAE;YACZ,IAAM,UAAU,GAAG,GAAuB,CAAC;YAC3C,UAAU,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrC,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC/B,UAAU,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;YACxC,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC/B,MAAM,UAAU,CAAC;SAClB;IACH,CAAC,CAAC;SACD,IAAI,CAAC,UAAC,MAAW;QAChB,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE;YAE1B,gBAAgB,CACd,QAAQ,EACR,MAAM,EACN,wDAAiD,QAAQ,CAAC,MAAM,CAAE,CACnE,CAAC;SACH;QAED,IACE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YACtB,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;YACpC,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,EACtC;YAEA,gBAAgB,CACd,QAAQ,EACR,MAAM,EACN,iDACE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;gBACvB,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,UAAA,EAAE,IAAI,OAAA,EAAE,CAAC,aAAa,EAAhB,CAAgB,CAAC;gBACxC,CAAC,CAAC,UAAU,CAAC,aAAa,OAC1B,CACL,CAAC;SACH;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,EAzC2B,CAyC3B,CAAC;AACP,CAAC","sourcesContent":["import { Operation } from '../core';\nimport { throwServerError } from '../utils';\n\nconst { hasOwnProperty } = Object.prototype;\n\nexport type ServerParseError = Error & {\n response: Response;\n statusCode: number;\n bodyText: string;\n};\n\nexport function parseAndCheckHttpResponse(\n operations: Operation | Operation[],\n) {\n return (response: Response) => response\n .text()\n .then(bodyText => {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n const parseError = err as ServerParseError;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n throw parseError;\n }\n })\n .then((result: any) => {\n if (response.status >= 300) {\n // Network error\n throwServerError(\n response,\n result,\n `Response not successful: Received status code ${response.status}`,\n );\n }\n\n if (\n !Array.isArray(result) &&\n !hasOwnProperty.call(result, 'data') &&\n !hasOwnProperty.call(result, 'errors')\n ) {\n // Data error\n throwServerError(\n response,\n result,\n `Server response was missing for query '${\n Array.isArray(operations)\n ? operations.map(op => op.operationName)\n : operations.operationName\n }'.`,\n );\n }\n return result;\n });\n}\n"]}
1
+ {"version":3,"file":"parseAndCheckHttpResponse.js","sourceRoot":"","sources":["../../../src/link/http/parseAndCheckHttpResponse.ts"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AC,UAAU,CAAC;gBACvB,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,UAAA,EAAE,IAAI,OAAA,EAAE,CAAC,aAAa,EAAhB,CAAgB,CAAC;gBACxC,CAAC,CAAC,UAAU,CAAC,aAAa,OAC1B,CACL,CAAC;SACH;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,EAhD2B,CAgD3B,CAAC;AACP,CAAC","sourcesContent":["import { Operation } from '../core';\nimport { throwServerError } from '../utils';\n\nconst { hasOwnProperty } = Object.prototype;\n\nexport type ServerParseError = Error & {\n response: Response;\n statusCode: number;\n bodyText: string;\n};\n\nexport function parseAndCheckHttpResponse(\n operations: Operation | Operation[],\n) {\n return (response: Response) => response\n .text()\n .then(bodyText => {\n if (response.status >= 300) {\n // Network error\n const getResult = () => {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n return bodyText\n }\n }\n throwServerError(\n response,\n getResult(),\n `Response not successful: Received status code ${response.status}`,\n );\n }\n\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n const parseError = err as ServerParseError;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n throw parseError;\n }\n })\n .then((result: any) => {\n if (\n !Array.isArray(result) &&\n !hasOwnProperty.call(result, 'data') &&\n !hasOwnProperty.call(result, 'errors')\n ) {\n // Data error\n throwServerError(\n response,\n result,\n `Server response was missing for query '${\n Array.isArray(operations)\n ? operations.map(op => op.operationName)\n : operations.operationName\n }'.`,\n );\n }\n return result;\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollo/client",
3
- "version": "3.6.9",
3
+ "version": "3.6.10",
4
4
  "description": "A fully-featured caching GraphQL client.",
5
5
  "private": false,
6
6
  "keywords": [
@@ -18,7 +18,8 @@
18
18
  "types": "./index.d.ts",
19
19
  "sideEffects": false,
20
20
  "react-native": {
21
- "./dist/cache/inmemory/fixPolyfills.js": "./cache/inmemory/fixPolyfills.native.js"
21
+ "./dist/cache/inmemory/fixPolyfills.js": "./cache/inmemory/fixPolyfills.native.js",
22
+ "react-dom/server": false
22
23
  },
23
24
  "repository": {
24
25
  "type": "git",
@@ -32,6 +33,7 @@
32
33
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0",
33
34
  "graphql-ws": "^5.5.5",
34
35
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
36
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
35
37
  "subscriptions-transport-ws": "^0.9.0 || ^0.11.0"
36
38
  },
37
39
  "peerDependenciesMeta": {
@@ -41,13 +43,16 @@
41
43
  "react": {
42
44
  "optional": true
43
45
  },
46
+ "react-dom": {
47
+ "optional": true
48
+ },
44
49
  "subscriptions-transport-ws": {
45
50
  "optional": true
46
51
  }
47
52
  },
48
53
  "dependencies": {
49
54
  "@graphql-typed-document-node/core": "^3.1.1",
50
- "@wry/context": "^0.6.0",
55
+ "@wry/context": "^0.7.0",
51
56
  "@wry/equality": "^0.5.0",
52
57
  "@wry/trie": "^0.3.0",
53
58
  "graphql-tag": "^2.12.6",
@@ -60,47 +65,50 @@
60
65
  "zen-observable-ts": "^1.2.5"
61
66
  },
62
67
  "devDependencies": {
63
- "@babel/parser": "7.18.5",
64
- "@graphql-tools/schema": "8.3.14",
68
+ "@babel/parser": "7.19.1",
69
+ "@graphql-tools/schema": "9.0.4",
65
70
  "@rollup/plugin-node-resolve": "11.2.1",
66
- "@testing-library/react": "12.1.5",
71
+ "@testing-library/react": "13.4.0",
72
+ "@testing-library/react-12": "npm:@testing-library/react@^12",
67
73
  "@testing-library/react-hooks": "8.0.1",
68
- "@testing-library/user-event": "14.2.1",
74
+ "@testing-library/user-event": "14.4.3",
69
75
  "@types/fast-json-stable-stringify": "2.0.0",
70
76
  "@types/fetch-mock": "7.3.5",
71
- "@types/glob": "7.2.0",
77
+ "@types/glob": "8.0.0",
72
78
  "@types/hoist-non-react-statics": "3.3.1",
73
- "@types/jest": "27.5.2",
74
- "@types/lodash": "4.14.182",
75
- "@types/node": "16.11.41",
76
- "@types/react": "17.0.47",
77
- "@types/react-dom": "17.0.17",
78
- "@types/use-sync-external-store": "^0.0.3",
79
- "acorn": "8.7.1",
79
+ "@types/jest": "29.0.3",
80
+ "@types/lodash": "4.14.185",
81
+ "@types/node": "16.11.60",
82
+ "@types/react": "18.0.21",
83
+ "@types/react-dom": "18.0.6",
84
+ "@types/use-sync-external-store": "0.0.3",
85
+ "acorn": "8.8.0",
80
86
  "bundlesize": "0.18.1",
81
87
  "cross-fetch": "3.1.5",
82
- "crypto-hash": "1.3.0",
83
88
  "fetch-mock": "9.11.0",
84
89
  "glob": "8.0.3",
85
- "graphql": "16.5.0",
86
- "graphql-ws": "5.9.0",
87
- "jest": "27.5.1",
88
- "jest-fetch-mock": "3.0.3",
89
- "jest-junit": "13.2.0",
90
+ "graphql": "16.6.0",
91
+ "graphql-ws": "5.11.2",
92
+ "jest": "29.0.3",
93
+ "jest-environment-jsdom": "29.0.3",
94
+ "jest-junit": "14.0.1",
90
95
  "lodash": "4.17.21",
91
- "react": "17.0.2",
92
- "react-dom": "17.0.2",
93
- "recast": "0.21.1",
96
+ "react": "18.2.0",
97
+ "react-17": "npm:react@^17",
98
+ "react-dom": "18.2.0",
99
+ "react-dom-17": "npm:react-dom@^17",
100
+ "recast": "0.21.2",
94
101
  "resolve": "1.22.1",
95
102
  "rimraf": "3.0.2",
96
- "rollup": "2.75.6",
103
+ "rollup": "2.79.1",
97
104
  "rollup-plugin-terser": "7.0.2",
98
- "rxjs": "7.5.5",
105
+ "rxjs": "7.5.6",
99
106
  "subscriptions-transport-ws": "0.11.0",
100
- "terser": "5.14.1",
101
- "ts-jest": "27.1.5",
102
- "ts-node": "10.8.1",
103
- "typescript": "4.6.4",
107
+ "terser": "5.15.0",
108
+ "ts-jest": "29.0.2",
109
+ "ts-node": "10.9.1",
110
+ "typedoc": "0.22.18",
111
+ "typescript": "4.7.4",
104
112
  "wait-for-observables": "1.0.3",
105
113
  "whatwg-fetch": "3.6.2"
106
114
  },
@@ -240,7 +240,7 @@ var InternalState = (function () {
240
240
  InternalState.prototype.createWatchQueryOptions = function (_a) {
241
241
  var _b;
242
242
  if (_a === void 0) { _a = {}; }
243
- var skip = _a.skip; _a.ssr; _a.onCompleted; _a.onError; _a.displayName; _a.defaultOptions; var otherOptions = tslib.__rest(_a, ["skip", "ssr", "onCompleted", "onError", "displayName", "defaultOptions"]);
243
+ var skip = _a.skip; _a.ssr; _a.onCompleted; _a.onError; _a.defaultOptions; var otherOptions = tslib.__rest(_a, ["skip", "ssr", "onCompleted", "onError", "defaultOptions"]);
244
244
  var watchQueryOptions = Object.assign(otherOptions, { query: this.query });
245
245
  if (this.renderPromises &&
246
246
  (watchQueryOptions.fetchPolicy === 'network-only' ||
@@ -424,7 +424,7 @@ function useMutation(mutation, options) {
424
424
  if (executeOptions === void 0) { executeOptions = {}; }
425
425
  var _a = ref.current, client = _a.client, options = _a.options, mutation = _a.mutation;
426
426
  var baseOptions = tslib.__assign(tslib.__assign({}, options), { mutation: mutation });
427
- if (!ref.current.result.loading && !baseOptions.ignoreResults) {
427
+ if (!ref.current.result.loading && !baseOptions.ignoreResults && ref.current.isMounted) {
428
428
  setResult(ref.current.result = {
429
429
  loading: true,
430
430
  error: void 0,
@@ -454,8 +454,8 @@ function useMutation(mutation, options) {
454
454
  setResult(ref.current.result = result_1);
455
455
  }
456
456
  }
457
- (_b = (_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, response.data);
458
- (_c = executeOptions.onCompleted) === null || _c === void 0 ? void 0 : _c.call(executeOptions, response.data);
457
+ (_b = (_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, response.data, clientOptions);
458
+ (_c = executeOptions.onCompleted) === null || _c === void 0 ? void 0 : _c.call(executeOptions, response.data, clientOptions);
459
459
  return response;
460
460
  }).catch(function (error) {
461
461
  var _a, _b, _c, _d;
@@ -473,15 +473,17 @@ function useMutation(mutation, options) {
473
473
  }
474
474
  }
475
475
  if (((_a = ref.current.options) === null || _a === void 0 ? void 0 : _a.onError) || clientOptions.onError) {
476
- (_c = (_b = ref.current.options) === null || _b === void 0 ? void 0 : _b.onError) === null || _c === void 0 ? void 0 : _c.call(_b, error);
477
- (_d = executeOptions.onError) === null || _d === void 0 ? void 0 : _d.call(executeOptions, error);
476
+ (_c = (_b = ref.current.options) === null || _b === void 0 ? void 0 : _b.onError) === null || _c === void 0 ? void 0 : _c.call(_b, error, clientOptions);
477
+ (_d = executeOptions.onError) === null || _d === void 0 ? void 0 : _d.call(executeOptions, error, clientOptions);
478
478
  return { data: void 0, errors: error };
479
479
  }
480
480
  throw error;
481
481
  });
482
482
  }, []);
483
483
  var reset = React.useCallback(function () {
484
- setResult({ called: false, loading: false, client: client });
484
+ if (ref.current.isMounted) {
485
+ setResult({ called: false, loading: false, client: client });
486
+ }
485
487
  }, []);
486
488
  React.useEffect(function () {
487
489
  ref.current.isMounted = true;