Skip to content

Commit 189f191

Browse files
committed
Review and clarify the content in subscriptions.md
1 parent c004699 commit 189f191

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

doc/subscriptions.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,25 @@ If you use the async version of `subscribe` and `unsubscribe` which take a
4949
`Subscription` object to the `Request`/`Operations` constructor, you will get
5050
additional callbacks with the `ResolverContext::NotifySubscribe` and
5151
`ResolverContext::NotifyUnsubscribe` values for the
52-
`FieldParams::resolverContext` member. These are passed as part of the
53-
`subscribe` and `unsubscribe` calls on the default subscription object, and
52+
`FieldParams::resolverContext` member. These are passed by the async
53+
`subscribe` and `unsubscribe` calls to the default subscription object, and
5454
they provide an opportunity to acquire or release resources that are required
55-
to implement the subscription. You can provide separate implementations of the
56-
`Subscription` object as the default in the `Operations` constructor and as the
57-
payload of a specific `deliver` call, which will be resolved with
58-
`ResolverContext::Subscription`. If you do not provide a separate
59-
`Subscription` object in the `deliver` call, it will fall back to delivering a
60-
new event resolved against the default
55+
to implement the subscription.
56+
57+
You can provide separate implementations of the `Subscription` object as the
58+
default in the `Operations` constructor and as the payload of a specific
59+
`deliver` call. Whether you override the `Subscription` object or not, the
60+
event payload for a `deliver` call will be resolved with
61+
`ResolverContext::Subscription`.
6162

6263
## Delivering Subscription Updates
6364

64-
There are currently three `Request::deliver` overrides you can choose from when
65+
If you pass an empty `std::shared_ptr<Object>` for the `subscriptionObject`
66+
parameter, `deliver` will fall back to resolving the query against the default
67+
`Subscription` object passed to the `Request`/`Operations` constructor. If both
68+
`Subscription` object parameters are empty, `deliver` will throw an exception.
69+
70+
There are currently five `Request::deliver` overrides you can choose from when
6571
sending updates to any subscribed listeners. The first one is the simplest,
6672
it will evaluate each subscribed query against the `subscriptionObject`
6773
parameter (which should match the `Subscription` type in the `schema`). It will

0 commit comments

Comments
 (0)