Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ApolloOfflineClient

Extension to ApolloClient providing additional capabilities.

see

ApolloClient

Hierarchy

  • ApolloClient<NormalizedCacheObject>
    • ApolloOfflineClient

Implements

  • DataProxy

Index

Constructors

constructor

  • new ApolloOfflineClient(options: ApolloClientOptions<NormalizedCacheObject>): ApolloOfflineClient
  • Parameters

    • options: ApolloClientOptions<NormalizedCacheObject>

    Returns ApolloOfflineClient

Properties

cache

cache: ApolloCache<NormalizedCacheObject>

defaultOptions

defaultOptions: DefaultOptions

disableNetworkFetches

disableNetworkFetches: boolean

link

link: ApolloLink

offlineStore

offlineStore: OfflineStore

Store that can be used to retrieve offline changes Developers can use it to visualize offline changes in their application

queryDeduplication

queryDeduplication: boolean

queryManager

queryManager: QueryManager<NormalizedCacheObject> | undefined

store

store: DataStore<NormalizedCacheObject>

typeDefs

typeDefs: undefined | string | string[] | DocumentNode | DocumentNode[]

version

version: string

Methods

__actionHookForDevTools

  • __actionHookForDevTools(cb: function): void
  • Parameters

    • cb: function
        • (): any
        • Returns any

    Returns void

__requestRaw

  • __requestRaw(payload: GraphQLRequest): Observable<ExecutionResult>
  • Parameters

    • payload: GraphQLRequest

    Returns Observable<ExecutionResult>

addResolvers

  • addResolvers(resolvers: Resolvers | Resolvers[]): void
  • Parameters

    • resolvers: Resolvers | Resolvers[]

    Returns void

clearStore

  • clearStore(): Promise<void | null>
  • Returns Promise<void | null>

extract

  • extract(optimistic?: undefined | false | true): NormalizedCacheObject
  • Parameters

    • Optional optimistic: undefined | false | true

    Returns NormalizedCacheObject

getResolvers

  • getResolvers(): Resolvers
  • Returns Resolvers

initQueryManager

  • initQueryManager(): QueryManager<NormalizedCacheObject>
  • Returns QueryManager<NormalizedCacheObject>

mutate

  • mutate<T, TVariables>(options: MutationOptions<T, TVariables>): Promise<FetchResult<T>>
  • Type parameters

    • T

    • TVariables

    Parameters

    • options: MutationOptions<T, TVariables>

    Returns Promise<FetchResult<T>>

onClearStore

  • onClearStore(cb: function): function
  • Parameters

    • cb: function
        • (): Promise<any>
        • Returns Promise<any>

    Returns function

      • (): void
      • Returns void

onResetStore

  • onResetStore(cb: function): function
  • Parameters

    • cb: function
        • (): Promise<any>
        • Returns Promise<any>

    Returns function

      • (): void
      • Returns void

query

  • query<T, TVariables>(options: QueryOptions<TVariables>): Promise<ApolloQueryResult<T>>
  • Type parameters

    • T

    • TVariables

    Parameters

    • options: QueryOptions<TVariables>

    Returns Promise<ApolloQueryResult<T>>

reFetchObservableQueries

  • reFetchObservableQueries(includeStandby?: undefined | false | true): Promise<ApolloQueryResult<any>[]> | Promise<null>
  • Parameters

    • Optional includeStandby: undefined | false | true

    Returns Promise<ApolloQueryResult<any>[]> | Promise<null>

readFragment

  • readFragment<T, TVariables>(options: Fragment<TVariables>, optimistic?: undefined | false | true): T | null
  • Type parameters

    • T

    • TVariables

    Parameters

    • options: Fragment<TVariables>
    • Optional optimistic: undefined | false | true

    Returns T | null

readQuery

  • readQuery<T, TVariables>(options: Query<TVariables>, optimistic?: undefined | false | true): T | null
  • Type parameters

    • T

    • TVariables

    Parameters

    • options: Query<TVariables>
    • Optional optimistic: undefined | false | true

    Returns T | null

registerOfflineEventListener

resetStore

  • resetStore(): Promise<ApolloQueryResult<any>[] | null>
  • Returns Promise<ApolloQueryResult<any>[] | null>

restore

  • restore(serializedState: NormalizedCacheObject): ApolloCache<NormalizedCacheObject>
  • Parameters

    • serializedState: NormalizedCacheObject

    Returns ApolloCache<NormalizedCacheObject>

setLocalStateFragmentMatcher

  • setLocalStateFragmentMatcher(fragmentMatcher: FragmentMatcher): void
  • Parameters

    • fragmentMatcher: FragmentMatcher

    Returns void

setResolvers

  • setResolvers(resolvers: Resolvers | Resolvers[]): void
  • Parameters

    • resolvers: Resolvers | Resolvers[]

    Returns void

stop

  • stop(): void
  • Returns void

subscribe

  • subscribe<T, TVariables>(options: SubscriptionOptions<TVariables>): Observable<T>
  • Type parameters

    • T

    • TVariables

    Parameters

    • options: SubscriptionOptions<TVariables>

    Returns Observable<T>

watchQuery

  • watchQuery<T, TVariables>(options: WatchQueryOptions<TVariables>): ObservableQuery<T, TVariables>
  • Type parameters

    • T

    • TVariables

    Parameters

    • options: WatchQueryOptions<TVariables>

    Returns ObservableQuery<T, TVariables>

writeData

  • writeData<TData>(options: WriteDataOptions<TData>): void
  • Type parameters

    • TData

    Parameters

    • options: WriteDataOptions<TData>

    Returns void

writeFragment

  • writeFragment<TData, TVariables>(options: WriteFragmentOptions<TData, TVariables>): void
  • Type parameters

    • TData

    • TVariables

    Parameters

    • options: WriteFragmentOptions<TData, TVariables>

    Returns void

writeQuery

  • writeQuery<TData, TVariables>(options: WriteQueryOptions<TData, TVariables>): void
  • Type parameters

    • TData

    • TVariables

    Parameters

    • options: WriteQueryOptions<TData, TVariables>

    Returns void

Generated using TypeDoc