Skip to content

Commit

Permalink
assert that an observable is returned
Browse files Browse the repository at this point in the history
  • Loading branch information
colanconnon committed Nov 4, 2017
1 parent 7d59cd7 commit 24d49dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion examples/flask_gevent/src/graphql
Submodule graphql deleted from ebcd7f
5 changes: 3 additions & 2 deletions graphql_ws/gevent_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from graphql import format_error, graphql
from graphql.execution import ExecutionResult
from graphql.execution.executors.sync import SyncExecutor
from rx import Observer
from promise import is_thenable, Promise
from rx import Observer, Observable
from .server import BaseWebSocketSubscriptionServer, ConnectionContext, ConnectionClosedException
from .constants import *

Expand Down Expand Up @@ -86,6 +85,8 @@ def on_start(self, connection_context, op_id, params):
execution_result = graphql(
self.schema, **params, allow_subscriptions=True
)
assert isinstance(
execution_result, Observable), "A subscription must return an observable"
execution_result.subscribe(SubscriptionObserver(
connection_context,
op_id,
Expand Down

0 comments on commit 24d49dc

Please sign in to comment.