@vue/apollo-composable / useLazyQuery / Options
Interface: Options ​
Options for useLazyQuery - same as useQuery but enabled is not applicable.
1. Operation options ​
errorPolicy? ​
optionalerrorPolicy:ErrorPolicy
Specifies how the query handles a response that returns both GraphQL errors and partial results.
For details, see GraphQL error policies.
The default value is none, meaning that the query result includes error details but not partial results.
variables? ​
optionalvariables:ReactiveVariablesParameter
An object containing all of the GraphQL variables your query requires to execute.
Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
2. Networking options ​
context? ​
optionalcontext:DefaultContext
If you're using Apollo Link, this object is the initial value of the context object that's passed along your link chain.
notifyOnNetworkStatusChange? ​
optionalnotifyOnNetworkStatusChange:boolean
If true, the next state event is emitted whenever the network status changes or a network error occurs.
pollInterval? ​
optionalpollInterval:number
Specifies the interval (in milliseconds) at which the query polls for updated results.
Default ​
0 // (no polling)skipPollAttempt()? ​
optionalskipPollAttempt: () =>boolean
A callback function that's called whenever a refetch attempt occurs while polling. If the function returns true, the refetch is skipped and not reattempted until the next poll interval.
Returns ​
boolean
3. Caching options ​
fetchPolicy? ​
optionalfetchPolicy:WatchQueryFetchPolicy
Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).
For details, see Setting a fetch policy.
The default value is cache-first.
initialFetchPolicy? ​
optionalinitialFetchPolicy:WatchQueryFetchPolicy
Defaults to the initial value of options.fetchPolicy, but can be explicitly configured to specify the WatchQueryFetchPolicy to revert back to whenever variables change (unless nextFetchPolicy intervenes).
nextFetchPolicy? ​
optionalnextFetchPolicy:WatchQueryFetchPolicy| (this,currentFetchPolicy,context) =>WatchQueryFetchPolicy
Specifies the FetchPolicy to be used after this query has completed.
refetchWritePolicy? ​
optionalrefetchWritePolicy:RefetchWritePolicy
Specifies whether a NetworkStatus.refetch operation should merge incoming field data with existing data, or overwrite the existing data. Overwriting is probably preferable, but merging is currently the default behavior, for backwards compatibility with Apollo Client 3.x.
returnPartialData? ​
optionalreturnPartialData:boolean
If true, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.
Default ​
false4. Vue-Apollo ​
awaitComplete? ​
optionalawaitComplete:boolean
Whether to await complete data before resolving. Use with @stream and @defer GraphQL directives.
Only affects SSR prefetch and await useQuery().
Default ​
falseclientId? ​
optionalclientId:string
ID of a named Apollo client to use instead of the default.
debounce? ​
optionaldebounce:number
Debounce variable updates (ms).
keepPreviousResult? ​
optionalkeepPreviousResult:boolean
Keep previous result while loading new data.
Default Value ​
falseprefetch? ​
optionalprefetch:boolean
Whether to prefetch on server.
Default Value ​
truethrottle? ​
optionalthrottle:number
Throttle variable updates (ms).