Files
apollo/docs/api/smart-subscription.md
T
高英健 d83a18fb4f docs: sync Chinese doc to 3.0.0-beta.28 (#509)
Just a suggestion: maybe a stable version of vue-apollo can be published after this wonderful ssr refactor?
2019-02-20 12:58:40 +01:00

953 B

Smart Subscription

Each subscription declared in the apollo.$subscribe option in a component results in the creation of a smart subscription object.

Options

  • query: GraphQL document (can be a file or a gql string).
  • variables: Object or reactive function that returns an object. Each key will be mapped with a '$' in the GraphQL document, for example foo will become $foo.
  • throttle: throttle variables updates (in ms).
  • debounce: debounce variables updates (in ms).
  • result(data, key) is a hook called when a result is received

Properties

Skip

You can pause or unpause with skip:

this.$apollo.subscriptions.users.skip = true

Methods

refresh

Stops and restarts the query:

this.$apollo.subscriptions.users.restart()

start

Starts the query:

this.$apollo.subscriptions.users.start()

stop

Stops the query:

this.$apollo.subscriptions.users.stop()