Skip to content

Commit 5ca12ad

Browse files
committed
Add a section mentioning subscriptions to the docs
1 parent f74e901 commit 5ca12ad

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/usage/other.rst

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
Subscriptions
2+
-------------
3+
4+
Sometimes you need to not only query data from a server, but you also want
5+
to push data from the server to the client. GraphQL-core-next has you also
6+
covered here, because it implements the "Subscribe" algorithm described in
7+
the GraphQL spec. To execute a GraphQL subscription, you must use the
8+
:func:`graphql.subscribe` method from the :mod:`graphql.subscription` module.
9+
Instead of a single ``ExecutionResult``, this function returns an asynchronous
10+
iterator yielding a stream of those, unless there was an immediate error.
11+
Of course you will then also need to maintain a persistent channel to the
12+
client (often realized via WebSockets) to push these results back.
13+
14+
115
Other Usages
216
------------
317

0 commit comments

Comments
 (0)