Skip to content

Commit 29e1456

Browse files
committed
Changed anonymous observbable static type imports
1 parent 51192d5 commit 29e1456

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

graphql/backend/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from ..language.ast import Document
1515
from ..type.schema import GraphQLSchema
1616
from ..execution.base import ExecutionResult
17-
from rx.core.anonymousobservable import AnonymousObservable
17+
from rx import Observable
1818

1919

2020
def execute_and_validate(
@@ -23,7 +23,7 @@ def execute_and_validate(
2323
*args, # type: Any
2424
**kwargs # type: Any
2525
):
26-
# type: (...) -> Union[ExecutionResult, AnonymousObservable]
26+
# type: (...) -> Union[ExecutionResult, Observable]
2727
do_validation = kwargs.get("validate", True)
2828
if do_validation:
2929
validation_errors = validate(schema, document_ast)

graphql/execution/executor.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737

3838
if False:
3939
from typing import Any, Optional, Union, Dict, List, Callable
40-
from rx.core.anonymousobservable import AnonymousObservable
40+
from rx import Observable
4141
from ..type.schema import GraphQLSchema
4242
from ..language.ast import Document, OperationDefinition, Field
4343

4444
logger = logging.getLogger(__name__)
4545

4646

4747
def subscribe(*args, **kwargs):
48-
# type: (*Any, **Any) -> Union[ExecutionResult, AnonymousObservable]
48+
# type: (*Any, **Any) -> Union[ExecutionResult, Observable]
4949
allow_subscriptions = kwargs.pop("allow_subscriptions", True)
5050
return execute(*args, allow_subscriptions=allow_subscriptions, **kwargs)
5151

@@ -117,7 +117,7 @@ def execute(
117117
)
118118

119119
def executor(v):
120-
# type: (Optional[Any]) -> Union[OrderedDict, Promise, AnonymousObservable]
120+
# type: (Optional[Any]) -> Union[OrderedDict, Promise, Observable]
121121
return execute_operation(exe_context, exe_context.operation, root)
122122

123123
def on_rejected(error):
@@ -126,7 +126,7 @@ def on_rejected(error):
126126
return None
127127

128128
def on_resolve(data):
129-
# type: (Union[None, OrderedDict, AnonymousObservable]) -> Union[ExecutionResult, AnonymousObservable]
129+
# type: (Union[None, OrderedDict, Observable]) -> Union[ExecutionResult, Observable]
130130
if isinstance(data, Observable):
131131
return data
132132

@@ -260,7 +260,7 @@ def subscribe_fields(
260260
source_value, # type: Union[None, Data, type]
261261
fields, # type: DefaultOrderedDict
262262
):
263-
# type: (...) -> AnonymousObservable
263+
# type: (...) -> Observable
264264
exe_context = SubscriberExecutionContext(exe_context)
265265

266266
def on_error(error):
@@ -364,7 +364,7 @@ def subscribe_field(
364364
field_asts, # type: List[Field]
365365
path, # type: List[str]
366366
):
367-
# type: (...) -> AnonymousObservable
367+
# type: (...) -> Observable
368368
field_ast = field_asts[0]
369369
field_name = field_ast.name.value
370370

graphql/execution/tests/test_subscribe.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
if False:
1919
from graphql.execution.base import ResolveInfo
20-
from rx.core.anonymousobservable import AnonymousObservable
20+
from rx import Observable
2121
from typing import Optional, Union, Any, Callable, Tuple
2222
from graphql.execution.base import ExecutionResult
2323

@@ -84,7 +84,7 @@ def get_unbound_function(func):
8484
def email_schema_with_resolvers(resolve_fn=None):
8585
# type: (Callable) -> GraphQLSchema
8686
def default_resolver(root, info):
87-
# type: (Any, ResolveInfo) -> Union[AnonymousObservable, Subject]
87+
# type: (Any, ResolveInfo) -> Union[Observable, Subject]
8888
func = getattr(root, "importantEmail", None)
8989
if func:
9090
func = get_unbound_function(func)
@@ -129,7 +129,7 @@ def create_subscription(
129129
ast=None, # type: Optional[Any]
130130
vars=None, # type: Optional[Any]
131131
):
132-
# type: (...) -> Tuple[Callable, Union[ExecutionResult, AnonymousObservable]]
132+
# type: (...) -> Tuple[Callable, Union[ExecutionResult, Observable]]
133133
class Root(object):
134134
class inbox(object):
135135
emails = [

graphql/graphql.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from promise import promisify
55

66
if False:
7-
from rx.core.anonymousobservable import AnonymousObservable
7+
from rx import Observable
88
from typing import Any, Union, Optional
99
from .language.ast import Document
1010
from .type.schema import GraphQLSchema
@@ -34,7 +34,7 @@
3434

3535

3636
def graphql(*args, **kwargs):
37-
# type: (*Any, **Any) -> Union[ExecutionResult, AnonymousObservable]
37+
# type: (*Any, **Any) -> Union[ExecutionResult, Observable]
3838
return_promise = kwargs.get("return_promise", False)
3939
if return_promise:
4040
return execute_graphql_as_promise(*args, **kwargs)
@@ -53,7 +53,7 @@ def execute_graphql(
5353
backend=None, # type: Optional[Any]
5454
**execute_options # type: Any
5555
):
56-
# type: (...) -> Union[ExecutionResult, AnonymousObservable]
56+
# type: (...) -> Union[ExecutionResult, Observable]
5757
try:
5858
if backend is None:
5959
backend = get_default_backend()

0 commit comments

Comments
 (0)