apollo-feature-requests
apollo-feature-requests copied to clipboard
`subscribeToMore`, but for `Mutation`s
The subscribeToMore function is similar in structure to the fetchMore function that's commonly used for handling pagination. The primary difference is that fetchMore executes a followup query, whereas subscribeToMore executes a subscription.
Currently, we can only subscribeToMore
with a query
type.
I'm discussing the ability to subscribeToMore
after a GQL mutation
.
Use case:
I create a post via a mutation
(e.g. createPost(input: Input): [Post!]!
). The mutation returns the list of posts when successful. Following up, I want to subscribe to the list of posts via a subscription
(e.g. onPostCreated(): [Post!]!
).
What do you think?