@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/utilities/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC,OAAO,EAAE,GAAG,EAAE,CAAA;AAEd,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAU,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,EACf,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,EAC9B,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,qCAAqC,EACrC,2BAA2B,EAC3B,gCAAgC,EAChC,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,UAAU,EACV,QAAQ,EACR,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAElC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAE7C,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAA;AAGxB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAU,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,EACf,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,EAC9B,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,qCAAqC,EACrC,2BAA2B,EAC3B,gCAAgC,EAChC,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,UAAU,EACV,QAAQ,EACR,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAElC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAE7C,cAAc,uBAAuB,CAAC"}
@@ -1,7 +1,6 @@
1
- import { invariant } from "ts-invariant";
2
- import { DEV } from "./globals/index.js";
3
- __DEV__ ? invariant("boolean" === typeof DEV, DEV) : invariant("boolean" === typeof DEV, 59);
4
- export { DEV };
1
+ import { DEV, checkDEV } from "./globals/index.js";
2
+ export { DEV, checkDEV };
3
+ checkDEV();
5
4
  export { shouldInclude, hasDirectives, hasClientExports, getDirectiveNames, getInclusionDirectives, } from "./graphql/directives.js";
6
5
  export { createFragmentMap, getFragmentQueryDocument, getFragmentFromSelection, } from "./graphql/fragments.js";
7
6
  export { checkDocument, getOperationDefinition, getOperationName, getFragmentDefinitions, getQueryDefinition, getFragmentDefinition, getMainDefinition, getDefaultValues, } from "./graphql/getFromAST.js";
@@ -12,6 +11,7 @@ export { Observable } from "./observables/Observable.js";
12
11
  export * from "./common/mergeDeep.js";
13
12
  export * from "./common/cloneDeep.js";
14
13
  export * from "./common/maybeDeepFreeze.js";
14
+ export * from "./common/maybe.js";
15
15
  export * from "./observables/iteration.js";
16
16
  export * from "./observables/asyncMap.js";
