@apollo/client 3.4.6 → 3.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apollo-client.cjs.js +155 -156
- package/apollo-client.cjs.js.map +1 -1
- package/apollo-core.cjs.js +136 -103
- package/apollo-core.cjs.js.map +1 -1
- package/apollo-core.cjs.min.js +1 -1
- package/cache/cache.cjs.js +32 -31
- package/cache/cache.cjs.js.map +1 -1
- package/cache/index.d.ts +1 -0
- package/cache/index.d.ts.map +1 -1
- package/cache/index.js +1 -3
- package/cache/index.js.map +1 -1
- package/cache/inmemory/entityStore.js +2 -2
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/object-canon.d.ts +1 -0
- package/cache/inmemory/object-canon.d.ts.map +1 -1
- package/cache/inmemory/object-canon.js +1 -0
- package/cache/inmemory/object-canon.js.map +1 -1
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +13 -10
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +4 -4
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/writeToStore.d.ts +1 -1
- package/cache/inmemory/writeToStore.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.js +5 -5
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js +3 -3
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.d.ts.map +1 -1
- package/core/LocalState.js +2 -2
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +7 -6
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +79 -46
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js +10 -10
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs.js +109 -75
- package/core/core.cjs.js.map +1 -1
- package/core/index.js +1 -1
- package/core/index.js.map +1 -1
- package/errors/errors.cjs.js +1 -2
- package/errors/errors.cjs.js.map +1 -1
- package/errors/index.d.ts +1 -0
- package/errors/index.d.ts.map +1 -1
- package/errors/index.js +1 -3
- package/errors/index.js.map +1 -1
- package/invariantErrorCodes.js +56 -81
- package/link/core/ApolloLink.js +2 -2
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/core.cjs.js +4 -6
- package/link/core/core.cjs.js.map +1 -1
- package/link/core/index.d.ts +1 -0
- package/link/core/index.d.ts.map +1 -1
- package/link/core/index.js +1 -3
- package/link/core/index.js.map +1 -1
- package/link/http/checkFetcher.js +2 -2
- package/link/http/checkFetcher.js.map +1 -1
- package/link/http/createHttpLink.d.ts +1 -0
- package/link/http/createHttpLink.d.ts.map +1 -1
- package/link/http/createHttpLink.js +1 -0
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/http.cjs.js +3 -3
- package/link/http/http.cjs.js.map +1 -1
- package/link/http/index.d.ts +1 -0
- package/link/http/index.d.ts.map +1 -1
- package/link/http/index.js +1 -0
- package/link/http/index.js.map +1 -1
- package/link/http/serializeFetchParameter.d.ts +1 -1
- package/link/http/serializeFetchParameter.d.ts.map +1 -1
- package/link/http/serializeFetchParameter.js +2 -2
- package/link/http/serializeFetchParameter.js.map +1 -1
- package/link/persisted-queries/index.d.ts.map +1 -1
- package/link/persisted-queries/index.js +3 -3
- package/link/persisted-queries/index.js.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.js +5 -5
- package/link/persisted-queries/persisted-queries.cjs.js.map +1 -1
- package/link/utils/index.d.ts +1 -0
- package/link/utils/index.d.ts.map +1 -1
- package/link/utils/index.js +1 -0
- package/link/utils/index.js.map +1 -1
- package/link/utils/toPromise.d.ts.map +1 -1
- package/link/utils/toPromise.js +1 -1
- package/link/utils/toPromise.js.map +1 -1
- package/link/utils/utils.cjs.js +3 -3
- package/link/utils/utils.cjs.js.map +1 -1
- package/link/utils/validateOperation.d.ts.map +1 -1
- package/link/utils/validateOperation.js +2 -2
- package/link/utils/validateOperation.js.map +1 -1
- package/package.json +6 -6
- package/react/context/ApolloConsumer.d.ts.map +1 -1
- package/react/context/ApolloConsumer.js +2 -2
- package/react/context/ApolloConsumer.js.map +1 -1
- package/react/context/ApolloProvider.d.ts.map +1 -1
- package/react/context/ApolloProvider.js +2 -2
- package/react/context/ApolloProvider.js.map +1 -1
- package/react/context/context.cjs.js +5 -5
- package/react/context/context.cjs.js.map +1 -1
- package/react/context/index.d.ts +1 -0
- package/react/context/index.d.ts.map +1 -1
- package/react/context/index.js +1 -0
- package/react/context/index.js.map +1 -1
- package/react/data/OperationData.d.ts.map +1 -1
- package/react/data/OperationData.js +3 -3
- package/react/data/OperationData.js.map +1 -1
- package/react/data/QueryData.d.ts.map +1 -1
- package/react/data/QueryData.js +9 -11
- package/react/data/QueryData.js.map +1 -1
- package/react/data/data.cjs.js +14 -16
- package/react/data/data.cjs.js.map +1 -1
- package/react/data/index.d.ts +1 -0
- package/react/data/index.d.ts.map +1 -1
- package/react/data/index.js +1 -0
- package/react/data/index.js.map +1 -1
- package/react/hoc/hoc-utils.d.ts.map +1 -1
- package/react/hoc/hoc-utils.js +2 -2
- package/react/hoc/hoc-utils.js.map +1 -1
- package/react/hoc/hoc.cjs.js +5 -5
- package/react/hoc/hoc.cjs.js.map +1 -1
- package/react/hoc/index.d.ts +1 -0
- package/react/hoc/index.d.ts.map +1 -1
- package/react/hoc/index.js +1 -0
- package/react/hoc/index.js.map +1 -1
- package/react/hoc/withApollo.d.ts.map +1 -1
- package/react/hoc/withApollo.js +2 -2
- package/react/hoc/withApollo.js.map +1 -1
- package/react/hooks/hooks.cjs.js +3 -3
- package/react/hooks/hooks.cjs.js.map +1 -1
- package/react/hooks/index.d.ts +1 -0
- package/react/hooks/index.d.ts.map +1 -1
- package/react/hooks/index.js +1 -0
- package/react/hooks/index.js.map +1 -1
- package/react/hooks/useApolloClient.d.ts.map +1 -1
- package/react/hooks/useApolloClient.js +2 -2
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +1 -0
- package/react/hooks/useSubscription.d.ts.map +1 -1
- package/react/hooks/useSubscription.js +1 -0
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/utils/useAfterFastRefresh.d.ts +1 -0
- package/react/hooks/utils/useAfterFastRefresh.d.ts.map +1 -1
- package/react/hooks/utils/useAfterFastRefresh.js +1 -0
- package/react/hooks/utils/useAfterFastRefresh.js.map +1 -1
- package/react/hooks/utils/useBaseQuery.d.ts +1 -0
- package/react/hooks/utils/useBaseQuery.d.ts.map +1 -1
- package/react/hooks/utils/useBaseQuery.js +1 -0
- package/react/hooks/utils/useBaseQuery.js.map +1 -1
- package/react/index.d.ts +1 -0
- package/react/index.d.ts.map +1 -1
- package/react/index.js +1 -3
- package/react/index.js.map +1 -1
- package/react/parser/index.d.ts.map +1 -1
- package/react/parser/index.js +5 -5
- package/react/parser/index.js.map +1 -1
- package/react/parser/parser.cjs.js +10 -10
- package/react/parser/parser.cjs.js.map +1 -1
- package/react/react.cjs.js +2 -3
- package/react/react.cjs.js.map +1 -1
- package/testing/index.d.ts +1 -0
- package/testing/index.d.ts.map +1 -1
- package/testing/index.js +1 -3
- package/testing/index.js.map +1 -1
- package/testing/testing.cjs.js +3 -5
- package/testing/testing.cjs.js.map +1 -1
- package/utilities/globals/DEV.js +2 -2
- package/utilities/globals/DEV.js.map +1 -1
- package/utilities/{common → globals}/global.d.ts +0 -0
- package/utilities/globals/global.d.ts.map +1 -0
- package/utilities/{common → globals}/global.js +0 -0
- package/utilities/globals/global.js.map +1 -0
- package/utilities/globals/globals.cjs.js +56 -0
- package/utilities/globals/globals.cjs.js.map +1 -0
- package/utilities/globals/index.d.ts +5 -2
- package/utilities/globals/index.d.ts.map +1 -1
- package/utilities/globals/index.js +7 -1
- package/utilities/globals/index.js.map +1 -1
- package/utilities/{common → globals}/maybe.d.ts +0 -0
- package/utilities/globals/maybe.d.ts.map +1 -0
- package/utilities/{common → globals}/maybe.js +0 -0
- package/utilities/globals/maybe.js.map +1 -0
- package/utilities/globals/package.json +7 -0
- package/utilities/graphql/directives.d.ts.map +1 -1
- package/utilities/graphql/directives.js +5 -5
- package/utilities/graphql/directives.js.map +1 -1
- package/utilities/graphql/fragments.d.ts.map +1 -1
- package/utilities/graphql/fragments.js +4 -4
- package/utilities/graphql/fragments.js.map +1 -1
- package/utilities/graphql/getFromAST.d.ts.map +1 -1
- package/utilities/graphql/getFromAST.js +9 -9
- package/utilities/graphql/getFromAST.js.map +1 -1
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +2 -2
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.d.ts.map +1 -1
- package/utilities/graphql/transform.js +1 -1
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +1 -3
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +1 -5
- package/utilities/index.js.map +1 -1
- package/utilities/observables/Concast.js +1 -1
- package/utilities/observables/Concast.js.map +1 -1
- package/utilities/package.json +1 -3
- package/utilities/testing/mocking/mockLink.d.ts.map +1 -1
- package/utilities/testing/mocking/mockLink.js +2 -2
- package/utilities/testing/mocking/mockLink.js.map +1 -1
- package/utilities/utilities.cjs.js +25 -66
- package/utilities/utilities.cjs.js.map +1 -1
- package/version.js +1 -1
- package/utilities/common/global.d.ts.map +0 -1
- package/utilities/common/global.js.map +0 -1
- package/utilities/common/maybe.d.ts.map +0 -1
- package/utilities/common/maybe.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
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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AC,QAAQ,CAAC,CAAC;YAClC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC7B,EAAE,IAAI,CAAC,QAAQ,CAAC;SACjB;IACH,CAAC;IAEM,gCAAc,GAArB,UACE,QAAqB,EACrB,OAAiB;QAEjB,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC;YAC/B,EAAE,IAAI,CAAC,QAAQ,GAAG,CAAC;YACnB,CAAC,OAAO,EAAE;YAIZ,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC,CAAC;SACpE;IACH,CAAC;IAmEM,yBAAO,GAAd,UAAe,QAAmB;QAAlC,iBAuBC;QAtBC,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,IAAM,IAAI,GAAG;YACX,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM,GAAG,IAAI,CAAC;gBAId,KAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;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) 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,EAAE,UAAC,MAAS;gBACd,IAAI,KAAI,CAAC,GAAG,KAAK,IAAI,EAAE;oBACrB,KAAI,CAAC,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;oBAC/B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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"]}
|
package/utilities/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockLink.d.ts","sourceRoot":"","sources":["../../../../src/utilities/testing/mocking/mockLink.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"mockLink.d.ts","sourceRoot":"","sources":["../../../../src/utilities/testing/mocking/mockLink.ts"],"names":[],"mappings":";AAKA,OAAO,EACL,UAAU,EACV,SAAS,EACT,cAAc,EACd,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,UAAU,EAMX,MAAM,oBAAoB,CAAC;AAE5B,oBAAY,cAAc,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAExC,MAAM,WAAW,cAAc,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACzD,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;IACjE,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;CACvC;AAUD,qBAAa,QAAS,SAAQ,UAAU;IAC/B,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,OAAO,CAAQ;IACnC,OAAO,CAAC,oBAAoB,CAA2C;gBAGrE,eAAe,EAAE,aAAa,CAAC,cAAc,CAAC,EAC9C,WAAW,GAAE,OAAc;IAWtB,iBAAiB,CAAC,cAAc,EAAE,cAAc;IAgBhD,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI;IAoFpE,OAAO,CAAC,uBAAuB;CAehC;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAKD,wBAAgB,cAAc,CAC5B,GAAG,eAAe,EAAE,KAAK,CAAC,GAAG,CAAC,GAC7B,cAAc,CAYhB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
|
+
import { invariant } from "../../globals/index.js";
|
|
2
3
|
import { print } from 'graphql';
|
|
3
4
|
import { equal } from '@wry/equality';
|
|
4
|
-
import { invariant } from 'ts-invariant';
|
|
5
5
|
import { ApolloLink, } from "../../../link/core/index.js";
|
|
6
6
|
import { Observable, addTypenameToDocument, removeClientSetsFromDocument, removeConnectionDirectiveFromDocument, cloneDeep, stringifyForDisplay, } from "../../index.js";
|
|
7
7
|
function requestToKey(request, addTypename) {
|
|
@@ -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,
|
|
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) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockLink.js","sourceRoot":"","sources":["../../../../src/utilities/testing/mocking/mockLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EACL,UAAU,GAIX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,4BAA4B,EAC5B,qCAAqC,EACrC,SAAS,EACT,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAY5B,SAAS,YAAY,CAAC,OAAuB,EAAE,WAAoB;IACjE,IAAM,WAAW,GACf,OAAO,CAAC,KAAK;QACb,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,qBAAqB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5E,IAAM,UAAU,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACpC,CAAC;AAED;IAA8B,4BAAU;IAKtC,kBACE,eAA8C,EAC9C,WAA2B;QAA3B,4BAAA,EAAA,kBAA2B;QAF7B,YAIE,iBAAO,SAOR;QAdM,iBAAW,GAAY,IAAI,CAAC;QAC3B,0BAAoB,GAAwC,EAAE,CAAC;QAOrE,KA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CAAC;QAC5E,IAAI,KAAK,EAAE;YACT,iBAAiB,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;SACzC;QACD,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IACH,eAAC;AAAD,CAAC,AArID,CAA8B,UAAU,GAqIvC;;AASD,MAAM,UAAU,cAAc;IAC5B,yBAA8B;SAA9B,UAA8B,EAA9B,qBAA8B,EAA9B,IAA8B;QAA9B,oCAA8B;;IAI9B,IAAI,aAAa,GAAG,eAAe,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAChE,IAAI,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEjE,IAAI,OAAO,aAAa,KAAK,SAAS,EAAE;QACtC,KAAK,GAAG,eAAe,CAAC;QACxB,aAAa,GAAG,IAAI,CAAC;KACtB;IAED,OAAO,IAAI,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import { print } from 'graphql';\nimport { equal } from '@wry/equality';\nimport { invariant } from 'ts-invariant';\n\nimport {\n ApolloLink,\n Operation,\n GraphQLRequest,\n FetchResult,\n} from '../../../link/core';\n\nimport {\n Observable,\n addTypenameToDocument,\n removeClientSetsFromDocument,\n removeConnectionDirectiveFromDocument,\n cloneDeep,\n stringifyForDisplay,\n} from '../../../utilities';\n\nexport type ResultFunction<T> = () => T;\n\nexport interface MockedResponse<TData = Record<string, any>> {\n request: GraphQLRequest;\n result?: FetchResult<TData> | ResultFunction<FetchResult<TData>>;\n error?: Error;\n delay?: number;\n newData?: ResultFunction<FetchResult>;\n}\n\nfunction requestToKey(request: GraphQLRequest, addTypename: Boolean): string {\n const queryString =\n request.query &&\n print(addTypename ? addTypenameToDocument(request.query) : request.query);\n const requestKey = { query: queryString };\n return JSON.stringify(requestKey);\n}\n\nexport class MockLink extends ApolloLink {\n public operation: Operation;\n public addTypename: Boolean = true;\n private mockedResponsesByKey: { [key: string]: MockedResponse[] } = {};\n\n constructor(\n mockedResponses: ReadonlyArray<MockedResponse>,\n addTypename: Boolean = true\n ) {\n super();\n this.addTypename = addTypename;\n if (mockedResponses) {\n mockedResponses.forEach(mockedResponse => {\n this.addMockedResponse(mockedResponse);\n });\n }\n }\n\n public addMockedResponse(mockedResponse: MockedResponse) {\n const normalizedMockedResponse = this.normalizeMockedResponse(\n mockedResponse\n );\n const key = requestToKey(\n normalizedMockedResponse.request,\n this.addTypename\n );\n let mockedResponses = this.mockedResponsesByKey[key];\n if (!mockedResponses) {\n mockedResponses = [];\n this.mockedResponsesByKey[key] = mockedResponses;\n }\n mockedResponses.push(normalizedMockedResponse);\n }\n\n public request(operation: Operation): Observable<FetchResult> | null {\n this.operation = operation;\n const key = requestToKey(operation, this.addTypename);\n const unmatchedVars: Array<Record<string, any>> = [];\n const requestVariables = operation.variables || {};\n const mockedResponses = this.mockedResponsesByKey[key];\n const responseIndex = mockedResponses ? mockedResponses.findIndex((res, index) => {\n const mockedResponseVars = res.request.variables || {};\n if (equal(requestVariables, mockedResponseVars)) {\n return true;\n }\n unmatchedVars.push(mockedResponseVars);\n return false;\n }) : -1;\n\n const response = responseIndex >= 0\n ? mockedResponses[responseIndex]\n : void 0;\n\n let configError: Error;\n\n if (!response) {\n configError = new Error(\n`No more mocked responses for the query: ${print(operation.query)}\nExpected variables: ${stringifyForDisplay(operation.variables)}\n${unmatchedVars.length > 0 ? `\nFailed to match ${unmatchedVars.length} mock${\n unmatchedVars.length === 1 ? \"\" : \"s\"\n} for this query, which had the following variables:\n${unmatchedVars.map(d => ` ${stringifyForDisplay(d)}`).join('\\n')}\n` : \"\"}`);\n } else {\n mockedResponses.splice(responseIndex, 1);\n\n const { newData } = response;\n if (newData) {\n response.result = newData();\n mockedResponses.push(response);\n }\n\n if (!response.result && !response.error) {\n configError = new Error(\n `Mocked response should contain either result or error: ${key}`\n );\n }\n }\n\n return new Observable(observer => {\n const timer = setTimeout(() => {\n if (configError) {\n try {\n // The onError function can return false to indicate that\n // configError need not be passed to observer.error. For\n // example, the default implementation of onError calls\n // observer.error(configError) and then returns false to\n // prevent this extra (harmless) observer.error call.\n if (this.onError(configError, observer) !== false) {\n throw configError;\n }\n } catch (error) {\n observer.error(error);\n }\n } else if (response) {\n if (response.error) {\n observer.error(response.error);\n } else {\n if (response.result) {\n observer.next(\n typeof response.result === 'function'\n ? (response.result as ResultFunction<FetchResult>)()\n : response.result\n );\n }\n observer.complete();\n }\n }\n }, response && response.delay || 0);\n\n return () => {\n clearTimeout(timer);\n };\n });\n }\n\n private normalizeMockedResponse(\n mockedResponse: MockedResponse\n ): MockedResponse {\n const newMockedResponse = cloneDeep(mockedResponse);\n const queryWithoutConnection = removeConnectionDirectiveFromDocument(\n newMockedResponse.request.query\n );\n invariant(queryWithoutConnection, \"query is required\");\n newMockedResponse.request.query = queryWithoutConnection!;\n const query = removeClientSetsFromDocument(newMockedResponse.request.query);\n if (query) {\n newMockedResponse.request.query = query;\n }\n return newMockedResponse;\n }\n}\n\nexport interface MockApolloLink extends ApolloLink {\n operation?: Operation;\n}\n\n// Pass in multiple mocked responses, so that you can test flows that end up\n// making multiple queries to the server.\n// NOTE: The last arg can optionally be an `addTypename` arg.\nexport function mockSingleLink(\n ...mockedResponses: Array<any>\n): MockApolloLink {\n // To pull off the potential typename. If this isn't a boolean, we'll just\n // set it true later.\n let maybeTypename = mockedResponses[mockedResponses.length - 1];\n let mocks = mockedResponses.slice(0, mockedResponses.length - 1);\n\n if (typeof maybeTypename !== 'boolean') {\n mocks = mockedResponses;\n maybeTypename = true;\n }\n\n return new MockLink(mocks, maybeTypename);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mockLink.js","sourceRoot":"","sources":["../../../../src/utilities/testing/mocking/mockLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;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a,KAAK,SAAS,EAAE;QACtC,KAAK,GAAG,eAAe,CAAC;QACxB,aAAa,GAAG,IAAI,CAAC;KACtB;IAED,OAAO,IAAI,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import { invariant } from '../../globals';\n\nimport { print } from 'graphql';\nimport { equal } from '@wry/equality';\n\nimport {\n ApolloLink,\n Operation,\n GraphQLRequest,\n FetchResult,\n} from '../../../link/core';\n\nimport {\n Observable,\n addTypenameToDocument,\n removeClientSetsFromDocument,\n removeConnectionDirectiveFromDocument,\n cloneDeep,\n stringifyForDisplay,\n} from '../../../utilities';\n\nexport type ResultFunction<T> = () => T;\n\nexport interface MockedResponse<TData = Record<string, any>> {\n request: GraphQLRequest;\n result?: FetchResult<TData> | ResultFunction<FetchResult<TData>>;\n error?: Error;\n delay?: number;\n newData?: ResultFunction<FetchResult>;\n}\n\nfunction requestToKey(request: GraphQLRequest, addTypename: Boolean): string {\n const queryString =\n request.query &&\n print(addTypename ? addTypenameToDocument(request.query) : request.query);\n const requestKey = { query: queryString };\n return JSON.stringify(requestKey);\n}\n\nexport class MockLink extends ApolloLink {\n public operation: Operation;\n public addTypename: Boolean = true;\n private mockedResponsesByKey: { [key: string]: MockedResponse[] } = {};\n\n constructor(\n mockedResponses: ReadonlyArray<MockedResponse>,\n addTypename: Boolean = true\n ) {\n super();\n this.addTypename = addTypename;\n if (mockedResponses) {\n mockedResponses.forEach(mockedResponse => {\n this.addMockedResponse(mockedResponse);\n });\n }\n }\n\n public addMockedResponse(mockedResponse: MockedResponse) {\n const normalizedMockedResponse = this.normalizeMockedResponse(\n mockedResponse\n );\n const key = requestToKey(\n normalizedMockedResponse.request,\n this.addTypename\n );\n let mockedResponses = this.mockedResponsesByKey[key];\n if (!mockedResponses) {\n mockedResponses = [];\n this.mockedResponsesByKey[key] = mockedResponses;\n }\n mockedResponses.push(normalizedMockedResponse);\n }\n\n public request(operation: Operation): Observable<FetchResult> | null {\n this.operation = operation;\n const key = requestToKey(operation, this.addTypename);\n const unmatchedVars: Array<Record<string, any>> = [];\n const requestVariables = operation.variables || {};\n const mockedResponses = this.mockedResponsesByKey[key];\n const responseIndex = mockedResponses ? mockedResponses.findIndex((res, index) => {\n const mockedResponseVars = res.request.variables || {};\n if (equal(requestVariables, mockedResponseVars)) {\n return true;\n }\n unmatchedVars.push(mockedResponseVars);\n return false;\n }) : -1;\n\n const response = responseIndex >= 0\n ? mockedResponses[responseIndex]\n : void 0;\n\n let configError: Error;\n\n if (!response) {\n configError = new Error(\n`No more mocked responses for the query: ${print(operation.query)}\nExpected variables: ${stringifyForDisplay(operation.variables)}\n${unmatchedVars.length > 0 ? `\nFailed to match ${unmatchedVars.length} mock${\n unmatchedVars.length === 1 ? \"\" : \"s\"\n} for this query, which had the following variables:\n${unmatchedVars.map(d => ` ${stringifyForDisplay(d)}`).join('\\n')}\n` : \"\"}`);\n } else {\n mockedResponses.splice(responseIndex, 1);\n\n const { newData } = response;\n if (newData) {\n response.result = newData();\n mockedResponses.push(response);\n }\n\n if (!response.result && !response.error) {\n configError = new Error(\n `Mocked response should contain either result or error: ${key}`\n );\n }\n }\n\n return new Observable(observer => {\n const timer = setTimeout(() => {\n if (configError) {\n try {\n // The onError function can return false to indicate that\n // configError need not be passed to observer.error. For\n // example, the default implementation of onError calls\n // observer.error(configError) and then returns false to\n // prevent this extra (harmless) observer.error call.\n if (this.onError(configError, observer) !== false) {\n throw configError;\n }\n } catch (error) {\n observer.error(error);\n }\n } else if (response) {\n if (response.error) {\n observer.error(response.error);\n } else {\n if (response.result) {\n observer.next(\n typeof response.result === 'function'\n ? (response.result as ResultFunction<FetchResult>)()\n : response.result\n );\n }\n observer.complete();\n }\n }\n }, response && response.delay || 0);\n\n return () => {\n clearTimeout(timer);\n };\n });\n }\n\n private normalizeMockedResponse(\n mockedResponse: MockedResponse\n ): MockedResponse {\n const newMockedResponse = cloneDeep(mockedResponse);\n const queryWithoutConnection = removeConnectionDirectiveFromDocument(\n newMockedResponse.request.query\n );\n invariant(queryWithoutConnection, \"query is required\");\n newMockedResponse.request.query = queryWithoutConnection!;\n const query = removeClientSetsFromDocument(newMockedResponse.request.query);\n if (query) {\n newMockedResponse.request.query = query;\n }\n return newMockedResponse;\n }\n}\n\nexport interface MockApolloLink extends ApolloLink {\n operation?: Operation;\n}\n\n// Pass in multiple mocked responses, so that you can test flows that end up\n// making multiple queries to the server.\n// NOTE: The last arg can optionally be an `addTypename` arg.\nexport function mockSingleLink(\n ...mockedResponses: Array<any>\n): MockApolloLink {\n // To pull off the potential typename. If this isn't a boolean, we'll just\n // set it true later.\n let maybeTypename = mockedResponses[mockedResponses.length - 1];\n let mocks = mockedResponses.slice(0, mockedResponses.length - 1);\n\n if (typeof maybeTypename !== 'boolean') {\n mocks = mockedResponses;\n maybeTypename = true;\n }\n\n return new MockLink(mocks, maybeTypename);\n}\n"]}
|
|
@@ -2,51 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var process$1 = require('ts-invariant/process');
|
|
5
|
+
var globals = require('./globals');
|
|
7
6
|
var graphql = require('graphql');
|
|
8
7
|
var tslib = require('tslib');
|
|
9
8
|
var zenObservableTs = require('zen-observable-ts');
|
|
10
9
|
require('symbol-observable');
|
|
11
10
|
|
|
12
|
-
function maybe(thunk) {
|
|
13
|
-
try {
|
|
14
|
-
return thunk();
|
|
15
|
-
}
|
|
16
|
-
catch (_a) { }
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
var global$1 = (maybe(function () { return globalThis; }) ||
|
|
20
|
-
maybe(function () { return window; }) ||
|
|
21
|
-
maybe(function () { return self; }) ||
|
|
22
|
-
maybe(function () { return global; }) ||
|
|
23
|
-
maybe(function () { return Function("return this")(); }));
|
|
24
|
-
|
|
25
|
-
var __ = "__";
|
|
26
|
-
var GLOBAL_KEY = [__, __].join("DEV");
|
|
27
|
-
function getDEV() {
|
|
28
|
-
try {
|
|
29
|
-
return Boolean(__DEV__);
|
|
30
|
-
}
|
|
31
|
-
catch (_a) {
|
|
32
|
-
Object.defineProperty(global$1, GLOBAL_KEY, {
|
|
33
|
-
value: maybe(function () { return process.env.NODE_ENV; }) !== "production",
|
|
34
|
-
enumerable: false,
|
|
35
|
-
configurable: true,
|
|
36
|
-
writable: true,
|
|
37
|
-
});
|
|
38
|
-
return global$1[GLOBAL_KEY];
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
var DEV = getDEV();
|
|
42
|
-
|
|
43
|
-
function removeTemporaryGlobals() {
|
|
44
|
-
graphql.isType(null);
|
|
45
|
-
return process$1.remove();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
removeTemporaryGlobals();
|
|
49
|
-
|
|
50
11
|
function shouldInclude(_a, variables) {
|
|
51
12
|
var directives = _a.directives;
|
|
52
13
|
if (!directives || !directives.length) {
|
|
@@ -57,7 +18,7 @@ function shouldInclude(_a, variables) {
|
|
|
57
18
|
var evaledValue = false;
|
|
58
19
|
if (ifArgument.value.kind === 'Variable') {
|
|
59
20
|
evaledValue = variables && variables[ifArgument.value.name.value];
|
|
60
|
-
__DEV__ ?
|
|
21
|
+
__DEV__ ? globals.invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive.") : globals.invariant(evaledValue !== void 0, 39);
|
|
61
22
|
}
|
|
62
23
|
else {
|
|
63
24
|
evaledValue = ifArgument.value.value;
|
|
@@ -94,13 +55,13 @@ function getInclusionDirectives(directives) {
|
|
|
94
55
|
return;
|
|
95
56
|
var directiveArguments = directive.arguments;
|
|
96
57
|
var directiveName = directive.name.value;
|
|
97
|
-
__DEV__ ?
|
|
58
|
+
__DEV__ ? globals.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive.") : globals.invariant(directiveArguments && directiveArguments.length === 1, 40);
|
|
98
59
|
var ifArgument = directiveArguments[0];
|
|
99
|
-
__DEV__ ?
|
|
60
|
+
__DEV__ ? globals.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive.") : globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 41);
|
|
100
61
|
var ifValue = ifArgument.value;
|
|
101
|
-
__DEV__ ?
|
|
102
|
-
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value.") :
|
|
103
|
-
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'),
|
|
62
|
+
__DEV__ ? globals.invariant(ifValue &&
|
|
63
|
+
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value.") : globals.invariant(ifValue &&
|
|
64
|
+
(ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 42);
|
|
104
65
|
result.push({ directive: directive, ifArgument: ifArgument });
|
|
105
66
|
});
|
|
106
67
|
}
|
|
@@ -112,15 +73,15 @@ function getFragmentQueryDocument(document, fragmentName) {
|
|
|
112
73
|
var fragments = [];
|
|
113
74
|
document.definitions.forEach(function (definition) {
|
|
114
75
|
if (definition.kind === 'OperationDefinition') {
|
|
115
|
-
throw __DEV__ ? new
|
|
116
|
-
'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new
|
|
76
|
+
throw __DEV__ ? new globals.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " +
|
|
77
|
+
'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new globals.InvariantError(43);
|
|
117
78
|
}
|
|
118
79
|
if (definition.kind === 'FragmentDefinition') {
|
|
119
80
|
fragments.push(definition);
|
|
120
81
|
}
|
|
121
82
|
});
|
|
122
83
|
if (typeof actualFragmentName === 'undefined') {
|
|
123
|
-
__DEV__ ?
|
|
84
|
+
__DEV__ ? globals.invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.") : globals.invariant(fragments.length === 1, 44);
|
|
124
85
|
actualFragmentName = fragments[0].name.value;
|
|
125
86
|
}
|
|
126
87
|
var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
|
|
@@ -157,7 +118,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
|
|
|
157
118
|
return selection;
|
|
158
119
|
case 'FragmentSpread': {
|
|
159
120
|
var fragment = fragmentMap && fragmentMap[selection.name.value];
|
|
160
|
-
__DEV__ ?
|
|
121
|
+
__DEV__ ? globals.invariant(fragment, "No fragment named " + selection.name.value + ".") : globals.invariant(fragment, 45);
|
|
161
122
|
return fragment;
|
|
162
123
|
}
|
|
163
124
|
default:
|
|
@@ -239,9 +200,9 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
|
|
|
239
200
|
argObj[name.value] = null;
|
|
240
201
|
}
|
|
241
202
|
else {
|
|
242
|
-
throw __DEV__ ? new
|
|
203
|
+
throw __DEV__ ? new globals.InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" +
|
|
243
204
|
'is not supported. Use variables instead of inline arguments to ' +
|
|
244
|
-
'overcome this limitation.') : new
|
|
205
|
+
'overcome this limitation.') : new globals.InvariantError(54);
|
|
245
206
|
}
|
|
246
207
|
}
|
|
247
208
|
function storeKeyNameFromField(field, variables) {
|
|
@@ -375,16 +336,16 @@ function isInlineFragment(selection) {
|
|
|
375
336
|
}
|
|
376
337
|
|
|
377
338
|
function checkDocument(doc) {
|
|
378
|
-
__DEV__ ?
|
|
339
|
+
__DEV__ ? globals.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") : globals.invariant(doc && doc.kind === 'Document', 46);
|
|
379
340
|
var operations = doc.definitions
|
|
380
341
|
.filter(function (d) { return d.kind !== 'FragmentDefinition'; })
|
|
381
342
|
.map(function (definition) {
|
|
382
343
|
if (definition.kind !== 'OperationDefinition') {
|
|
383
|
-
throw __DEV__ ? new
|
|
344
|
+
throw __DEV__ ? new globals.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"") : new globals.InvariantError(47);
|
|
384
345
|
}
|
|
385
346
|
return definition;
|
|
386
347
|
});
|
|
387
|
-
__DEV__ ?
|
|
348
|
+
__DEV__ ? globals.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations") : globals.invariant(operations.length <= 1, 48);
|
|
388
349
|
return doc;
|
|
389
350
|
}
|
|
390
351
|
function getOperationDefinition(doc) {
|
|
@@ -403,14 +364,14 @@ function getFragmentDefinitions(doc) {
|
|
|
403
364
|
}
|
|
404
365
|
function getQueryDefinition(doc) {
|
|
405
366
|
var queryDef = getOperationDefinition(doc);
|
|
406
|
-
__DEV__ ?
|
|
367
|
+
__DEV__ ? globals.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : globals.invariant(queryDef && queryDef.operation === 'query', 49);
|
|
407
368
|
return queryDef;
|
|
408
369
|
}
|
|
409
370
|
function getFragmentDefinition(doc) {
|
|
410
|
-
__DEV__ ?
|
|
411
|
-
__DEV__ ?
|
|
371
|
+
__DEV__ ? globals.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") : globals.invariant(doc.kind === 'Document', 50);
|
|
372
|
+
__DEV__ ? globals.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : globals.invariant(doc.definitions.length <= 1, 51);
|
|
412
373
|
var fragmentDef = doc.definitions[0];
|
|
413
|
-
__DEV__ ?
|
|
374
|
+
__DEV__ ? globals.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : globals.invariant(fragmentDef.kind === 'FragmentDefinition', 52);
|
|
414
375
|
return fragmentDef;
|
|
415
376
|
}
|
|
416
377
|
function getMainDefinition(queryDoc) {
|
|
@@ -433,7 +394,7 @@ function getMainDefinition(queryDoc) {
|
|
|
433
394
|
if (fragmentDefinition) {
|
|
434
395
|
return fragmentDefinition;
|
|
435
396
|
}
|
|
436
|
-
throw __DEV__ ? new
|
|
397
|
+
throw __DEV__ ? new globals.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new globals.InvariantError(53);
|
|
437
398
|
}
|
|
438
399
|
function getDefaultValues(definition) {
|
|
439
400
|
var defaultValues = Object.create(null);
|
|
@@ -591,7 +552,7 @@ var connectionRemoveConfig = {
|
|
|
591
552
|
if (willRemove) {
|
|
592
553
|
if (!directive.arguments ||
|
|
593
554
|
!directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) {
|
|
594
|
-
__DEV__ &&
|
|
555
|
+
__DEV__ && globals.invariant.warn('Removing an @connection directive even though it does not have a key. ' +
|
|
595
556
|
'You may want to use the key parameter to specify a store key.');
|
|
596
557
|
}
|
|
597
558
|
}
|
|
@@ -1073,7 +1034,7 @@ var Concast = (function (_super) {
|
|
|
1073
1034
|
var sub = _this.sub;
|
|
1074
1035
|
if (sub !== null) {
|
|
1075
1036
|
if (sub)
|
|
1076
|
-
|
|
1037
|
+
setTimeout(function () { return sub.unsubscribe(); });
|
|
1077
1038
|
_this.sub = null;
|
|
1078
1039
|
_this.latest = ["error", error];
|
|
1079
1040
|
_this.reject(error);
|
|
@@ -1222,11 +1183,10 @@ function stringifyForDisplay(value) {
|
|
|
1222
1183
|
}).split(JSON.stringify(undefId)).join("<undefined>");
|
|
1223
1184
|
}
|
|
1224
1185
|
|
|
1225
|
-
|
|
1226
|
-
|
|
1186
|
+
exports.DEV = globals.DEV;
|
|
1187
|
+
exports.maybe = globals.maybe;
|
|
1227
1188
|
exports.Observable = zenObservableTs.Observable;
|
|
1228
1189
|
exports.Concast = Concast;
|
|
1229
|
-
exports.DEV = DEV;
|
|
1230
1190
|
exports.DeepMerger = DeepMerger;
|
|
1231
1191
|
exports.addTypenameToDocument = addTypenameToDocument;
|
|
1232
1192
|
exports.argumentsObjectFromField = argumentsObjectFromField;
|
|
@@ -1265,7 +1225,6 @@ exports.isReference = isReference;
|
|
|
1265
1225
|
exports.iterateObserversSafely = iterateObserversSafely;
|
|
1266
1226
|
exports.makeReference = makeReference;
|
|
1267
1227
|
exports.makeUniqueId = makeUniqueId;
|
|
1268
|
-
exports.maybe = maybe;
|
|
1269
1228
|
exports.maybeDeepFreeze = maybeDeepFreeze;
|
|
1270
1229
|
exports.mergeDeep = mergeDeep;
|
|
1271
1230
|
exports.mergeDeepArray = mergeDeepArray;
|