Docs
Launch GraphOS Studio

ObservableQuery

API reference


ObservableQuery functions

ApolloClient Observables extend the Observables implementation provided by zen-observable. Refer to the zen-observable documentation for additional context and API options.

variables

(src/core/ObservableQuery.ts, line 84)
Arguments
Name /
Type
Description
saveAsLastResult
boolean

Update the variables of this observable query, and fetch the new results. This method should be preferred over setVariables in most use cases.

Arguments
Name /
Type
Description
variables
Partial<TVariables>
Arguments
Name /
Type
Description
newOptions
Partial<WatchQueryOptions>

Update the variables of this observable query, and fetch the new results if they've changed. Most users should prefer refetch instead of setVariables in order to to be properly notified of results even when they come from the cache.

Note: the next callback will not fire if the variables have not changed or if the result is coming from cache.

Note: the promise will return the old results immediately if the variables have not changed.

Note: the promise will return null immediately if the query is not active (there are no subscribers).

Arguments
Name /
Type
Description
variables
TVariables
Arguments
Name /
Type
Description
fetchMoreOptions
any
Arguments
Name /
Type
Description
mapFn
TData
Arguments
Name /
Type
Description
pollInterval
number

Types

The current status of a query’s execution in our system.

Enumeration Members
Name /
Type
Description
error
any
fetchMore
any
loading
any
poll
any
ready
any
refetch
any
setVariables
any
Properties
Name /
Type
Description
data
T
error
ApolloError
errors
ReadonlyArray<GraphQLError>
loading
boolean
networkStatus
NetworkStatus
partial
boolean
Previous
InMemoryCache
Next
Hooks
Edit on GitHubEditForumsDiscord