17
17
  export * from "./observables/Concast.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,SAAS,CAAC,SAAS,KAAK,OAAO,GAAG,EAAE,GAAG,CAAC,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,CAAA;AAEd,OAAO,EAGL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAML,aAAa,EACb,cAAc,EACd,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,EACf,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAUL,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,qCAAqC,EACrC,2BAA2B,EAC3B,gCAAgC,EAChC,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,UAAU,EAGX,MAAM,0BAA0B,CAAC;AAElC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAE7C,cAAc,uBAAuB,CAAC","sourcesContent":["import { invariant } from \"ts-invariant\";\nimport { DEV } from \"./globals\";\ninvariant(\"boolean\" === typeof DEV, DEV);\nexport { DEV }\n\nexport {\n DirectiveInfo,\n InclusionDirectives,\n shouldInclude,\n hasDirectives,\n hasClientExports,\n getDirectiveNames,\n getInclusionDirectives,\n} from './graphql/directives';\n\nexport {\n FragmentMap,\n createFragmentMap,\n getFragmentQueryDocument,\n getFragmentFromSelection,\n} from './graphql/fragments';\n\nexport {\n checkDocument,\n getOperationDefinition,\n getOperationName,\n getFragmentDefinitions,\n getQueryDefinition,\n getFragmentDefinition,\n getMainDefinition,\n getDefaultValues,\n} from './graphql/getFromAST';\n\nexport {\n StoreObject,\n Reference,\n StoreValue,\n Directives,\n VariableValue,\n makeReference,\n isDocumentNode,\n isReference,\n isField,\n isInlineFragment,\n valueToObjectRepresentation,\n storeKeyNameFromField,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getStoreKeyName,\n getTypenameFromResult,\n} from './graphql/storeUtils';\n\nexport {\n RemoveNodeConfig,\n GetNodeConfig,\n RemoveDirectiveConfig,\n GetDirectiveConfig,\n RemoveArgumentsConfig,\n GetFragmentSpreadConfig,\n RemoveFragmentSpreadConfig,\n RemoveFragmentDefinitionConfig,\n RemoveVariableDefinitionConfig,\n addTypenameToDocument,\n buildQueryFromSelectionSet,\n removeDirectivesFromDocument,\n removeConnectionDirectiveFromDocument,\n removeArgumentsFromDocument,\n removeFragmentSpreadFromDocument,\n removeClientSetsFromDocument,\n} from './graphql/transform';\n\nexport {\n concatPagination,\n offsetLimitPagination,\n relayStylePagination,\n} from './policies/pagination';\n\nexport {\n Observable,\n Observer,\n ObservableSubscription\n} from './observables/Observable';\n\nexport * from './common/mergeDeep';\nexport * from './common/cloneDeep';\nexport * from './common/maybeDeepFreeze';\nexport * from './observables/iteration';\nexport * from './observables/asyncMap';\nexport * from './observables/Concast';\nexport * from './observables/subclassing';\nexport * from './common/arrays';\nexport * from './common/objects';\nexport * from './common/errorHandling';\nexport * from './common/canUse';\nexport * from './common/compact';\nexport * from './common/makeUniqueId';\nexport * from './common/stringifyForDisplay';\n\nexport * from './types/IsStrictlyAny';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAA;AACxB,QAAQ,EAAE,CAAC;AAEX,OAAO,EAGL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAML,aAAa,EACb,cAAc,EACd,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,EACf,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAUL,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,qCAAqC,EACrC,2BAA2B,EAC3B,gCAAgC,EAChC,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,UAAU,EAGX,MAAM,0BAA0B,CAAC;AAElC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAE7C,cAAc,uBAAuB,CAAC","sourcesContent":["import { DEV, checkDEV } from \"./globals\";\nexport { DEV, checkDEV }\ncheckDEV();\n\nexport {\n DirectiveInfo,\n InclusionDirectives,\n shouldInclude,\n hasDirectives,\n hasClientExports,\n getDirectiveNames,\n getInclusionDirectives,\n} from './graphql/directives';\n\nexport {\n FragmentMap,\n createFragmentMap,\n getFragmentQueryDocument,\n getFragmentFromSelection,\n} from './graphql/fragments';\n\nexport {\n checkDocument,\n getOperationDefinition,\n getOperationName,\n getFragmentDefinitions,\n getQueryDefinition,\n getFragmentDefinition,\n getMainDefinition,\n getDefaultValues,\n} from './graphql/getFromAST';\n\nexport {\n StoreObject,\n Reference,\n StoreValue,\n Directives,\n VariableValue,\n makeReference,\n isDocumentNode,\n isReference,\n isField,\n isInlineFragment,\n valueToObjectRepresentation,\n storeKeyNameFromField,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getStoreKeyName,\n getTypenameFromResult,\n} from './graphql/storeUtils';\n\nexport {\n RemoveNodeConfig,\n GetNodeConfig,\n RemoveDirectiveConfig,\n GetDirectiveConfig,\n RemoveArgumentsConfig,\n GetFragmentSpreadConfig,\n RemoveFragmentSpreadConfig,\n RemoveFragmentDefinitionConfig,\n RemoveVariableDefinitionConfig,\n addTypenameToDocument,\n buildQueryFromSelectionSet,\n removeDirectivesFromDocument,\n removeConnectionDirectiveFromDocument,\n removeArgumentsFromDocument,\n removeFragmentSpreadFromDocument,\n removeClientSetsFromDocument,\n} from './graphql/transform';\n\nexport {\n concatPagination,\n offsetLimitPagination,\n relayStylePagination,\n} from './policies/pagination';\n\nexport {\n Observable,\n Observer,\n ObservableSubscription\n} from './observables/Observable';\n\nexport * from './common/mergeDeep';\nexport * from './common/cloneDeep';\nexport * from './common/maybeDeepFreeze';\nexport * from './common/maybe';\nexport * from './observables/iteration';\nexport * from './observables/asyncMap';\nexport * from './observables/Concast';\nexport * from './observables/subclassing';\nexport * from './common/arrays';\nexport * from './common/objects';\nexport * from './common/errorHandling';\nexport * from './common/canUse';\nexport * from './common/compact';\nexport * from './common/makeUniqueId';\nexport * from './common/stringifyForDisplay';\n\nexport * from './types/IsStrictlyAny';\n"]}
