UNPKG

20.6 kBSource Map (JSON)View Raw
1{"version":3,"file":"ngApollo.js","sources":["../../src/utils.ts","../../src/query-ref.ts","../../src/tokens.ts","../../src/apollo.ts","../../src/query.ts","../../src/mutation.ts","../../src/subscription.ts","../../src/select-pipe.ts","../../src/apollo-module.ts","../../src/ngApollo.ts"],"sourcesContent":["import {NgZone} from '@angular/core';\nimport {observeOn} from 'rxjs/operators';\nimport {\n Observable,\n Subscription,\n queueScheduler,\n SchedulerLike,\n SchedulerAction,\n observable,\n} from 'rxjs';\n\nexport function fromPromise<T>(promiseFn: () => Promise<T>): Observable<T> {\n return new Observable<T>(subscriber => {\n promiseFn().then(\n result => {\n if (!subscriber.closed) {\n subscriber.next(result);\n subscriber.complete();\n }\n },\n error => {\n if (!subscriber.closed) {\n subscriber.error(error);\n }\n },\n );\n\n return () => subscriber.unsubscribe();\n });\n}\n\nexport class ZoneScheduler implements SchedulerLike {\n constructor(private zone: NgZone) {}\n\n public now = Date.now ? Date.now : () => +new Date();\n\n public schedule<T>(\n work: (this: SchedulerAction<T>, state?: T) => void,\n delay: number = 0,\n state?: T,\n ): Subscription {\n return this.zone.run(() =>\n queueScheduler.schedule(work, delay, state),\n ) as Subscription;\n }\n}\n\n// XXX: Apollo's QueryObservable is not compatible with RxJS\n// TODO: remove it in one of future releases\n// https://github.com/ReactiveX/rxjs/blob/9fb0ce9e09c865920cf37915cc675e3b3a75050b/src/internal/util/subscribeTo.ts#L32\nexport function fixObservable<T>(obs: T): T {\n (obs as any)[observable] = () => obs;\n return obs;\n}\n\nexport function wrapWithZone<T>(\n obs: Observable<T>,\n ngZone: NgZone,\n): Observable<T> {\n return obs.pipe(observeOn(new ZoneScheduler(ngZone)));\n}\n","import {NgZone} from '@angular/core';\nimport {\n ApolloQueryResult,\n ObservableQuery,\n ApolloError,\n FetchMoreQueryOptions,\n FetchMoreOptions,\n SubscribeToMoreOptions,\n UpdateQueryOptions,\n ApolloCurrentResult,\n} from 'apollo-client';\nimport {Observable, from} from 'rxjs';\n\nimport {wrapWithZone, fixObservable} from './utils';\nimport {WatchQueryOptions, R} from './types';\nimport {startWith} from 'rxjs/operators';\n\nexport class QueryRef<T, V = R> {\n public valueChanges: Observable<ApolloQueryResult<T>>;\n public options: ObservableQuery<T, V>['options'];\n public queryId: ObservableQuery<T, V>['queryId'];\n public variables: V;\n\n constructor(\n private obsQuery: ObservableQuery<T, V>,\n ngZone: NgZone,\n options: WatchQueryOptions<V>,\n ) {\n const wrapped = wrapWithZone(from(fixObservable(this.obsQuery)), ngZone);\n\n this.valueChanges = options.useInitialLoading\n ? wrapped.pipe(\n startWith({\n ...this.obsQuery.getCurrentResult(),\n error: undefined,\n partial: undefined,\n stale: true,\n }),\n )\n : wrapped;\n this.queryId = this.obsQuery.queryId;\n }\n\n // ObservableQuery's methods\n\n public result(): Promise<ApolloQueryResult<T>> {\n return this.obsQuery.result();\n }\n\n public currentResult(): ApolloCurrentResult<T> {\n return this.obsQuery.currentResult();\n }\n\n public getLastResult(): ApolloQueryResult<T> {\n return this.obsQuery.getLastResult();\n }\n\n public getLastError(): ApolloError {\n return this.obsQuery.getLastError();\n }\n\n public resetLastResults(): void {\n return this.obsQuery.resetLastResults();\n }\n\n public refetch(variables?: V): Promise<ApolloQueryResult<T>> {\n return this.obsQuery.refetch(variables);\n }\n\n public fetchMore<K extends keyof V>(\n fetchMoreOptions: FetchMoreQueryOptions<V, K> & FetchMoreOptions<T, V>,\n ): Promise<ApolloQueryResult<T>> {\n return this.obsQuery.fetchMore(fetchMoreOptions);\n }\n\n public subscribeToMore<MT = any, MV = R>(\n options: SubscribeToMoreOptions<T, MV, MT>,\n ): () => void {\n // XXX: there's a bug in apollo-client typings\n // it should not inherit types from ObservableQuery\n return this.obsQuery.subscribeToMore(options as any);\n }\n public updateQuery(\n mapFn: (previousQueryResult: T, options: UpdateQueryOptions<V>) => T,\n ): void {\n return this.obsQuery.updateQuery(mapFn);\n }\n\n public stopPolling(): void {\n return this.obsQuery.stopPolling();\n }\n\n public startPolling(pollInterval: number): void {\n return this.obsQuery.startPolling(pollInterval);\n }\n\n public setOptions(opts: any) {\n return this.obsQuery.setOptions(opts);\n }\n\n public setVariables(\n variables: V,\n tryFetch: boolean = false,\n fetchResults = true,\n ) {\n return this.obsQuery.setVariables(variables, tryFetch, fetchResults);\n }\n}\n","import {InjectionToken} from '@angular/core';\nimport {ApolloClientOptions} from 'apollo-client';\nimport {NamedOptions} from './types';\n\nexport const APOLLO_OPTIONS = new InjectionToken<ApolloClientOptions<any>>(\n '[apollo-angular] options',\n);\n\nexport const APOLLO_NAMED_OPTIONS = new InjectionToken<NamedOptions>(\n '[apollo-angular] named options',\n);\n","import {Injectable, Optional, Inject, NgZone} from '@angular/core';\nimport {\n ApolloClient,\n QueryOptions,\n MutationOptions,\n ApolloQueryResult,\n SubscriptionOptions,\n ApolloClientOptions,\n ObservableQuery,\n} from 'apollo-client';\nimport {FetchResult} from 'apollo-link';\nimport {Observable, from} from 'rxjs';\n\nimport {QueryRef} from './query-ref';\nimport {\n WatchQueryOptions,\n ExtraSubscriptionOptions,\n R,\n NamedOptions,\n} from './types';\nimport {APOLLO_OPTIONS, APOLLO_NAMED_OPTIONS} from './tokens';\nimport {fromPromise, wrapWithZone, fixObservable} from './utils';\n\nexport class ApolloBase<TCacheShape = any> {\n constructor(\n protected ngZone: NgZone,\n protected _client?: ApolloClient<TCacheShape>,\n ) {}\n\n public watchQuery<T, V = R>(options: WatchQueryOptions<V>): QueryRef<T, V> {\n return new QueryRef<T, V>(\n this.ensureClient().watchQuery<T, V>({...options}) as ObservableQuery<\n T,\n V\n >,\n this.ngZone,\n options,\n );\n }\n\n public query<T, V = R>(\n options: QueryOptions<V>,\n ): Observable<ApolloQueryResult<T>> {\n return fromPromise<ApolloQueryResult<T>>(() =>\n this.ensureClient().query<T, V>({...options}),\n );\n }\n\n public mutate<T, V = R>(\n options: MutationOptions<T, V>,\n ): Observable<FetchResult<T>> {\n return fromPromise<FetchResult<T>>(() =>\n this.ensureClient().mutate<T, V>({...options}),\n );\n }\n\n public subscribe<T, V = R>(\n options: SubscriptionOptions<V>,\n extra?: ExtraSubscriptionOptions,\n ): Observable<FetchResult<T>> {\n const obs = from(\n fixObservable(\n this.ensureClient().subscribe<T, V>({...options}),\n ),\n );\n\n return extra && extra.useZone !== true\n ? obs\n : wrapWithZone(obs, this.ngZone);\n }\n\n /**\n * Get an access to an instance of ApolloClient\n */\n public getClient() {\n return this._client;\n }\n\n /**\n * Set a new instance of ApolloClient\n * Remember to clean up the store before setting a new client.\n *\n * @param client ApolloClient instance\n */\n public setClient(client: ApolloClient<TCacheShape>) {\n if (this._client) {\n throw new Error('Client has been already defined');\n }\n\n this._client = client;\n }\n\n private ensureClient() {\n this.checkInstance();\n\n return this._client;\n }\n\n private checkInstance(): void {\n if (!this._client) {\n throw new Error('Client has not been defined yet');\n }\n }\n}\n\n@Injectable()\nexport class Apollo extends ApolloBase<any> {\n private map: Map<string, ApolloBase<any>> = new Map<\n string,\n ApolloBase<any>\n >();\n\n constructor(\n private _ngZone: NgZone,\n @Optional()\n @Inject(APOLLO_OPTIONS)\n apolloOptions?: ApolloClientOptions<any>,\n @Optional()\n @Inject(APOLLO_NAMED_OPTIONS)\n apolloNamedOptions?: NamedOptions,\n ) {\n super(_ngZone);\n\n if (apolloOptions) {\n this.createDefault(apolloOptions);\n }\n\n if (apolloNamedOptions && typeof apolloNamedOptions === 'object') {\n for (const name in apolloNamedOptions) {\n if (apolloNamedOptions.hasOwnProperty(name)) {\n const options = apolloNamedOptions[name];\n this.createNamed(name, options);\n }\n }\n }\n }\n\n /**\n * Create an instance of ApolloClient\n * @param options Options required to create ApolloClient\n * @param name client's name\n */\n public create<TCacheShape>(\n options: ApolloClientOptions<TCacheShape>,\n name?: string,\n ): void {\n if (isDefault(name)) {\n this.createDefault<TCacheShape>(options);\n } else {\n this.createNamed<TCacheShape>(name, options);\n }\n }\n\n /**\n * Use a default ApolloClient\n */\n public default(): ApolloBase<any> {\n return this;\n }\n\n /**\n * Use a named ApolloClient\n * @param name client's name\n */\n public use(name: string): ApolloBase<any> {\n if (isDefault(name)) {\n return this.default();\n }\n return this.map.get(name);\n }\n\n /**\n * Create a default ApolloClient, same as `apollo.create(options)`\n * @param options ApolloClient's options\n */\n public createDefault<TCacheShape>(\n options: ApolloClientOptions<TCacheShape>,\n ): void {\n if (this.getClient()) {\n throw new Error('Apollo has been already created.');\n }\n\n return this.setClient(new ApolloClient<TCacheShape>(options));\n }\n\n /**\n * Create a named ApolloClient, same as `apollo.create(options, name)`\n * @param name client's name\n * @param options ApolloClient's options\n */\n public createNamed<TCacheShape>(\n name: string,\n options: ApolloClientOptions<TCacheShape>,\n ): void {\n if (this.map.has(name)) {\n throw new Error(`Client ${name} has been already created`);\n }\n this.map.set(\n name,\n new ApolloBase(this._ngZone, new ApolloClient<TCacheShape>(options)),\n );\n }\n\n /**\n * Remember to clean up the store before removing a client\n * @param name client's name\n */\n public removeClient(name?: string): void {\n if (isDefault(name)) {\n this._client = undefined;\n } else {\n this.map.delete(name);\n }\n }\n}\n\nfunction isDefault(name?: string): boolean {\n return !name || name === 'default';\n}\n","import {Injectable} from '@angular/core';\nimport {DocumentNode} from 'graphql';\nimport {ApolloQueryResult} from 'apollo-client';\nimport {Observable} from 'rxjs';\n\nimport {Apollo} from './apollo';\nimport {QueryRef} from './query-ref';\nimport {WatchQueryOptionsAlone, QueryOptionsAlone, R} from './types';\n\n@Injectable()\nexport class Query<T = {}, V = R> {\n public readonly document: DocumentNode;\n public client = 'default';\n\n constructor(protected apollo: Apollo) {}\n\n public watch(\n variables?: V,\n options?: WatchQueryOptionsAlone<V>,\n ): QueryRef<T, V> {\n return this.apollo.use(this.client).watchQuery<T, V>({\n ...options,\n variables,\n query: this.document,\n });\n }\n\n public fetch(\n variables?: V,\n options?: QueryOptionsAlone<V>,\n ): Observable<ApolloQueryResult<T>> {\n return this.apollo.use(this.client).query<T, V>({\n ...options,\n variables,\n query: this.document,\n });\n }\n}\n","import {Injectable} from '@angular/core';\nimport {DocumentNode} from 'graphql';\nimport {Observable} from 'rxjs';\nimport {FetchResult} from 'apollo-link';\n\nimport {Apollo} from './apollo';\nimport {MutationOptionsAlone, R} from './types';\n\n@Injectable()\nexport class Mutation<T = {}, V = R> {\n public readonly document: DocumentNode;\n public client = 'default';\n\n constructor(protected apollo: Apollo) {}\n\n public mutate(\n variables?: V,\n options?: MutationOptionsAlone<T, V>,\n ): Observable<FetchResult<T>> {\n return this.apollo.use(this.client).mutate<T, V>({\n ...options,\n variables,\n mutation: this.document,\n });\n }\n}\n","import {Injectable} from '@angular/core';\nimport {DocumentNode} from 'graphql';\nimport {Observable} from 'rxjs';\n\nimport {Apollo} from './apollo';\nimport {\n SubscriptionOptionsAlone,\n ExtraSubscriptionOptions,\n SubscriptionResult,\n R,\n} from './types';\n\n@Injectable()\nexport class Subscription<T = any, V = R> {\n public readonly document: DocumentNode;\n public client = 'default';\n\n constructor(protected apollo: Apollo) {}\n\n public subscribe(\n variables?: V,\n options?: SubscriptionOptionsAlone<V>,\n extra?: ExtraSubscriptionOptions,\n ): Observable<SubscriptionResult<T>> {\n return this.apollo.use(this.client).subscribe<T, V>(\n {\n ...options,\n variables,\n query: this.document,\n },\n extra,\n );\n }\n}\n","import {Pipe, PipeTransform} from '@angular/core';\n\n@Pipe({\n name: 'select',\n})\nexport class SelectPipe implements PipeTransform {\n public transform(obj: any, name: string = '') {\n if (name !== '') {\n return obj && obj.data && obj.data[name];\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {Apollo} from './apollo';\nimport {SelectPipe} from './select-pipe';\n\nexport const PROVIDERS = [Apollo];\nexport const DECLARATIONS = [SelectPipe];\n\n@NgModule({\n providers: PROVIDERS,\n declarations: DECLARATIONS,\n exports: DECLARATIONS,\n})\nexport class ApolloModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {DECLARATIONS as ɵb,PROVIDERS as ɵa} from './apollo-module';\nexport {NamedOptions as ɵd,WatchQue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