{"version":3,"file":"ngApollo.mjs","sources":["../../src/utils.ts","../../src/query-ref.ts","../../src/tokens.ts","../../src/apollo.ts","../../src/apollo-module.ts","../../src/query.ts","../../src/mutation.ts","../../src/subscription.ts","../../src/gql.ts","../../src/ngApollo.ts"],"sourcesContent":["import {NgZone} from '@angular/core';\nimport {observeOn, startWith, map} from 'rxjs/operators';\nimport type {\n  ObservableQuery,\n  ApolloQueryResult,\n  FetchResult,\n  Observable as AObservable,\n} from '@apollo/client/core';\nimport type {Subscription, SchedulerLike, SchedulerAction} from 'rxjs';\nimport {Observable, queueScheduler, observable} from 'rxjs';\nimport type {MutationResult} from './types';\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 function useMutationLoading<T>(\n  source: Observable<FetchResult<T>>,\n  enabled: boolean,\n) {\n  if (!enabled) {\n    return source.pipe(\n      map<FetchResult<T>, MutationResult<T>>((result) => ({\n        ...result,\n        loading: false,\n      })),\n    );\n  }\n\n  return source.pipe(\n    startWith<MutationResult<T>>({\n      loading: true,\n    }),\n    map<MutationResult<T>, MutationResult<T>>((result) => ({\n      ...result,\n      loading: !!result.loading,\n    })),\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>(\n  obs: ObservableQuery<T>,\n): Observable<ApolloQueryResult<T>>;\nexport function fixObservable<T>(obs: AObservable<T>): Observable<T>;\nexport function fixObservable<T>(\n  obs: AObservable<T> | ObservableQuery<T>,\n): Observable<ApolloQueryResult<T>> | Observable<T> {\n  (obs as any)[observable] = () => obs;\n  return obs as any;\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\nexport function pickFlag<TFlags, K extends keyof TFlags>(\n  flags: TFlags | undefined,\n  flag: K,\n  defaultValue: TFlags[K],\n): TFlags[K] {\n  return flags && typeof flags[flag] !== 'undefined'\n    ? flags[flag]\n    : defaultValue;\n}\n","import {NgZone} from '@angular/core';\nimport type {\n  ApolloQueryResult,\n  ObservableQuery,\n  ApolloError,\n  FetchMoreQueryOptions,\n  FetchMoreOptions,\n  SubscribeToMoreOptions,\n  UpdateQueryOptions,\n  TypedDocumentNode,\n} from '@apollo/client/core';\nimport {NetworkStatus} from '@apollo/client/core';\nimport {Observable, from} from 'rxjs';\n\nimport {wrapWithZone, fixObservable} from './utils';\nimport {WatchQueryOptions, EmptyObject} from './types';\n\nfunction useInitialLoading<T, V>(obsQuery: ObservableQuery<T, V>) {\n  return function useInitialLoadingOperator<T>(\n    source: Observable<T>,\n  ): Observable<T> {\n    return new Observable(function useInitialLoadingSubscription(subscriber) {\n      const currentResult = obsQuery.getCurrentResult();\n      const {loading, errors, error, partial, data} = currentResult;\n      const {partialRefetch, fetchPolicy} = obsQuery.options;\n\n      const hasError = errors || error;\n\n      if (\n        partialRefetch &&\n        partial &&\n        (!data || Object.keys(data).length === 0) &&\n        fetchPolicy !== 'cache-only' &&\n        !loading &&\n        !hasError\n      ) {\n        subscriber.next({\n          ...currentResult,\n          loading: true,\n          networkStatus: NetworkStatus.loading,\n        } as any);\n      }\n\n      return source.subscribe(subscriber);\n    });\n  };\n}\n\nexport type QueryRefFromDocument<T extends TypedDocumentNode> =\n  T extends TypedDocumentNode<infer R, infer V> ? QueryRef<R, V> : never;\n\nexport class QueryRef<T, V = EmptyObject> {\n  public valueChanges: Observable<ApolloQueryResult<T>>;\n  public queryId: ObservableQuery<T, V>['queryId'];\n\n  constructor(\n    private obsQuery: ObservableQuery<T, V>,\n    ngZone: NgZone,\n    options: WatchQueryOptions<V, T>,\n  ) {\n    const wrapped = wrapWithZone(from(fixObservable(this.obsQuery)), ngZone);\n\n    this.valueChanges = options.useInitialLoading\n      ? wrapped.pipe(useInitialLoading(this.obsQuery))\n      : wrapped;\n    this.queryId = this.obsQuery.queryId;\n  }\n\n  // ObservableQuery's methods\n\n  public get options() {\n    return this.obsQuery.options;\n  }\n\n  public get variables() {\n    return this.obsQuery.variables;\n  }\n\n  public result(): Promise<ApolloQueryResult<T>> {\n    return this.obsQuery.result();\n  }\n\n  public getCurrentResult(): ApolloQueryResult<T> {\n    return this.obsQuery.getCurrentResult();\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 = EmptyObject>(\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(variables: V) {\n    return this.obsQuery.setVariables(variables);\n  }\n}\n","import {InjectionToken} from '@angular/core';\nimport type {ApolloClientOptions} from '@apollo/client/core';\nimport type {NamedOptions, Flags} from './types';\n\nexport const APOLLO_FLAGS = new InjectionToken<Flags>('APOLLO_FLAGS');\n\nexport const APOLLO_OPTIONS = new InjectionToken<ApolloClientOptions<any>>(\n  'APOLLO_OPTIONS',\n);\n\nexport const APOLLO_NAMED_OPTIONS = new InjectionToken<NamedOptions>(\n  'APOLLO_NAMED_OPTIONS',\n);\n","import {Injectable, Optional, Inject, NgZone} from '@angular/core';\nimport type {\n  QueryOptions,\n  ApolloQueryResult,\n  SubscriptionOptions,\n  ApolloClientOptions,\n  ObservableQuery,\n  FetchResult,\n} from '@apollo/client/core';\nimport {ApolloClient} from '@apollo/client/core';\nimport {Observable, from} from 'rxjs';\n\nimport {QueryRef} from './query-ref';\nimport {\n  WatchQueryOptions,\n  ExtraSubscriptionOptions,\n  EmptyObject,\n  NamedOptions,\n  Flags,\n  MutationResult,\n  MutationOptions,\n} from './types';\nimport {APOLLO_OPTIONS, APOLLO_NAMED_OPTIONS, APOLLO_FLAGS} from './tokens';\nimport {\n  fromPromise,\n  useMutationLoading,\n  wrapWithZone,\n  fixObservable,\n  pickFlag,\n} from './utils';\n\nexport class ApolloBase<TCacheShape = any> {\n  private useInitialLoading: boolean;\n  private useMutationLoading: boolean;\n\n  constructor(\n    protected ngZone: NgZone,\n    protected flags?: Flags,\n    protected _client?: ApolloClient<TCacheShape>,\n  ) {\n    this.useInitialLoading = pickFlag(flags, 'useInitialLoading', false);\n    this.useMutationLoading = pickFlag(flags, 'useMutationLoading', false);\n  }\n\n  public watchQuery<TData, TVariables = EmptyObject>(\n    options: WatchQueryOptions<TVariables, TData>,\n  ): QueryRef<TData, TVariables> {\n    return new QueryRef<TData, TVariables>(\n      this.ensureClient().watchQuery<TData, TVariables>({\n        ...options,\n      }) as ObservableQuery<TData, TVariables>,\n      this.ngZone,\n      {\n        useInitialLoading: this.useInitialLoading,\n        ...options,\n      },\n    );\n  }\n\n  public query<T, V = EmptyObject>(\n    options: QueryOptions<V, T>,\n  ): Observable<ApolloQueryResult<T>> {\n    return fromPromise<ApolloQueryResult<T>>(() =>\n      this.ensureClient().query<T, V>({...options}),\n    );\n  }\n\n  public mutate<T, V = EmptyObject>(\n    options: MutationOptions<T, V>,\n  ): Observable<MutationResult<T>> {\n    return useMutationLoading(\n      fromPromise(() => this.ensureClient().mutate<T, V>({...options})),\n      options.useMutationLoading ?? this.useMutationLoading,\n    );\n  }\n\n  public subscribe<T, V = EmptyObject>(\n    options: SubscriptionOptions<V, T>,\n    extra?: ExtraSubscriptionOptions,\n  ): Observable<FetchResult<T>> {\n    const obs = from(\n      fixObservable(this.ensureClient().subscribe<T, V>({...options})),\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   * @deprecated use `apollo.client` instead\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   * @deprecated use `apollo.client = client` instead\n   *\n   * @param client ApolloClient instance\n   */\n  public setClient(client: ApolloClient<TCacheShape>) {\n    this.client = client;\n  }\n\n  /**\n   * Get an access to an instance of ApolloClient\n   */\n  public get client(): ApolloClient<TCacheShape> {\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 set client(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    @Optional() @Inject(APOLLO_FLAGS) flags?: Flags,\n  ) {\n    super(_ngZone, flags);\n\n    if (apolloOptions) {\n      this.createDefault(apolloOptions);\n    }\n\n    if (apolloNamedOptions && typeof apolloNamedOptions === 'object') {\n      for (let 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(\n        this._ngZone,\n        this.flags,\n        new ApolloClient<TCacheShape>(options),\n      ),\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 {NgModule} from '@angular/core';\n\nimport {Apollo} from './apollo';\n\nexport const PROVIDERS = [Apollo];\n\n@NgModule({\n  providers: PROVIDERS,\n})\nexport class ApolloModule {}\n","import {Injectable} from '@angular/core';\nimport type {DocumentNode} from 'graphql';\nimport type {ApolloQueryResult, TypedDocumentNode} from '@apollo/client/core';\nimport type {Observable} from 'rxjs';\n\nimport {Apollo} from './apollo';\nimport {QueryRef} from './query-ref';\nimport {WatchQueryOptionsAlone, QueryOptionsAlone, EmptyObject} from './types';\n\n@Injectable()\nexport class Query<T = {}, V = EmptyObject> {\n  public readonly document: DocumentNode | TypedDocumentNode<T, V>;\n  public client = 'default';\n\n  constructor(protected apollo: Apollo) {}\n\n  public watch(\n    variables?: V,\n    options?: WatchQueryOptionsAlone<V, T>,\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, T>,\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 type {DocumentNode} from 'graphql';\nimport type {TypedDocumentNode} from '@apollo/client/core';\n\nimport {Apollo} from './apollo';\nimport {MutationOptionsAlone, EmptyObject} from './types';\n\n@Injectable()\nexport class Mutation<T = {}, V = EmptyObject> {\n  public readonly document: DocumentNode | TypedDocumentNode<T, V>;\n  public client = 'default';\n\n  constructor(protected apollo: Apollo) {}\n\n  public mutate(variables?: V, options?: MutationOptionsAlone<T, V>) {\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 type {DocumentNode} from 'graphql';\nimport type {TypedDocumentNode} from '@apollo/client/core';\nimport type {Observable} from 'rxjs';\n\nimport {Apollo} from './apollo';\nimport {\n  SubscriptionOptionsAlone,\n  ExtraSubscriptionOptions,\n  SubscriptionResult,\n  EmptyObject,\n} from './types';\n\n@Injectable()\nexport class Subscription<T = any, V = EmptyObject> {\n  public readonly document: DocumentNode | TypedDocumentNode<T, V>;\n  public client = 'default';\n\n  constructor(protected apollo: Apollo) {}\n\n  public subscribe(\n    variables?: V,\n    options?: SubscriptionOptionsAlone<V, T>,\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 {gql as gqlTag, TypedDocumentNode} from '@apollo/client/core';\n\nfunction typedGQLTag<Result, Variables>(\n  literals: ReadonlyArray<string> | Readonly<string>,\n  ...placeholders: any[]\n): TypedDocumentNode<Result, Variables> {\n  return gqlTag(literals, ...placeholders);\n}\n\nexport const gql = typedGQLTag;\nexport const graphql = typedGQLTag;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["gqlTag"],"mappings":";;;;;;SAYgB,WAAW,CAAI,SAA2B;IACxD,OAAO,IAAI,UAAU,CAAI,CAAC,UAAU;QAClC,SAAS,EAAE,CAA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