@@ -29,7 +29,7 @@ var Concast = (function (_super) {
29
29
  var sub = _this.sub;
30
30
  if (sub !== null) {
31
31
  if (sub)
32
- Promise.resolve().then(function () { return sub.unsubscribe(); });
32
+ setTimeout(function () { return sub.unsubscribe(); });
33
33
  _this.sub = null;
34
34
  _this.latest = ["error", error];
35
35
  _this.reject(error);
@@ -1 +1 @@
1
- {"version":3,"file":"Concast.js","sourceRoot":"","sources":["../../../src/utilities/observables/Concast.ts"],"names":[],"mappings":";AAAA,O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, Subscriber } from \"./Observable\";\nimport { iterateObserversSafely } from \"./iteration\";\nimport { fixObservableSubclass } from \"./subclassing\";\n\ntype MaybeAsync<T> = T | PromiseLike<T>;\n\nfunction isPromiseLike<T>(value: MaybeAsync<T>): value is PromiseLike<T> {\n return value && typeof (value as any).then === \"function\";\n}\n\n// Any individual Source<T> can be an Observable<T> or a promise for one.\ntype Source<T> = MaybeAsync<Observable<T>>;\n\nexport type ConcastSourcesIterable<T> = Iterable<Source<T>>;\n\n// A Concast<T> observable concatenates the given sources into a single\n// non-overlapping sequence of Ts, automatically unwrapping any promises,\n// and broadcasts the T elements of that sequence to any number of\n// subscribers, all without creating a bunch of intermediary Observable\n// wrapper objects.\n//\n// Even though any number of observers can subscribe to the Concast, each\n// source observable is guaranteed to receive at most one subscribe call,\n// and the results are multicast to all observers.\n//\n// In addition to broadcasting every next/error message to this.observers,\n// the Concast stores the most recent message using this.latest, so any\n// new observers can immediately receive the latest message, even if it\n// was originally delivered in the past. This behavior means we can assume\n// every active observer in this.observers has received the same most\n// recent message.\n//\n// With the exception of this.latest replay, a Concast is a \"hot\"\n// observable in the sense that it does not replay past results from the\n// beginning of time for each new observer.\n//\n// Could we have used some existing RxJS class instead? Concast<T> is\n// similar to a BehaviorSubject<T>, because it is multicast and redelivers\n// the latest next/error message to new subscribers. Unlike Subject<T>,\n// Concast<T> does not expose an Observer<T> interface (this.handlers is\n// intentionally private), since Concast<T> gets its inputs from the\n// concatenated sources. If we ever switch to RxJS, there may be some\n// value in reusing their code, but for now we use zen-observable, which\n// does not contain any Subject implementations.\nexport class Concast<T> extends Observable<T> {\n // Active observers receiving broadcast messages. Thanks to this.latest,\n // we can assume all observers in this Set have received the same most\n // recent message, though possibly at different times in the past.\n private observers = new Set<Observer<T>>();\n\n // This property starts off undefined to indicate the initial\n // subscription has not yet begun, then points to each source\n // subscription in turn, and finally becomes null after the sources have\n // been exhausted. After that, it stays null.\n private sub?: ObservableSubscription | null;\n\n // Not only can the individual elements of the iterable be promises, but\n // also the iterable itself can be wrapped in a promise.\n constructor(sources: MaybeAsync<ConcastSourcesIterable<T>> | Subscriber<T>) {\n super(observer => {\n this.addObserver(observer);\n return () => this.removeObserver(observer);\n });\n\n // Suppress rejection warnings for this.promise, since it's perfectly\n // acceptable to pay no attention to this.promise if you're consuming\n // the results through the normal observable API.\n this.promise.catch(_ => {});\n\n // If someone accidentally tries to create a Concast using a subscriber\n // function, recover by creating an Observable from that subscriber and\n // using it as the source.\n if (typeof sources === \"function\") {\n sources = [new Observable(sources)];\n }\n\n if (isPromiseLike(sources)) {\n sources.then(\n iterable => this.start(iterable),\n this.handlers.error,\n );\n } else {\n this.start(sources);\n }\n }\n\n // A consumable array of source observables, incrementally consumed\n // each time this.handlers.complete is called.\n private sources: Source<T>[];\n\n private start(sources: ConcastSourcesIterable<T>) {\n if (this.sub !== void 0) return;\n\n // In practice, sources is most often simply an Array of observables.\n // TODO Consider using sources[Symbol.iterator]() to take advantage\n // of the laziness of non-Array iterables.\n this.sources = Array.from(sources);\n\n // Calling this.handlers.complete() kicks off consumption of the first\n // source observable. It's tempting to do this step lazily in\n // addObserver, but this.promise can be accessed without calling\n // addObserver, so consumption needs to begin eagerly.\n this.handlers.complete();\n }\n\n private deliverLastMessage(observer: Observer<T>) {\n if (this.latest) {\n const nextOrError = this.latest[0];\n const method = observer[nextOrError];\n if (method) {\n method.call(observer, this.latest[1]);\n }\n // If the subscription is already closed, and the last message was\n // a 'next' message, simulate delivery of the final 'complete'\n // message again.\n if (this.sub === null &&\n nextOrError === \"next\" &&\n observer.complete) {\n observer.complete();\n }\n }\n }\n\n // Note: cleanup observers do not count towards this total.\n private addCount = 0;\n\n public addObserver(observer: Observer<T>) {\n if (!this.observers.has(observer)) {\n // Immediately deliver the most recent message, so we can always\n // be sure all observers have the latest information.\n this.deliverLastMessage(observer);\n this.observers.add(observer);\n ++this.addCount;\n }\n }\n\n public removeObserver(\n observer: Observer<T>,\n quietly?: boolean,\n ) {\n if (this.observers.delete(observer) &&\n --this.addCount < 1 &&\n !quietly) {\n // In case there are still any cleanup observers in this.observers,\n // and no error or completion has been broadcast yet, make sure\n // those observers receive an error that terminates them.\n this.handlers.error(new Error(\"Observable cancelled prematurely\"));\n }\n }\n\n // Any Concast object can be trivially converted to a Promise, without\n // having to create a new wrapper Observable. This promise provides an\n // easy way to observe the final state of the Concast.\n private resolve: (result?: T | PromiseLike<T>) => void;\n private reject: (reason: any) => void;\n public readonly promise = new Promise<T>((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n\n // Name and argument of the most recently invoked observer method, used\n // to deliver latest results immediately to new observers.\n private latest?: [\"next\" | \"error\", any];\n\n // Bound handler functions that can be reused for every internal\n // subscription.\n private handlers = {\n next: (result: T) => {\n if (this.sub !== null) {\n this.latest = [\"next\", result];\n iterateObserversSafely(this.observers, \"next\", result);\n }\n },\n\n error: (error: any) => {\n const { sub } = this;\n if (sub !== null) {\n // Delay unsubscribing from the underlying subscription slightly,\n // so that immediately subscribing another observer can keep the\n // subscription active.\n if (sub) Promise.resolve().then(() => sub.unsubscribe());\n this.sub = null;\n this.latest = [\"error\", error];\n this.reject(error);\n iterateObserversSafely(this.observers, \"error\", error);\n }\n },\n\n complete: () => {\n if (this.sub !== null) {\n const value = this.sources.shift();\n if (!value) {\n this.sub = null;\n if (this.latest &&\n this.latest[0] === \"next\") {\n this.resolve(this.latest[1]);\n } else {\n this.resolve();\n }\n // We do not store this.latest = [\"complete\"], because doing so\n // discards useful information about the previous next (or\n // error) message. Instead, if new observers subscribe after\n // this Concast has completed, they will receive the final\n // 'next' message (unless there was an error) immediately\n // followed by a 'complete' message (see addObserver).\n iterateObserversSafely(this.observers, \"complete\");\n } else if (isPromiseLike(value)) {\n value.then(obs => this.sub = obs.subscribe(this.handlers));\n } else {\n this.sub = value.subscribe(this.handlers);\n }\n }\n },\n };\n\n public cleanup(callback: () => any) {\n let called = false;\n const once = () => {\n if (!called) {\n called = true;\n // Removing a cleanup observer should not unsubscribe from the\n // underlying Observable, so the only removeObserver behavior we\n // need here is to delete observer from this.observers.\n this.observers.delete(observer);\n callback();\n }\n }\n const observer = {\n next: once,\n error: once,\n complete: once,\n };\n const count = this.addCount;\n this.addObserver(observer);\n // Normally addObserver increments this.addCount, but we can \"hide\"\n // cleanup observers by restoring this.addCount to its previous value\n // after adding any cleanup observer.\n this.addCount = count;\n }\n\n // A public way to abort observation and broadcast.\n public cancel = (reason: any) => {\n this.reject(reason);\n this.sources = [];\n this.handlers.complete();\n }\n}\n\n// Necessary because the Concast constructor has a different signature\n// than the Observable constructor.\nfixObservableSubclass(Concast);\n"]}
1
+ {"version":3,"file":"Concast.js","sourceRoot":"","sources":["../../../src/utilities/observables/Concast.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAgD,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAItD,SAAS,aAAa,CAAI,KAAoB;IAC5C,OAAO,KAAK,IAAI,OAAQ,KAAa,CAAC,IAAI,KAAK,UAAU,CAAC;AAC5D,CAAC;AAoCD;IAAgC,2BAAa;IAc3C,iBAAY,OAA8D;QAA1E,YACE,kBAAM,UAAA,QAAQ;YACZ,KAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YAC3B,OAAO,cAAM,OAAA,KAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAA7B,CAA6B,CAAC;QAC7C,CAAC,CAAC,SAsBH;QApCO,eAAS,GAAG,IAAI,GAAG,EAAe,CAAC;QA4EnC,cAAQ,GAAG,CAAC,CAAC;QA+BL,aAAO,GAAG,IAAI,OAAO,CAAI,UAAC,OAAO,EAAE,MAAM;YACvD,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACvB,CAAC,CAAC,CAAC;QAQK,cAAQ,GAAG;YACjB,IAAI,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AC;gBAChC,QAAQ,EAAE,CAAC;aACZ;QACH,CAAC,CAAA;QACD,IAAM,QAAQ,GAAG;YACf,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,IAAI;YACX,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC5B,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAI3B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAQH,cAAC;AAAD,CAAC,AA1MD,CAAgC,UAAU,GA0MzC;;AAID,qBAAqB,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import { Observable, Observer, ObservableSubscription, Subscriber } from \"./Observable\";\nimport { iterateObserversSafely } from \"./iteration\";\nimport { fixObservableSubclass } from \"./subclassing\";\n\ntype MaybeAsync<T> = T | PromiseLike<T>;\n\nfunction isPromiseLike<T>(value: MaybeAsync<T>): value is PromiseLike<T> {\n return value && typeof (value as any).then === \"function\";\n}\n\n// Any individual Source<T> can be an Observable<T> or a promise for one.\ntype Source<T> = MaybeAsync<Observable<T>>;\n\nexport type ConcastSourcesIterable<T> = Iterable<Source<T>>;\n\n// A Concast<T> observable concatenates the given sources into a single\n// non-overlapping sequence of Ts, automatically unwrapping any promises,\n// and broadcasts the T elements of that sequence to any number of\n// subscribers, all without creating a bunch of intermediary Observable\n// wrapper objects.\n//\n// Even though any number of observers can subscribe to the Concast, each\n// source observable is guaranteed to receive at most one subscribe call,\n// and the results are multicast to all observers.\n//\n// In addition to broadcasting every next/error message to this.observers,\n// the Concast stores the most recent message using this.latest, so any\n// new observers can immediately receive the latest message, even if it\n// was originally delivered in the past. This behavior means we can assume\n// every active observer in this.observers has received the same most\n// recent message.\n//\n// With the exception of this.latest replay, a Concast is a \"hot\"\n// observable in the sense that it does not replay past results from the\n// beginning of time for each new observer.\n//\n// Could we have used some existing RxJS class instead? Concast<T> is\n// similar to a BehaviorSubject<T>, because it is multicast and redelivers\n// the latest next/error message to new subscribers. Unlike Subject<T>,\n// Concast<T> does not expose an Observer<T> interface (this.handlers is\n// intentionally private), since Concast<T> gets its inputs from the\n// concatenated sources. If we ever switch to RxJS, there may be some\n// value in reusing their code, but for now we use zen-observable, which\n// does not contain any Subject implementations.\nexport class Concast<T> extends Observable<T> {\n // Active observers receiving broadcast messages. Thanks to this.latest,\n // we can assume all observers in this Set have received the same most\n // recent message, though possibly at different times in the past.\n private observers = new Set<Observer<T>>();\n\n // This property starts off undefined to indicate the initial\n // subscription has not yet begun, then points to each source\n // subscription in turn, and finally becomes null after the sources have\n // been exhausted. After that, it stays null.\n private sub?: ObservableSubscription | null;\n\n // Not only can the individual elements of the iterable be promises, but\n // also the iterable itself can be wrapped in a promise.\n constructor(sources: MaybeAsync<ConcastSourcesIterable<T>> | Subscriber<T>) {\n super(observer => {\n this.addObserver(observer);\n return () => this.removeObserver(observer);\n });\n\n // Suppress rejection warnings for this.promise, since it's perfectly\n // acceptable to pay no attention to this.promise if you're consuming\n // the results through the normal observable API.\n this.promise.catch(_ => {});\n\n // If someone accidentally tries to create a Concast using a subscriber\n // function, recover by creating an Observable from that subscriber and\n // using it as the source.\n if (typeof sources === \"function\") {\n sources = [new Observable(sources)];\n }\n\n if (isPromiseLike(sources)) {\n sources.then(\n iterable => this.start(iterable),\n this.handlers.error,\n );\n } else {\n this.start(sources);\n }\n }\n\n // A consumable array of source observables, incrementally consumed\n // each time this.handlers.complete is called.\n private sources: Source<T>[];\n\n private start(sources: ConcastSourcesIterable<T>) {\n if (this.sub !== void 0) return;\n\n // In practice, sources is most often simply an Array of observables.\n // TODO Consider using sources[Symbol.iterator]() to take advantage\n // of the laziness of non-Array iterables.\n this.sources = Array.from(sources);\n\n // Calling this.handlers.complete() kicks off consumption of the first\n // source observable. It's tempting to do this step lazily in\n // addObserver, but this.promise can be accessed without calling\n // addObserver, so consumption needs to begin eagerly.\n this.handlers.complete();\n }\n\n private deliverLastMessage(observer: Observer<T>) {\n if (this.latest) {\n const nextOrError = this.latest[0];\n const method = observer[nextOrError];\n if (method) {\n method.call(observer, this.latest[1]);\n }\n // If the subscription is already closed, and the last message was\n // a 'next' message, simulate delivery of the final 'complete'\n // message again.\n if (this.sub === null &&\n nextOrError === \"next\" &&\n observer.complete) {\n observer.complete();\n }\n }\n }\n\n // Note: cleanup observers do not count towards this total.\n private addCount = 0;\n\n public addObserver(observer: Observer<T>) {\n if (!this.observers.has(observer)) {\n // Immediately deliver the most recent message, so we can always\n // be sure all observers have the latest information.\n this.deliverLastMessage(observer);\n this.observers.add(observer);\n ++this.addCount;\n }\n }\n\n public removeObserver(\n observer: Observer<T>,\n quietly?: boolean,\n ) {\n if (this.observers.delete(observer) &&\n --this.addCount < 1 &&\n !quietly) {\n // In case there are still any cleanup observers in this.observers,\n // and no error or completion has been broadcast yet, make sure\n // those observers receive an error that terminates them.\n this.handlers.error(new Error(\"Observable cancelled prematurely\"));\n }\n }\n\n // Any Concast object can be trivially converted to a Promise, without\n // having to create a new wrapper Observable. This promise provides an\n // easy way to observe the final state of the Concast.\n private resolve: (result?: T | PromiseLike<T>) => void;\n private reject: (reason: any) => void;\n public readonly promise = new Promise<T>((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n\n // Name and argument of the most recently invoked observer method, used\n // to deliver latest results immediately to new observers.\n private latest?: [\"next\" | \"error\", any];\n\n // Bound handler functions that can be reused for every internal\n // subscription.\n private handlers = {\n next: (result: T) => {\n if (this.sub !== null) {\n this.latest = [\"next\", result];\n iterateObserversSafely(this.observers, \"next\", result);\n }\n },\n\n error: (error: any) => {\n const { sub } = this;\n if (sub !== null) {\n // Delay unsubscribing from the underlying subscription slightly,\n // so that immediately subscribing another observer can keep the\n // subscription active.\n if (sub) setTimeout(() => sub.unsubscribe());\n this.sub = null;\n this.latest = [\"error\", error];\n this.reject(error);\n iterateObserversSafely(this.observers, \"error\", error);\n }\n },\n\n complete: () => {\n if (this.sub !== null) {\n const value = this.sources.shift();\n if (!value) {\n this.sub = null;\n if (this.latest &&\n this.latest[0] === \"next\") {\n this.resolve(this.latest[1]);\n } else {\n this.resolve();\n }\n // We do not store this.latest = [\"complete\"], because doing so\n // discards useful information about the previous next (or\n // error) message. Instead, if new observers subscribe after\n // this Concast has completed, they will receive the final\n // 'next' message (unless there was an error) immediately\n // followed by a 'complete' message (see addObserver).\n iterateObserversSafely(this.observers, \"complete\");\n } else if (isPromiseLike(value)) {\n value.then(obs => this.sub = obs.subscribe(this.handlers));\n } else {\n this.sub = value.subscribe(this.handlers);\n }\n }\n },\n };\n\n public cleanup(callback: () => any) {\n let called = false;\n const once = () => {\n if (!called) {\n called = true;\n // Removing a cleanup observer should not unsubscribe from the\n // underlying Observable, so the only removeObserver behavior we\n // need here is to delete observer from this.observers.\n this.observers.delete(observer);\n callback();\n }\n }\n const observer = {\n next: once,\n error: once,\n complete: once,\n };\n const count = this.addCount;\n this.addObserver(observer);\n // Normally addObserver increments this.addCount, but we can \"hide\"\n // cleanup observers by restoring this.addCount to its previous value\n // after adding any cleanup observer.\n this.addCount = count;\n }\n\n // A public way to abort observation and broadcast.\n public cancel = (reason: any) => {\n this.reject(reason);\n this.sources = [];\n this.handlers.complete();\n }\n}\n\n// Necessary because the Concast constructor has a different signature\n// than the Observable constructor.\nfixObservableSubclass(Concast);\n"]}
@@ -102,7 +102,7 @@ var MockLink = (function (_super) {
102
102
  MockLink.prototype.normalizeMockedResponse = function (mockedResponse) {
103
103
  var newMockedResponse = cloneDeep(mockedResponse);
104
104
  var queryWithoutConnection = removeConnectionDirectiveFromDocument(newMockedResponse.request.query);
105
- __DEV__ ? invariant(queryWithoutConnection, "query is required") : invariant(queryWithoutConnection, 60);
105
+ __DEV__ ? invariant(queryWithoutConnection, "query is required") : invariant(queryWithoutConnection, 55);
106
106
  newMockedResponse.request.query = queryWithoutConnection;
107
107
  var query = removeClientSetsFromDocument(newMockedResponse.request.query);
108
108
  if (query) {
@@ -45,6 +45,9 @@ function removeTemporaryGlobals() {
45
45
  return process$1.remove();
46
46
  }
47
47
 
48
+ function checkDEV() {
49
+ __DEV__ ? tsInvariant.invariant("boolean" === typeof DEV, DEV) : tsInvariant.invariant("boolean" === typeof DEV, 38);
50
+ }
48
51
  removeTemporaryGlobals();
49
52
 
50
53
  function shouldInclude(_a, variables) {
@@ -57,7 +60,7 @@ function shouldInclude(_a, variables) {
57
60
  var evaledValue = false;
58
61
  if (ifArgument.value.kind === 'Variable') {
59
62
  evaledValue = variables && variables[ifArgument.value.name.value];
60
- __DEV__ ? tsInvariant.invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive.") : tsInvariant.invariant(evaledValue !== void 0, 43);
63
+ __DEV__ ? tsInvariant.invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive.") : tsInvariant.invariant(evaledValue !== void 0, 39);
61
64
  }
62
65
  else {
63
66
  evaledValue = ifArgument.value.value;
@@ -94,13 +97,13 @@ function getInclusionDirectives(directives) {
94
97
  return;
95
98
  var directiveArguments = directive.arguments;
96
99
  var directiveName = directive.name.value;
97
- __DEV__ ? tsInvariant.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive.") : tsInvariant.invariant(directiveArguments && directiveArguments.length === 1, 44);
100
+ __DEV__ ? tsInvariant.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive.") : tsInvariant.invariant(directiveArguments && directiveArguments.length === 1, 40);
98
101
  var ifArgument = directiveArguments[0];
99
- __DEV__ ? tsInvariant.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive.") : tsInvariant.invariant(ifArgument.name && ifArgument.name.value === 'if', 45);
102
+ __DEV__ ? tsInvariant.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive.") : tsInvariant.invariant(ifArgument.name && ifArgument.name.value === 'if', 41);
100
103
  var ifValue = ifArgument.value;
101
104
  __DEV__ ? tsInvariant.invariant(ifValue &&
102
105
  (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value.") : tsInvariant.invariant(ifValue &&
103
- (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 46);
106
+ (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 42);
104
107
  result.push({ directive: directive, ifArgument: ifArgument });
105
108
  });
106
109
  }
@@ -113,14 +116,14 @@ function getFragmentQueryDocument(document, fragmentName) {
113
116
  document.definitions.forEach(function (definition) {
114
117
  if (definition.kind === 'OperationDefinition') {
115
118
  throw __DEV__ ? new tsInvariant.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " +
116
- 'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new tsInvariant.InvariantError(47);
119
+ 'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new tsInvariant.InvariantError(43);
117
120
  }
118
121
  if (definition.kind === 'FragmentDefinition') {
119
122
  fragments.push(definition);
120
123
  }
121
124
  });
122
125
  if (typeof actualFragmentName === 'undefined') {
123
- __DEV__ ? tsInvariant.invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.") : tsInvariant.invariant(fragments.length === 1, 48);
126
+ __DEV__ ? tsInvariant.invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.") : tsInvariant.invariant(fragments.length === 1, 44);
124
127
  actualFragmentName = fragments[0].name.value;
125
128
  }
126
129
  var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
@@ -157,7 +160,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
157
160
  return selection;
158
161
  case 'FragmentSpread': {
159
162
  var fragment = fragmentMap && fragmentMap[selection.name.value];
160
- __DEV__ ? tsInvariant.invariant(fragment, "No fragment named " + selection.name.value + ".") : tsInvariant.invariant(fragment, 49);
163
+ __DEV__ ? tsInvariant.invariant(fragment, "No fragment named " + selection.name.value + ".") : tsInvariant.invariant(fragment, 45);
161
164
  return fragment;
162
165
  }
163
166
  default:
@@ -241,7 +244,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
241
244
  else {
242
245
  throw __DEV__ ? new tsInvariant.InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" +
243
246
  'is not supported. Use variables instead of inline arguments to ' +
244
- 'overcome this limitation.') : new tsInvariant.InvariantError(58);
247
+ 'overcome this limitation.') : new tsInvariant.InvariantError(54);
245
248
  }
246
249
  }
247
250
  function storeKeyNameFromField(field, variables) {
@@ -375,16 +378,16 @@ function isInlineFragment(selection) {
375
378
  }
376
379
 
377
380
  function checkDocument(doc) {
378
- __DEV__ ? tsInvariant.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") : tsInvariant.invariant(doc && doc.kind === 'Document', 50);
381
+ __DEV__ ? tsInvariant.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") : tsInvariant.invariant(doc && doc.kind === 'Document', 46);
379
382
  var operations = doc.definitions
380
383
  .filter(function (d) { return d.kind !== 'FragmentDefinition'; })
381
384
  .map(function (definition) {
382
385
  if (definition.kind !== 'OperationDefinition') {
383
- throw __DEV__ ? new tsInvariant.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"") : new tsInvariant.InvariantError(51);
386
+ throw __DEV__ ? new tsInvariant.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"") : new tsInvariant.InvariantError(47);
384
387
  }
385
388
  return definition;
386
389
  });
387
- __DEV__ ? tsInvariant.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations") : tsInvariant.invariant(operations.length <= 1, 52);
390
+ __DEV__ ? tsInvariant.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations") : tsInvariant.invariant(operations.length <= 1, 48);
388
391
  return doc;
389
392
  }
390
393
  function getOperationDefinition(doc) {
@@ -403,14 +406,14 @@ function getFragmentDefinitions(doc) {
403
406
  }
404
407
  function getQueryDefinition(doc) {
405
408
  var queryDef = getOperationDefinition(doc);
406
- __DEV__ ? tsInvariant.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : tsInvariant.invariant(queryDef && queryDef.operation === 'query', 53);
409
+ __DEV__ ? tsInvariant.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : tsInvariant.invariant(queryDef && queryDef.operation === 'query', 49);
407
410
  return queryDef;
408
411
  }
409
412
  function getFragmentDefinition(doc) {
410
- __DEV__ ? tsInvariant.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") : tsInvariant.invariant(doc.kind === 'Document', 54);
411
- __DEV__ ? tsInvariant.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : tsInvariant.invariant(doc.definitions.length <= 1, 55);
413
+ __DEV__ ? tsInvariant.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") : tsInvariant.invariant(doc.kind === 'Document', 50);
414
+ __DEV__ ? tsInvariant.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : tsInvariant.invariant(doc.definitions.length <= 1, 51);
412
415
  var fragmentDef = doc.definitions[0];
413
- __DEV__ ? tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 56);
416
+ __DEV__ ? tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 52);
414
417
  return fragmentDef;
415
418
  }
416
419
  function getMainDefinition(queryDoc) {
@@ -433,7 +436,7 @@ function getMainDefinition(queryDoc) {
433
436
  if (fragmentDefinition) {
434
437
  return fragmentDefinition;
435
438
  }
436
- throw __DEV__ ? new tsInvariant.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new tsInvariant.InvariantError(57);
439
+ throw __DEV__ ? new tsInvariant.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new tsInvariant.InvariantError(53);
437
440
  }
438
441
  function getDefaultValues(definition) {
439
442
  var defaultValues = Object.create(null);
@@ -1073,7 +1076,7 @@ var Concast = (function (_super) {
1073
1076
  var sub = _this.sub;
1074
1077
  if (sub !== null) {
1075
1078
  if (sub)
1076
- Promise.resolve().then(function () { return sub.unsubscribe(); });
1079
+ setTimeout(function () { return sub.unsubscribe(); });
1077
1080
  _this.sub = null;
1078
1081
  _this.latest = ["error", error];
1079
1082
  _this.reject(error);
@@ -1222,7 +1225,7 @@ function stringifyForDisplay(value) {
1222
1225
  }).split(JSON.stringify(undefId)).join("<undefined>");
1223
1226
  }
1224
1227
 
1225
- __DEV__ ? tsInvariant.invariant("boolean" === typeof DEV, DEV) : tsInvariant.invariant("boolean" === typeof DEV, 59);
1228
+ checkDEV();
1226
1229
 
1227
1230
  exports.Observable = zenObservableTs.Observable;
1228
1231
  exports.Concast = Concast;
@@ -1234,6 +1237,7 @@ exports.asyncMap = asyncMap;
1234
1237
  exports.buildQueryFromSelectionSet = buildQueryFromSelectionSet;
1235
1238
  exports.canUseWeakMap = canUseWeakMap;
1236
1239
  exports.canUseWeakSet = canUseWeakSet;
1240
+ exports.checkDEV = checkDEV;
1237
1241
  exports.checkDocument = checkDocument;
1238
1242
  exports.cloneDeep = cloneDeep;
1239
1243
  exports.compact = compact;
@@ -1265,6 +1269,7 @@ exports.isReference = isReference;
1265
1269
  exports.iterateObserversSafely = iterateObserversSafely;
1266
1270
  exports.makeReference = makeReference;
1267
1271
  exports.makeUniqueId = makeUniqueId;
1272
+ exports.maybe = maybe;
1268
1273
  exports.maybeDeepFreeze = maybeDeepFreeze;
1269
1274
  exports.mergeDeep = mergeDeep;
1270
1275
  exports.mergeDeepArray = mergeDeepArray;