Apollo Elements Apollo Elements Guides API Blog Toggle darkmode

Hybrids: Subscription Factory

Exports

import { subscription } from '@apollo-elements/hybrids/factories/subscription';

subscription

Hybrids property descriptor factory for GraphQL Subscriptions. Implements the ApolloSubscriptionElement interface.

Parameters

document

DocumentNode | TypedDocumentNode

The subscription document.

options

SubscriptionHybridsFactoryOptions<D, V>

Options to configure the subscription.

Option Description
client
ApolloClient
fetchPolicy
FetchPolicy
noAutoSubscribe
boolean
onSubscriptionComplete Callback that fires when the subscription ends. See onSubscriptionComplete
onSubscriptionData Callback for when subscription produces new data. See onSubscriptionData
shouldResubscribe
boolean
shouldSubscribe Predicate which determines whether to automatically subscribe. See shouldSubscribe
skip
boolean
subscription
DocumentNode | TypedDocumentNode
variables
Variables<D, V> 

Returns

Descriptor<ApolloSubscriptionElement<D, V>>

Hybrids descriptor which mixes the ApolloSubscriptionInterface in on connect