apollo-feature-requests icon indicating copy to clipboard operation
apollo-feature-requests copied to clipboard

`subscribeToMore`, but for `Mutation`s

Open RemyMachado opened this issue 2 years ago • 0 comments

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?

RemyMachado avatar Oct 31 '22 10:10 RemyMachado