@apollo/client 3.4.5 → 3.4.9

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 (132) hide show
  1. package/apollo-client.cjs.js +1010 -114
  2. package/apollo-client.cjs.js.map +1 -1
  3. package/apollo-core.cjs.js +5772 -0
  4. package/apollo-core.cjs.js.map +1 -0
  5. package/apollo-core.cjs.min.js +1 -0
  6. package/cache/cache.cjs.js +22 -19
  7. package/cache/cache.cjs.js.map +1 -1
  8. package/cache/index.d.ts.map +1 -1
  9. package/cache/index.js +2 -3
  10. package/cache/index.js.map +1 -1
  11. package/cache/inmemory/entityStore.js +1 -1
  12. package/cache/inmemory/policies.js +12 -9
  13. package/cache/inmemory/policies.js.map +1 -1
  14. package/cache/inmemory/readFromStore.js +3 -3
  15. package/cache/inmemory/writeToStore.d.ts +1 -1
  16. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  17. package/cache/inmemory/writeToStore.js +4 -4
  18. package/cache/inmemory/writeToStore.js.map +1 -1
  19. package/core/ApolloClient.js +2 -2
  20. package/core/LocalState.js +1 -1
  21. package/core/ObservableQuery.d.ts +9 -6
  22. package/core/ObservableQuery.d.ts.map +1 -1
  23. package/core/ObservableQuery.js +70 -45
  24. package/core/ObservableQuery.js.map +1 -1
  25. package/core/QueryManager.d.ts +3 -3
  26. package/core/QueryManager.d.ts.map +1 -1
  27. package/core/QueryManager.js +20 -19
  28. package/core/QueryManager.js.map +1 -1
  29. package/core/core.cjs.js +94 -66
  30. package/core/core.cjs.js.map +1 -1
  31. package/core/index.d.ts.map +1 -1
  32. package/core/index.js +2 -1
  33. package/core/index.js.map +1 -1
  34. package/core/watchQueryOptions.d.ts +2 -1
  35. package/core/watchQueryOptions.d.ts.map +1 -1
  36. package/core/watchQueryOptions.js.map +1 -1
  37. package/errors/errors.cjs.js +1 -2
  38. package/errors/errors.cjs.js.map +1 -1
  39. package/errors/index.d.ts.map +1 -1
  40. package/errors/index.js +2 -3
  41. package/errors/index.js.map +1 -1
  42. package/invariantErrorCodes.js +59 -82
  43. package/link/core/ApolloLink.js +1 -1
  44. package/link/core/core.cjs.js +3 -3
  45. package/link/core/core.cjs.js.map +1 -1
  46. package/link/core/index.d.ts.map +1 -1
  47. package/link/core/index.js +2 -3
  48. package/link/core/index.js.map +1 -1
  49. package/link/http/checkFetcher.js +1 -1
  50. package/link/http/createHttpLink.d.ts.map +1 -1
  51. package/link/http/createHttpLink.js +7 -5
  52. package/link/http/createHttpLink.js.map +1 -1
  53. package/link/http/http.cjs.js +11 -8
  54. package/link/http/http.cjs.js.map +1 -1
  55. package/link/http/index.d.ts.map +1 -1
  56. package/link/http/index.js +2 -0
  57. package/link/http/index.js.map +1 -1
  58. package/link/http/serializeFetchParameter.js +1 -1
  59. package/link/persisted-queries/index.d.ts.map +1 -1
  60. package/link/persisted-queries/index.js +4 -2
  61. package/link/persisted-queries/index.js.map +1 -1
  62. package/link/persisted-queries/persisted-queries.cjs.js +4 -3
  63. package/link/persisted-queries/persisted-queries.cjs.js.map +1 -1
  64. package/link/utils/index.d.ts.map +1 -1
  65. package/link/utils/index.js +2 -0
  66. package/link/utils/index.js.map +1 -1
  67. package/link/utils/utils.cjs.js +3 -1
  68. package/link/utils/utils.cjs.js.map +1 -1
  69. package/link/utils/validateOperation.js +1 -1
  70. package/package.json +8 -8
  71. package/react/context/ApolloConsumer.js +1 -1
  72. package/react/context/ApolloProvider.js +1 -1
  73. package/react/context/context.cjs.js +5 -3
  74. package/react/context/context.cjs.js.map +1 -1
  75. package/react/context/index.d.ts.map +1 -1
  76. package/react/context/index.js +2 -0
  77. package/react/context/index.js.map +1 -1
  78. package/react/data/OperationData.js +2 -2
  79. package/react/data/QueryData.d.ts.map +1 -1
  80. package/react/data/QueryData.js +8 -8
  81. package/react/data/QueryData.js.map +1 -1
  82. package/react/data/data.cjs.js +13 -10
  83. package/react/data/data.cjs.js.map +1 -1
  84. package/react/data/index.d.ts.map +1 -1
  85. package/react/data/index.js +2 -0
  86. package/react/data/index.js.map +1 -1
  87. package/react/hoc/hoc-utils.js +1 -1
  88. package/react/hoc/hoc.cjs.js +5 -2
  89. package/react/hoc/hoc.cjs.js.map +1 -1
  90. package/react/hoc/index.d.ts.map +1 -1
  91. package/react/hoc/index.js +2 -0
  92. package/react/hoc/index.js.map +1 -1
  93. package/react/hoc/withApollo.js +1 -1
  94. package/react/hooks/hooks.cjs.js +4 -1
  95. package/react/hooks/hooks.cjs.js.map +1 -1
  96. package/react/hooks/index.d.ts.map +1 -1
  97. package/react/hooks/index.js +2 -0
  98. package/react/hooks/index.js.map +1 -1
  99. package/react/hooks/useApolloClient.js +1 -1
  100. package/react/index.d.ts.map +1 -1
  101. package/react/index.js +2 -3
  102. package/react/index.js.map +1 -1
  103. package/react/parser/index.d.ts.map +1 -1
  104. package/react/parser/index.js +6 -4
  105. package/react/parser/index.js.map +1 -1
  106. package/react/parser/parser.cjs.js +6 -4
  107. package/react/parser/parser.cjs.js.map +1 -1
  108. package/react/react.cjs.js +1 -2
  109. package/react/react.cjs.js.map +1 -1
  110. package/testing/index.js +2 -3
  111. package/testing/index.js.map +1 -1
  112. package/testing/testing.cjs.js +3 -3
  113. package/testing/testing.cjs.js.map +1 -1
  114. package/utilities/globals/index.d.ts +1 -0
  115. package/utilities/globals/index.d.ts.map +1 -1
  116. package/utilities/globals/index.js +4 -0
  117. package/utilities/globals/index.js.map +1 -1
  118. package/utilities/graphql/directives.js +4 -4
  119. package/utilities/graphql/fragments.js +3 -3
  120. package/utilities/graphql/getFromAST.js +8 -8
  121. package/utilities/graphql/storeUtils.js +1 -1
  122. package/utilities/index.d.ts +3 -2
  123. package/utilities/index.d.ts.map +1 -1
  124. package/utilities/index.js +4 -4
  125. package/utilities/index.js.map +1 -1
  126. package/utilities/observables/Concast.js +1 -1
  127. package/utilities/observables/Concast.js.map +1 -1
  128. package/utilities/testing/mocking/mockLink.js +1 -1
  129. package/utilities/utilities.cjs.js +23 -18
  130. package/utilities/utilities.cjs.js.map +1 -1
  131. package/version.js +1 -1
  132. package/apollo-client.cjs.min.js +0 -1
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAKA,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,5 @@
1
- import { DEV } from "../utilities/index.js";
1
+ import { DEV, checkDEV } from "../utilities/index.js";
2
+ checkDEV();
2
3
  export { ApolloClient, mergeOptions, } from "./ApolloClient.js";
