timhall / svelte-apollo

Svelte integration for Apollo GraphQL
MIT License
947 stars 68 forks source link

how to use subscribeToMore #57

Closed freeseamew closed 3 years ago

freeseamew commented 3 years ago

Is there a way to use the current subscribeToMore?

timhall commented 3 years ago

subscribeToMore is re-exported as part of svelte-apollo query. I haven't used it before, but you can do something like:

<script>
import { query } from 'svelte-apollo';
import { GET_BOOKS } from './data'

const books = query(GET_BOOKS)
// books.subscribeToMore is available
</script>