-
Notifications
You must be signed in to change notification settings - Fork 147
@publish & @subscribe directives, nested @cypher mutation revision #580
Conversation
exports pubsub to the apollo-server and apollo-server-express example servers to be used by augmentation config and custom subscription resolvers
also trying to fix dependency merge conflict
Thanks so much @michaeldgraham for you work on this! I'm excited to see how users take advantage of this! For users there's an important aspect of this implementation to be aware of. Since the result of the mutation is treated as the event payload for the subscription an important assumption then is that the selection set of the subscription is a subset of the corresponding mutation's selection set. So for example given a non-nullable field
If that
but not in the mutation selection set
then the client subscribed to the
The subscribing client may not be able to control the fields requested in the mutation selection set in all cases so this is something for users to be aware of. Having said that I think this PR still adds a lot of value and is something we can add as an experimental feature (tieing in to the authorization directives is another aspect to consider, but I think that's beyond the scope of this PR). @michaeldgraham - do you want to send a docs PR with a minimal example? |
This PR implements a
@publish
directive for Mutation fields and a@subscribe
directive for Subscription fields.A revision of the implementation for using
@cypher
directives on input object mutation arguments is also included.Docs coming soon~