Skip to content

ApolloSubscription ​

Props ​

NameTypeDefaultDescription
subscription (required)TypedDocumentNode<TData, TVariables> The subscription document.
variablesTVariables | undefined Variables for the subscription.
disabledboolean | undefinedfalseStop the subscription.
clientIdstring | undefined Name of the client to use, from the provided ApolloClients map.
optionsuseSubscription.Options<TData, TVariables> | undefined Escape hatch for any other useSubscription option.

Events ​

NamePayload
result[data: TData]
error[error: ErrorLike]
complete[]

Slots ​

#default ​

Slot propType
resultTData | undefined
loadingboolean
errorErrorLike | undefined
start() => void
stop() => void
restart() => Promise<void>

Exposed ​

A template ref receives the full useSubscription.Result surface, with refs unwrapped.

vue
<template>
  <ApolloSubscription ref="apollo" ... />
</template>

Released under the MIT License.