Skip to content

Commit 24d49dc

Browse files
committed
assert that an observable is returned
1 parent 7d59cd7 commit 24d49dc

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

examples/flask_gevent/src/graphql

Lines changed: 0 additions & 1 deletion
This file was deleted.

graphql_ws/gevent_server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
from graphql import format_error, graphql
44
from graphql.execution import ExecutionResult
55
from graphql.execution.executors.sync import SyncExecutor
6-
from rx import Observer
7-
from promise import is_thenable, Promise
6+
from rx import Observer, Observable
87
from .server import BaseWebSocketSubscriptionServer, ConnectionContext, ConnectionClosedException
98
from .constants import *
109

@@ -86,6 +85,8 @@ def on_start(self, connection_context, op_id, params):
8685
execution_result = graphql(
8786
self.schema, **params, allow_subscriptions=True
8887
)
88+
assert isinstance(
89+
execution_result, Observable), "A subscription must return an observable"
8990
execution_result.subscribe(SubscriptionObserver(
9091
connection_context,
9192
op_id,

0 commit comments

Comments
 (0)