3
4
  export { ObservableQuery, applyNextFetchPolicy, } from "./ObservableQuery.js";
4
5
  export { NetworkStatus } from "./networkStatus.js";
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,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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,QAAQ,EAAE,CAAC;AAEX,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, checkDEV } from \"../utilities\";\ncheckDEV();\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"]}
@@ -5,6 +5,7 @@ import { DefaultContext, MutationQueryReducersMap, OperationVariables, MutationU
5
5
  import { ApolloCache } from '../cache';
6
6
  export declare type FetchPolicy = 'cache-first' | 'network-only' | 'cache-only' | 'no-cache' | 'standby';
7
7
  export declare type WatchQueryFetchPolicy = FetchPolicy | 'cache-and-network';
8
+ export declare type MutationFetchPolicy = Extract<FetchPolicy, 'network-only' | 'no-cache'>;
8
9
  export declare type RefetchWritePolicy = "merge" | "overwrite";
9
10
  export declare type ErrorPolicy = 'none' | 'ignore' | 'all';
10
11
  export interface QueryOptions<TVariables = OperationVariables, TData = any> {
@@ -62,7 +63,7 @@ export interface MutationBaseOptions<TData = any, TVariables = OperationVariable
62
63
  }
63
64
  export interface MutationOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationBaseOptions<TData, TVariables, TContext, TCache> {
64
65
  mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;
65
- fetchPolicy?: Extract<FetchPolicy, 'no-cache'>;
66
+ fetchPolicy?: MutationFetchPolicy;
66
67
  keepRootFields?: boolean;
67
68
  }
68
69
  //# sourceMappingURL=watchQueryOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"watchQueryOptions.d.ts","sourceRoot":"","sources":["../../src/core/watchQueryOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWvC,oBAAY,WAAW,GACnB,aAAa,GACb,cAAc,GACd,YAAY,GACZ,UAAU,GACV,SAAS,CAAC;AAEd,oBAAY,qBAAqB,GAAG,WAAW,GAAG,mBAAmB,CAAC;AAEtE,oBAAY,kBAAkB,GAAG,OAAO,GAAG,WAAW,CAAC;AAQvD,oBAAY,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAKpD,MAAM,WAAW,YAAY,CAAC,UAAU,GAAG,kBAAkB,EAAE,KAAK,GAAG,GAAG;IAOxE,KAAK,EAAE,YA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DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport { FetchResult } from '../link/core';\nimport {\n DefaultContext,\n MutationQueryReducersMap,\n OperationVariables,\n MutationUpdaterFunction,\n OnQueryUpdated,\n InternalRefetchQueriesInclude,\n} from './types';\nimport { ApolloCache } from '../cache';\n\n/**\n * fetchPolicy determines where the client may return a result from. The options are:\n * - cache-first (default): return result from cache. Only fetch from network if cached result is not available.\n * - cache-and-network: return result from cache first (if it exists), then return network result once it's available.\n * - cache-only: return result from cache if available, fail otherwise.\n * - no-cache: return result from network, fail if network call doesn't succeed, don't save to cache\n * - network-only: return result from network, fail if network call doesn't succeed, save to cache\n * - standby: only for queries that aren't actively watched, but should be available for refetch and updateQueries.\n */\nexport type FetchPolicy =\n | 'cache-first'\n | 'network-only'\n | 'cache-only'\n | 'no-cache'\n | 'standby';\n\nexport type WatchQueryFetchPolicy = FetchPolicy | 'cache-and-network';\n\nexport type RefetchWritePolicy = \"merge\" | \"overwrite\";\n\n/**\n * errorPolicy determines the level of events for errors in the execution result. The options are:\n * - none (default): any errors from the request are treated like runtime errors and the observable is stopped (XXX this is default to lower breaking changes going from AC 1.0 => 2.0)\n * - ignore: errors from the request do not stop the observable, but also don't call `next`\n * - all: errors are treated like data and will notify observables\n */\nexport type ErrorPolicy = 'none' | 'ignore' | 'all';\n\n/**\n * Query options.\n */\nexport interface QueryOptions<TVariables = OperationVariables, TData = any> {\n /**\n * A GraphQL document that consists of a single query to be sent down to the\n * server.\n */\n // TODO REFACTOR: rename this to document. Didn't do it yet because it's in a\n // lot of tests.\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * A map going from variable name to variable value, where the variables are used\n * within the GraphQL query.\n */\n variables?: TVariables;\n\n /**\n * Specifies the {@link ErrorPolicy} to be used for this query\n */\n errorPolicy?: ErrorPolicy;\n\n /**\n * Context to be passed to link execution chain\n */\n context?: any;\n\n /**\n * Specifies the {@link FetchPolicy} to be used for this query\n */\n fetchPolicy?: FetchPolicy;\n\n /**\n * The time interval (in milliseconds) on which this query should be\n * refetched from the server.\n */\n pollInterval?: number;\n\n /**\n * Whether or not updates to the network status should trigger next on the observer of this query\n */\n notifyOnNetworkStatusChange?: boolean;\n\n /**\n * Allow returning incomplete data from the cache when a larger query cannot\n * be fully satisfied by the cache, instead of returning nothing.\n */\n returnPartialData?: boolean;\n\n /**\n * If `true`, perform a query `refetch` if the query result is marked as\n * being partial, and the returned data is reset to an empty Object by the\n * Apollo Client `QueryManager` (due to a cache miss).\n */\n partialRefetch?: boolean;\n\n /**\n * Whether to canonize cache results before returning them. Canonization\n * takes some extra time, but it speeds up future deep equality comparisons.\n * Defaults to true.\n */\n canonizeResults?: boolean;\n}\n\n/**\n * Watched query options.\n */\nexport interface WatchQueryOptions<TVariables = OperationVariables, TData = any>\n extends Omit<QueryOptions<TVariables, TData>, 'fetchPolicy'> {\n /**\n * Specifies the {@link FetchPolicy} to be used for this query.\n */\n fetchPolicy?: WatchQueryFetchPolicy;\n /**\n * Specifies the {@link FetchPolicy} to be used after this query has completed.\n */\n nextFetchPolicy?: WatchQueryFetchPolicy | ((\n this: WatchQueryOptions<TVariables, TData>,\n lastFetchPolicy: WatchQueryFetchPolicy,\n ) => WatchQueryFetchPolicy);\n /**\n * Specifies whether a {@link NetworkStatus.refetch} operation should merge\n * incoming field data with existing data, or overwrite the existing data.\n * Overwriting is probably preferable, but merging is currently the default\n * behavior, for backwards compatibility with Apollo Client 3.x.\n */\n refetchWritePolicy?: RefetchWritePolicy;\n}\n\nexport interface FetchMoreQueryOptions<TVariables, TData = any> {\n query?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n variables?: Partial<TVariables>;\n context?: any;\n}\n\nexport type UpdateQueryFn<\n TData = any,\n TSubscriptionVariables = OperationVariables,\n TSubscriptionData = TData\n> = (\n previousQueryResult: TData,\n options: {\n subscriptionData: { data: TSubscriptionData };\n variables?: TSubscriptionVariables;\n },\n) => TData;\n\nexport type SubscribeToMoreOptions<\n TData = any,\n TSubscriptionVariables = OperationVariables,\n TSubscriptionData = TData\n> = {\n document: DocumentNode | TypedDocumentNode<TSubscriptionData, TSubscriptionVariables>;\n variables?: TSubscriptionVariables;\n updateQuery?: UpdateQueryFn<TData, TSubscriptionVariables, TSubscriptionData>;\n onError?: (error: Error) => void;\n context?: DefaultContext;\n};\n\nexport interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {\n /**\n * A GraphQL document, often created with `gql` from the `graphql-tag`\n * package, that contains a single subscription inside of it.\n */\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * An object that maps from the name of a variable as used in the subscription\n * GraphQL document to that variable's value.\n */\n variables?: TVariables;\n\n /**\n * Specifies the {@link FetchPolicy} to be used for this subscription.\n */\n fetchPolicy?: FetchPolicy;\n\n /**\n * Specifies the {@link ErrorPolicy} to be used for this operation\n */\n errorPolicy?: ErrorPolicy;\n\n /**\n * Context object to be passed through the link execution chain.\n */\n context?: DefaultContext;\n}\n\nexport interface MutationBaseOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> {\n /**\n * An object that represents the result of this mutation that will be\n * optimistically stored before the server has actually returned a result.\n * This is most often used for optimistic UI, where we want to be able to see\n * the result of a mutation immediately, and update the UI later if any errors\n * appear.\n */\n optimisticResponse?: TData | ((vars: TVariables) => TData);\n\n /**\n * A {@link MutationQueryReducersMap}, which is map from query names to\n * mutation query reducers. Briefly, this map defines how to incorporate the\n * results of the mutation into the results of queries that are currently\n * being watched by your application.\n */\n updateQueries?: MutationQueryReducersMap<TData>;\n\n /**\n * A list of query names which will be refetched once this mutation has\n * returned. This is often used if you have a set of queries which may be\n * affected by a mutation and will have to update. Rather than writing a\n * mutation query reducer (i.e. `updateQueries`) for this, you can simply\n * refetch the queries that will be affected and achieve a consistent store\n * once these queries return.\n */\n refetchQueries?:\n | ((result: FetchResult<TData>) => InternalRefetchQueriesInclude)\n | InternalRefetchQueriesInclude;\n\n /**\n * By default, `refetchQueries` does not wait for the refetched queries to\n * be completed, before resolving the mutation `Promise`. This ensures that\n * query refetching does not hold up mutation response handling (query\n * refetching is handled asynchronously). Set `awaitRefetchQueries` to\n * `true` if you would like to wait for the refetched queries to complete,\n * before the mutation can be marked as resolved.\n */\n awaitRefetchQueries?: boolean;\n\n /**\n * A function which provides an {@link ApolloCache} instance, and the result\n * of the mutation, to allow the user to update the store based on the\n * results of the mutation.\n *\n * This function will be called twice over the lifecycle of a mutation. Once\n * at the very beginning if an `optimisticResponse` was provided. The writes\n * created from the optimistic data will be rolled back before the second time\n * this function is called which is when the mutation has succesfully\n * resolved. At that point `update` will be called with the *actual* mutation\n * result and those writes will not be rolled back.\n *\n * Note that since this function is intended to be used to update the\n * store, it cannot be used with a `no-cache` fetch policy. If you're\n * interested in performing some action after a mutation has completed,\n * and you don't need to update the store, use the Promise returned from\n * `client.mutate` instead.\n */\n update?: MutationUpdaterFunction<TData, TVariables, TContext, TCache>;\n\n /**\n * A function that will be called for each ObservableQuery affected by\n * this mutation, after the mutation has completed.\n */\n onQueryUpdated?: OnQueryUpdated<any>;\n\n /**\n * Specifies the {@link ErrorPolicy} to be used for this operation\n */\n errorPolicy?: ErrorPolicy;\n\n /**\n * An object that maps from the name of a variable as used in the mutation\n * GraphQL document to that variable's value.\n */\n variables?: TVariables;\n\n /**\n * The context to be passed to the link execution chain. This context will\n * only be used with this mutation. It will not be used with\n * `refetchQueries`. Refetched queries use the context they were\n * initialized with (since the intitial context is stored as part of the\n * `ObservableQuery` instance). If a specific context is needed when\n * refetching queries, make sure it is configured (via the\n * [query `context` option](https://www.apollographql.com/docs/react/api/apollo-client#ApolloClient.query))\n * when the query is first initialized/run.\n */\n context?: TContext;\n}\n\nexport interface MutationOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends MutationBaseOptions<TData, TVariables, TContext, TCache> {\n /**\n * A GraphQL document, often created with `gql` from the `graphql-tag`\n * package, that contains a single mutation inside of it.\n */\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * Specifies the {@link FetchPolicy} to be used for this query. Mutations only\n * support a 'no-cache' fetchPolicy. If you don't want to disable the cache,\n * remove your fetchPolicy setting to proceed with the default mutation\n * behavior.\n */\n fetchPolicy?: Extract<FetchPolicy, 'no-cache'>;\n\n /**\n * To avoid retaining sensitive information from mutation root field\n * arguments, Apollo Client v3.4+ automatically clears any `ROOT_MUTATION`\n * fields from the cache after each mutation finishes. If you need this\n * information to remain in the cache, you can prevent the removal by passing\n * `keepRootFields: true` to the mutation. `ROOT_MUTATION` result data are\n * also passed to the mutation `update` function, so we recommend obtaining\n * the results that way, rather than using this option, if possible.\n */\n keepRootFields?: boolean;\n}\n"]}
1
+ {"version":3,"file":"watchQueryOptions.js","sourceRoot":"","sources":["../../src/core/watchQueryOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport { FetchResult } from '../link/core';\nimport {\n DefaultContext,\n MutationQueryReducersMap,\n OperationVariables,\n MutationUpdaterFunction,\n OnQueryUpdated,\n InternalRefetchQueriesInclude,\n} from './types';\nimport { ApolloCache } from '../cache';\n\n/**\n * fetchPolicy determines where the client may return a result from. The options are:\n * - cache-first (default): return result from cache. Only fetch from network if cached result is not available.\n * - cache-and-network: return result from cache first (if it exists), then return network result once it's available.\n * - cache-only: return result from cache if available, fail otherwise.\n * - no-cache: return result from network, fail if network call doesn't succeed, don't save to cache\n * - network-only: return result from network, fail if network call doesn't succeed, save to cache\n * - standby: only for queries that aren't actively watched, but should be available for refetch and updateQueries.\n */\nexport type FetchPolicy =\n | 'cache-first'\n | 'network-only'\n | 'cache-only'\n | 'no-cache'\n | 'standby';\n\nexport type WatchQueryFetchPolicy = FetchPolicy | 'cache-and-network';\n\nexport type MutationFetchPolicy = Extract<\n FetchPolicy,\n | 'network-only' // default behavior (mutation results written to cache)\n | 'no-cache' // alternate behavior (results not written to cache)\n>;\n\nexport type RefetchWritePolicy = \"merge\" | \"overwrite\";\n\n/**\n * errorPolicy determines the level of events for errors in the execution result. The options are:\n * - none (default): any errors from the request are treated like runtime errors and the observable is stopped (XXX this is default to lower breaking changes going from AC 1.0 => 2.0)\n * - ignore: errors from the request do not stop the observable, but also don't call `next`\n * - all: errors are treated like data and will notify observables\n */\nexport type ErrorPolicy = 'none' | 'ignore' | 'all';\n\n/**\n * Query options.\n */\nexport interface QueryOptions<TVariables = OperationVariables, TData = any> {\n /**\n * A GraphQL document that consists of a single query to be sent down to the\n * server.\n */\n // TODO REFACTOR: rename this to document. Didn't do it yet because it's in a\n // lot of tests.\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * A map going from variable name to variable value, where the variables are used\n * within the GraphQL query.\n */\n variables?: TVariables;\n\n /**\n * Specifies the {@link ErrorPolicy} to be used for this query\n */\n errorPolicy?: ErrorPolicy;\n\n /**\n * Context to be passed to link execution chain\n */\n context?: any;\n\n /**\n * Specifies the {@link FetchPolicy} to be used for this query\n */\n fetchPolicy?: FetchPolicy;\n\n /**\n * The time interval (in milliseconds) on which this query should be\n * refetched from the server.\n */\n pollInterval?: number;\n\n /**\n * Whether or not updates to the network status should trigger next on the observer of this query\n */\n notifyOnNetworkStatusChange?: boolean;\n\n /**\n * Allow returning incomplete data from the cache when a larger query cannot\n * be fully satisfied by the cache, instead of returning nothing.\n */\n returnPartialData?: boolean;\n\n /**\n * If `true`, perform a query `refetch` if the query result is marked as\n * being partial, and the returned data is reset to an empty Object by the\n * Apollo Client `QueryManager` (due to a cache miss).\n */\n partialRefetch?: boolean;\n\n /**\n * Whether to canonize cache results before returning them. Canonization\n * takes some extra time, but it speeds up future deep equality comparisons.\n * Defaults to true.\n */\n canonizeResults?: boolean;\n}\n\n/**\n * Watched query options.\n */\nexport interface WatchQueryOptions<TVariables = OperationVariables, TData = any>\n extends Omit<QueryOptions<TVariables, TData>, 'fetchPolicy'> {\n /**\n * Specifies the {@link FetchPolicy} to be used for this query.\n */\n fetchPolicy?: WatchQueryFetchPolicy;\n /**\n * Specifies the {@link FetchPolicy} to be used after this query has completed.\n */\n nextFetchPolicy?: WatchQueryFetchPolicy | ((\n this: WatchQueryOptions<TVariables, TData>,\n lastFetchPolicy: WatchQueryFetchPolicy,\n ) => WatchQueryFetchPolicy);\n /**\n * Specifies whether a {@link NetworkStatus.refetch} operation should merge\n * incoming field data with existing data, or overwrite the existing data.\n * Overwriting is probably preferable, but merging is currently the default\n * behavior, for backwards compatibility with Apollo Client 3.x.\n */\n refetchWritePolicy?: RefetchWritePolicy;\n}\n\nexport interface FetchMoreQueryOptions<TVariables, TData = any> {\n query?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n variables?: Partial<TVariables>;\n context?: any;\n}\n\nexport type UpdateQueryFn<\n TData = any,\n TSubscriptionVariables = OperationVariables,\n TSubscriptionData = TData\n> = (\n previousQueryResult: TData,\n options: {\n subscriptionData: { data: TSubscriptionData };\n variables?: TSubscriptionVariables;\n },\n) => TData;\n\nexport type SubscribeToMoreOptions<\n TData = any,\n TSubscriptionVariables = OperationVariables,\n TSubscriptionData = TData\n> = {\n document: DocumentNode | TypedDocumentNode<TSubscriptionData, TSubscriptionVariables>;\n variables?: TSubscriptionVariables;\n updateQuery?: UpdateQueryFn<TData, TSubscriptionVariables, TSubscriptionData>;\n onError?: (error: Error) => void;\n context?: DefaultContext;\n};\n\nexport interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {\n /**\n * A GraphQL document, often created with `gql` from the `graphql-tag`\n * package, that contains a single subscription inside of it.\n */\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * An object that maps from the name of a variable as used in the subscription\n * GraphQL document to that variable's value.\n */\n variables?: TVariables;\n\n /**\n * Specifies the {@link FetchPolicy} to be used for this subscription.\n */\n fetchPolicy?: FetchPolicy;\n\n /**\n * Specifies the {@link ErrorPolicy} to be used for this operation\n */\n errorPolicy?: ErrorPolicy;\n\n /**\n * Context object to be passed through the link execution chain.\n */\n context?: DefaultContext;\n}\n\nexport interface MutationBaseOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> {\n /**\n * An object that represents the result of this mutation that will be\n * optimistically stored before the server has actually returned a result.\n * This is most often used for optimistic UI, where we want to be able to see\n * the result of a mutation immediately, and update the UI later if any errors\n * appear.\n */\n optimisticResponse?: TData | ((vars: TVariables) => TData);\n\n /**\n * A {@link MutationQueryReducersMap}, which is map from query names to\n * mutation query reducers. Briefly, this map defines how to incorporate the\n * results of the mutation into the results of queries that are currently\n * being watched by your application.\n */\n updateQueries?: MutationQueryReducersMap<TData>;\n\n /**\n * A list of query names which will be refetched once this mutation has\n * returned. This is often used if you have a set of queries which may be\n * affected by a mutation and will have to update. Rather than writing a\n * mutation query reducer (i.e. `updateQueries`) for this, you can simply\n * refetch the queries that will be affected and achieve a consistent store\n * once these queries return.\n */\n refetchQueries?:\n | ((result: FetchResult<TData>) => InternalRefetchQueriesInclude)\n | InternalRefetchQueriesInclude;\n\n /**\n * By default, `refetchQueries` does not wait for the refetched queries to\n * be completed, before resolving the mutation `Promise`. This ensures that\n * query refetching does not hold up mutation response handling (query\n * refetching is handled asynchronously). Set `awaitRefetchQueries` to\n * `true` if you would like to wait for the refetched queries to complete,\n * before the mutation can be marked as resolved.\n */\n awaitRefetchQueries?: boolean;\n\n /**\n * A function which provides an {@link ApolloCache} instance, and the result\n * of the mutation, to allow the user to update the store based on the\n * results of the mutation.\n *\n * This function will be called twice over the lifecycle of a mutation. Once\n * at the very beginning if an `optimisticResponse` was provided. The writes\n * created from the optimistic data will be rolled back before the second time\n * this function is called which is when the mutation has succesfully\n * resolved. At that point `update` will be called with the *actual* mutation\n * result and those writes will not be rolled back.\n *\n * Note that since this function is intended to be used to update the\n * store, it cannot be used with a `no-cache` fetch policy. If you're\n * interested in performing some action after a mutation has completed,\n * and you don't need to update the store, use the Promise returned from\n * `client.mutate` instead.\n */\n update?: MutationUpdaterFunction<TData, TVariables, TContext, TCache>;\n\n /**\n * A function that will be called for each ObservableQuery affected by\n * this mutation, after the mutation has completed.\n */\n onQueryUpdated?: OnQueryUpdated<any>;\n\n /**\n * Specifies the {@link ErrorPolicy} to be used for this operation\n */\n errorPolicy?: ErrorPolicy;\n\n /**\n * An object that maps from the name of a variable as used in the mutation\n * GraphQL document to that variable's value.\n */\n variables?: TVariables;\n\n /**\n * The context to be passed to the link execution chain. This context will\n * only be used with this mutation. It will not be used with\n * `refetchQueries`. Refetched queries use the context they were\n * initialized with (since the intitial context is stored as part of the\n * `ObservableQuery` instance). If a specific context is needed when\n * refetching queries, make sure it is configured (via the\n * [query `context` option](https://www.apollographql.com/docs/react/api/apollo-client#ApolloClient.query))\n * when the query is first initialized/run.\n */\n context?: TContext;\n}\n\nexport interface MutationOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends MutationBaseOptions<TData, TVariables, TContext, TCache> {\n /**\n * A GraphQL document, often created with `gql` from the `graphql-tag`\n * package, that contains a single mutation inside of it.\n */\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * Specifies the {@link MutationFetchPolicy} to be used for this query.\n * Mutations support only 'network-only' and 'no-cache' fetchPolicy strings.\n * If fetchPolicy is not provided, it defaults to 'network-only'.\n */\n fetchPolicy?: MutationFetchPolicy;\n\n /**\n * To avoid retaining sensitive information from mutation root field\n * arguments, Apollo Client v3.4+ automatically clears any `ROOT_MUTATION`\n * fields from the cache after each mutation finishes. If you need this\n * information to remain in the cache, you can prevent the removal by passing\n * `keepRootFields: true` to the mutation. `ROOT_MUTATION` result data are\n * also passed to the mutation `update` function, so we recommend obtaining\n * the results that way, rather than using this option, if possible.\n */\n keepRootFields?: boolean;\n}\n"]}
@@ -3,10 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib = require('tslib');
6
- var tsInvariant = require('ts-invariant');
7
6
  var utilities = require('../utilities');
8
7
 
9
- __DEV__ ? tsInvariant.invariant("boolean" === typeof utilities.DEV, utilities.DEV) : tsInvariant.invariant("boolean" === typeof utilities.DEV, 22);
8
+ utilities.checkDEV();
10
9
  function isApolloError(err) {
11
10
  return err.hasOwnProperty('graphQLErrors');
12
11
  }
@@ -1 +1 @@
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","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,EAAE;AAC7B,QAAQ,IAAI,aAAa,GAAG,EAAE,CAAC,aAAa,EAAE,YAAY,GAAG,EAAE,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;;;;;"}
1
+ {"version":3,"file":"errors.cjs.js","sources":["index.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { checkDEV } from \"../utilities\";\ncheckDEV();\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":["checkDEV","isNonEmptyArray","__extends"],"mappings":";;;;;;;AAEAA,kBAAQ,EAAE,CAAC;AAEJ,SAAS,aAAa,CAAC,GAAG,EAAE;AACnC,IAAI,OAAO,GAAG,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AAC/C,CAAC;AACD,IAAI,oBAAoB,GAAG,UAAU,GAAG,EAAE;AAC1C,IAAI,IAAI,OAAO,GAAG,EAAE,CAAC;AACrB,IAAI,IAAIC,yBAAe,CAAC,GAAG,CAAC,aAAa,CAAC,IAAIA,yBAAe,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;AACjF,QAAQ,IAAI,MAAM,GAAG,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE;AAC7C,aAAa,MAAM,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;AAC5C,QAAQ,MAAM,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE;AACxC,YAAY,IAAI,YAAY,GAAG,KAAK;AACpC,kBAAkB,KAAK,CAAC,OAAO;AAC/B,kBAAkB,0BAA0B,CAAC;AAC7C,YAAY,OAAO,IAAI,YAAY,GAAG,IAAI,CAAC;AAC3C,SAAS,CAAC,CAAC;AACX,KAAK;AACL,IAAI,IAAI,GAAG,CAAC,YAAY,EAAE;AAC1B,QAAQ,OAAO,IAAI,GAAG,CAAC,Y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,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,7 +1,6 @@
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
+ import { checkDEV } from "../utilities/index.js";
3
+ checkDEV();
5
4
  import { isNonEmptyArray } from "../utilities/index.js";
6
5
  export function isApolloError(err) {
7
6
  return err.hasOwnProperty('graphQLErrors');
@@ -1 +1 @@
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;AAI/C,MAAM,UAAU,aAAa,CAAC,GAAU;IACtC,OAAO,GAAG,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AAC7C,CAAC;AAMD,IAAM,oBAAoB,GAAG,UAAC,GAAgB;IAC5C,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,I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ariant } 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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,QAAQ,EAAE,CAAC;AAIX,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,MAAM,UAAU,aAAa,CAAC,GAAU;IACtC,OAAO,GAAG,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AAC7C,CAAC;AAMD,IAAM,oBAAoB,GAAG,UAAC,GAAgB;IAC5C,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;QAC3E,IAAM,MAAM,GAAI,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAsB;aAC3D,MAAM,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;QAClC,MAAM,CAAC,OAAO,CAAC,UAAC,KAAY;YAC1B,IAAM,YAAY,GAAG,KAAK;gBACxB,CAAC,CAAC,KAAK,CAAC,OAAO;gBACf,CAAC,CAAC,0BAA0B,CAAC;YAC/B,OAAO,IAAO,YAAY,OAAI,CAAC;QACjC,CAAC,CAAC,CAAC;KACJ;IAED,IAAI,GAAG,CAAC,YAAY,EAAE;QACpB,OAAO,IAAO,GAAG,CAAC,YAAY,CAAC,OAAO,OAAI,CAAC;KAC5C;IAGD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;IAAiC,+BAAK;IAcpC,qBAAY,EAYX;YAXC,aAAa,mBAAA,EACb,YAAY,kBAAA,EACZ,YAAY,kBAAA,EACZ,YAAY,kBAAA,EACZ,SAAS,eAAA;QALX,YAaE,kBAAM,YAAY,CAAC,SAUpB;QATC,KAAI,CAAC,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;QACzC,KAAI,CAAC,YAAY,GAAG,YAAY,IAAI,EAAE,CAAC;QACvC,KAAI,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC;QACzC,KAAI,CAAC,OAAO,GAAG,YAAY,IAAI,oBAAoB,CAAC,KAAI,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 { checkDEV } from \"../utilities\";\ncheckDEV();\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"]}
@@ -5,39 +5,34 @@
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.5",
8
+ "@apollo/client version": "3.4.9",
9
9
 
10
10
  1: {
11
- file: "@apollo/client/cache/index.js",
12
- node: invariant("boolean" === typeof DEV, DEV)
13
- },
14
-
15
- 2: {
16
11
  file: "@apollo/client/cache/inmemory/entityStore.js",
17
12
  node: invariant(typeof dataId === "string", "store.merge expects a string ID")
18
13
  },
19
14
 
20
- 3: {
15
+ 2: {
21
16
  file: "@apollo/client/cache/inmemory/policies.js",
22
17
  node: invariant(!old || old === which, "Cannot change root " + which + " __typename more than once")
23
18
  },
24
19
 
25
- 4: {
20
+ 3: {
26
21
  file: "@apollo/client/cache/inmemory/policies.js",
27
22
  node: new InvariantError("Cannot automatically merge arrays")
28
23
  },
29
24
 
30
- 5: {
25
+ 4: {
31
26
  file: "@apollo/client/cache/inmemory/policies.js",
32
27
  node: invariant(!strict, "Missing field '" + responseName + "' while computing key fields")
33
28
  },
34
29
 
35
- 6: {
30
+ 5: {
36
31
  file: "@apollo/client/cache/inmemory/readFromStore.js",
37
32
  node: new InvariantError("Dangling reference to missing " + objectOrReference.__ref + " object")
38
33
  },
39
34
 
40
- 7: {
35
+ 6: {
41
36
  file: "@apollo/client/cache/inmemory/readFromStore.js",
42
37
 
43
38
  node: new InvariantError("Can't find field '" + selection.name.value + "' on " + (isReference(objectOrReference)
@@ -45,17 +40,17 @@
45
40
  : "object " + JSON.stringify(objectOrReference, null, 2)))
46
41
  },
47
42
 
48
- 8: {
43
+ 7: {
49
44
  file: "@apollo/client/cache/inmemory/readFromStore.js",
50
45
  node: invariant(!isReference(value), "Missing selection set for object of type " + getTypenameFromStoreObject(store, value) + " returned for query field " + field.name.value)
51
46
  },
52
47
 
53
- 9: {
48
+ 8: {
54
49
  file: "@apollo/client/cache/inmemory/writeToStore.js",
55
50
  node: new InvariantError("Could not identify object " + JSON.stringify(result))
56
51
  },
57
52
 
58
- 10: {
53
+ 9: {
59
54
  file: "@apollo/client/core/ApolloClient.js",
60
55
 
61
56
  node: new InvariantError("To initialize Apollo Client, you must specify a 'cache' property " +
@@ -63,7 +58,7 @@
63
58
  "For more information, please visit: https://go.apollo.dev/c/docs")
64
59
  },
65
60
 
66
- 11: {
61
+ 10: {
67
62
  file: "@apollo/client/core/ApolloClient.js",
68
63
 
69
64
  node: invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' +
@@ -72,84 +67,76 @@
72
67
  'using a different fetchPolicy, such as cache-first or network-only.')
73
68
  },
74
69
 
75
- 12: {
70
+ 11: {
76
71
  file: "@apollo/client/core/LocalState.js",
77
72
  node: invariant(fragment, "No fragment named " + selection.name.value)
78
73
  },
79
74
 
80
- 13: {
75
+ 12: {
81
76
  file: "@apollo/client/core/ObservableQuery.js",
82
77
  node: invariant(pollInterval, 'Attempted to start a polling query without a polling interval.')
83
78
  },
84
79
 
85
- 14: {
80
+ 13: {
86
81
  file: "@apollo/client/core/QueryManager.js",
87
82
  node: new InvariantError('QueryManager stopped while query was in flight')
88
83
  },
89
84
 
90
- 15: {
85
+ 14: {
91
86
  file: "@apollo/client/core/QueryManager.js",
92
87
  node: invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.')
93
88
  },
94
89
 
95
- 16: {
90
+ 15: {
96
91
  file: "@apollo/client/core/QueryManager.js",
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.")
92
+
93
+ node: invariant(fetchPolicy === 'network-only' ||
94
+ fetchPolicy === 'no-cache', "Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write.")
98
95
  },
99
96
 
100
- 17: {
97
+ 16: {
101
98
  file: "@apollo/client/core/QueryManager.js",
102
99
 
103
100
  node: invariant(options.query, 'query option is required. You must specify your GraphQL document ' +
104
101
  'in the query option.')
105
102
  },
106
103
 
107
- 18: {
104
+ 17: {
108
105
  file: "@apollo/client/core/QueryManager.js",
109
106
  node: invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.')
110
107
  },
111
108
 
112
- 19: {
109
+ 18: {
113
110
  file: "@apollo/client/core/QueryManager.js",
114
111
  node: invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.')
115
112
  },
116
113
 
117
- 20: {
114
+ 19: {
118
115
  file: "@apollo/client/core/QueryManager.js",
119
116
  node: invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.')
120
117
  },
121
118
 
122
- 21: {
119
+ 20: {
123
120
  file: "@apollo/client/core/QueryManager.js",
124
121
  node: new InvariantError('Store reset while query was in flight (not completed in link chain)')
125
122
  },
126
123
 
127
- 22: {
128
- file: "@apollo/client/errors/index.js",
129
- node: invariant("boolean" === typeof DEV, DEV)
130
- },
131
-
132
- 23: {
124
+ 21: {
133
125
  file: "@apollo/client/link/core/ApolloLink.js",
134
126
  node: new InvariantError('request is not implemented')
135
127
  },
136
128
 
137
- 24: {
138
- file: "@apollo/client/link/core/index.js",
139
- node: invariant("boolean" === typeof DEV, DEV)
140
- },
141
-
142
- 25: {
129
+ 22: {
143
130
  file: "@apollo/client/link/http/checkFetcher.js",
144
131
  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 ")
145
132
  },
146
133
 
147
- 26: {
134
+ 23: {
148
135
  file: "@apollo/client/link/http/serializeFetchParameter.js",
149
136
  node: new InvariantError("Network request failed. " + label + " is not serializable: " + e.message)
150
137
  },
151
138
 
152
- 27: {
139
+ 24: {
153
140
  file: "@apollo/client/link/persisted-queries/index.js",
154
141
 
155
142
  node: invariant(options && (typeof options.sha256 === 'function' ||
@@ -158,31 +145,31 @@
158
145
  'parameter.')
159
146
  },
160
147
 
161
- 28: {
148
+ 25: {
162
149
  file: "@apollo/client/link/persisted-queries/index.js",
163
150
  node: invariant(forward, 'PersistedQueryLink cannot be the last link in the chain.')
164
151
  },
165
152
 
166
- 29: {
153
+ 26: {
167
154
  file: "@apollo/client/link/utils/validateOperation.js",
168
155
  node: new InvariantError("illegal argument: " + key)
169
156
  },
170
157
 
171
- 30: {
158
+ 27: {
172
159
  file: "@apollo/client/react/context/ApolloConsumer.js",
173
160
 
174
161
  node: invariant(context && context.client, 'Could not find "client" in the context of ApolloConsumer. ' +
175
162
  'Wrap the root component in an <ApolloProvider>.')
176
163
  },
177
164
 
178
- 31: {
165
+ 28: {
179
166
  file: "@apollo/client/react/context/ApolloProvider.js",
180
167
 
181
168
  node: invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
182
169
  'sure you pass in your client via the "client" prop.')
183
170
  },
184
171
 
185
- 32: {
172
+ 29: {
186
173
  file: "@apollo/client/react/data/OperationData.js",
187
174
 
188
175
  node: invariant(!!client, 'Could not find "client" in the context or passed in as an option. ' +
@@ -190,40 +177,35 @@
190
177
  'ApolloClient instance in via options.')
191
178
  },
192
179
 
193
- 33: {
180
+ 30: {
194
181
  file: "@apollo/client/react/data/OperationData.js",
195
182
 
196
183
  node: invariant(operation.type === type, "Running a " + requiredOperationName + " requires a graphql " +
197
184
  (requiredOperationName + ", but a " + usedOperationName + " was used instead."))
198
185
  },
199
186
 
200
- 34: {
187
+ 31: {
201
188
  file: "@apollo/client/react/hoc/hoc-utils.js",
202
189
 
203
190
  node: invariant(this.withRef, "To access the wrapped instance, you need to specify " +
204
191
  "{ withRef: true } in the options")
205
192
  },
206
193
 
207
- 35: {
194
+ 32: {
208
195
  file: "@apollo/client/react/hoc/withApollo.js",
209
196
 
210
197
  node: invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " +
211
198
  "{ withRef: true } in the options")
212
199
  },
213
200
 
214
- 36: {
201
+ 33: {
215
202
  file: "@apollo/client/react/hooks/useApolloClient.js",
216
203
 
217
204
  node: invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +
218
205
  'have called `ApolloProvider` higher up in your tree.')
219
206
  },
220
207
 
221
- 37: {
222
- file: "@apollo/client/react/index.js",
223
- node: invariant("boolean" === typeof DEV, DEV)
224
- },
225
-
226
- 38: {
208
+ 34: {
227
209
  file: "@apollo/client/react/parser/index.js",
228
210
 
229
211
  node: invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " +
@@ -231,7 +213,7 @@
231
213
  "to convert your operation into a document")
232
214
  },
233
215
 
234
- 39: {
216
+ 35: {
235
217
  file: "@apollo/client/react/parser/index.js",
236
218
 
237
219
  node: invariant(!fragments.length ||
@@ -239,7 +221,7 @@
239
221
  "You must include a query, subscription or mutation as well")
240
222
  },
241
223
 
242
- 40: {
224
+ 36: {
243
225
  file: "@apollo/client/react/parser/index.js",
244
226
 
245
227
  node: invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " +
@@ -248,7 +230,7 @@
248
230
  "You can use 'compose' to join multiple operation types to a component")
249
231
  },
250
232
 
251
- 41: {
233
+ 37: {
252
234
  file: "@apollo/client/react/parser/index.js",
253
235
 
254
236
  node: invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " +
@@ -256,91 +238,91 @@
256
238
  "You can use 'compose' to join multiple operation types to a component")
257
239
  },
258
240
 
259
- 42: {
260
- file: "@apollo/client/testing/index.js",
241
+ 38: {
242
+ file: "@apollo/client/utilities/globals/index.js",
261
243
  node: invariant("boolean" === typeof DEV, DEV)
262
244
  },
263
245
 
264
- 43: {
246
+ 39: {
265
247
  file: "@apollo/client/utilities/graphql/directives.js",
266
248
  node: invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive.")
267
249
  },
268
250
 
269
- 44: {
251
+ 40: {
270
252
  file: "@apollo/client/utilities/graphql/directives.js",
271
253
  node: invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive.")
272
254
  },
273
255
 
274
- 45: {
256
+ 41: {
275
257
  file: "@apollo/client/utilities/graphql/directives.js",
276
258
  node: invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive.")
277
259
  },
278
260
 
279
- 46: {
261
+ 42: {
280
262
  file: "@apollo/client/utilities/graphql/directives.js",
281
263
 
282
264
  node: invariant(ifValue &&
283
265
  (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value.")
284
266
  },
285
267
 
286
- 47: {
268
+ 43: {
287
269
  file: "@apollo/client/utilities/graphql/fragments.js",
288
270
 
289
271
  node: new InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " +
290
272
  'No operations are allowed when using a fragment as a query. Only fragments are allowed.')
291
273
  },
292
274
 
293
- 48: {
275
+ 44: {
294
276
  file: "@apollo/client/utilities/graphql/fragments.js",
295
277
  node: invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")
296
278
  },
297
279
 
298
- 49: {
280
+ 45: {
299
281
  file: "@apollo/client/utilities/graphql/fragments.js",
300
282
  node: invariant(fragment, "No fragment named " + selection.name.value + ".")
301
283
  },
302
284
 
303
- 50: {
285
+ 46: {
304
286
  file: "@apollo/client/utilities/graphql/getFromAST.js",
305
287
  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")
306
288
  },
307
289
 
308
- 51: {
290
+ 47: {
309
291
  file: "@apollo/client/utilities/graphql/getFromAST.js",
310
292
  node: new InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"")
311
293
  },
312
294
 
313
- 52: {
295
+ 48: {
314
296
  file: "@apollo/client/utilities/graphql/getFromAST.js",
315
297
  node: invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations")
316
298
  },
317
299
 
318
- 53: {
300
+ 49: {
319
301
  file: "@apollo/client/utilities/graphql/getFromAST.js",
320
302
  node: invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.')
321
303
  },
322
304
 
323
- 54: {
305
+ 50: {
324
306
  file: "@apollo/client/utilities/graphql/getFromAST.js",
325
307
  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")
326
308
  },
327
309
 
328
- 55: {
310
+ 51: {
329
311
  file: "@apollo/client/utilities/graphql/getFromAST.js",
330
312
  node: invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.')
331
313
  },
332
314
 
333
- 56: {
315
+ 52: {
334
316
  file: "@apollo/client/utilities/graphql/getFromAST.js",
335
317
  node: invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.')
336
318
  },
337
319
 
338
- 57: {
320
+ 53: {
339
321
  file: "@apollo/client/utilities/graphql/getFromAST.js",
340
322
  node: new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.')
341
323
  },
342
324
 
343
- 58: {
325
+ 54: {
344
326
  file: "@apollo/client/utilities/graphql/storeUtils.js",
345
327
 
346
328
  node: new InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" +
@@ -348,12 +330,7 @@
348
330
  'overcome this limitation.')
349
331
  },
350
332
 
351
- 59: {
352
- file: "@apollo/client/utilities/index.js",
353
- node: invariant("boolean" === typeof DEV, DEV)
354
- },
355
-
356
- 60: {
333
+ 55: {
357
334
  file: "@apollo/client/utilities/testing/mocking/mockLink.js",
358
335
  node: invariant(queryWithoutConnection, "query is required")
359
336
  }
@@ -81,7 +81,7 @@ var ApolloLink = (function () {
81
81
  return ApolloLink.concat(this, next);
82
82
  };
83
83
  ApolloLink.prototype.request = function (operation, forward) {
84
- throw __DEV__ ? new InvariantError('request is not implemented') : new InvariantError(23);
84
+ throw __DEV__ ? new InvariantError('request is not implemented') : new InvariantError(21);
85
85
  };
86
86
  ApolloLink.prototype.onError = function (error, observer) {
87
87
  if (observer && observer.error) {