Skip to content

Commit 8cba98f

Browse files
committed
Merge pull request #49 from graphql-python/releases/0.4.13
Way to 0.4.13
2 parents 05152a1 + 2ea2cd2 commit 8cba98f

File tree

122 files changed

+2248
-1059
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+2248
-1059
lines changed

bin/autolinter

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# Install the required scripts with
4+
# pip install autoflake autopep8 isort
5+
autoflake ./graphql/ ./tests/ -r --remove-unused-variables --in-place
6+
autopep8 ./tests/ ./graphql/ -r --in-place --experimental --aggressive --max-line-length 120
7+
isort -rc ./tests/ ./graphql/

graphql/core/execution/base.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,10 @@
22
from ..error import GraphQLError
33
from ..language import ast
44
from ..pyutils.defer import DeferredException
5-
from ..type.definition import (
6-
GraphQLInterfaceType,
7-
GraphQLUnionType,
8-
)
9-
from ..type.directives import (
10-
GraphQLIncludeDirective,
11-
GraphQLSkipDirective,
12-
)
13-
from ..type.introspection import (
14-
SchemaMetaFieldDef,
15-
TypeMetaFieldDef,
16-
TypeNameMetaFieldDef,
17-
)
5+
from ..type.definition import GraphQLInterfaceType, GraphQLUnionType
6+
from ..type.directives import GraphQLIncludeDirective, GraphQLSkipDirective
7+
from ..type.introspection import (SchemaMetaFieldDef, TypeMetaFieldDef,
8+
TypeNameMetaFieldDef)
189
from ..utils.type_from_ast import type_from_ast
1910
from .values import get_argument_values, get_variable_values
2011

@@ -97,7 +88,7 @@ def __init__(self, data=None, errors=None, invalid=False):
9788
errors = [
9889
error.value if isinstance(error, DeferredException) else error
9990
for error in errors
100-
]
91+
]
10192

10293
self.errors = errors
10394

@@ -170,7 +161,9 @@ def collect_fields(ctx, runtime_type, selection_set, fields, prev_fragment_names
170161
fields[name].append(selection)
171162

172163
elif isinstance(selection, ast.InlineFragment):
173-
if not should_include_node(ctx, directives) or not does_fragment_condition_match(ctx, selection, runtime_type):
164+
if not should_include_node(
165+
ctx, directives) or not does_fragment_condition_match(
166+
ctx, selection, runtime_type):
174167
continue
175168

176169
collect_fields(ctx, runtime_type, selection.selection_set, fields, prev_fragment_names)
@@ -255,6 +248,7 @@ def get_field_entry_key(node):
255248

256249

257250
class ResolveInfo(object):
251+
258252
def __init__(self, field_name, field_asts, return_type, parent_type, context):
259253
self.field_name = field_name
260254
self.field_asts = field_asts

graphql/core/execution/executor.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@
66
from ..language.parser import parse
77
from ..language.source import Source
88
from ..pyutils.default_ordered_dict import DefaultOrderedDict
9-
from ..pyutils.defer import Deferred, DeferredDict, DeferredList, defer, succeed
10-
from ..type import GraphQLEnumType, GraphQLInterfaceType, GraphQLList, GraphQLNonNull, GraphQLObjectType, \
11-
GraphQLScalarType, GraphQLUnionType
9+
from ..pyutils.defer import (Deferred, DeferredDict, DeferredList, defer,
10+
succeed)
11+
from ..type import (GraphQLEnumType, GraphQLInterfaceType, GraphQLList,
12+
GraphQLNonNull, GraphQLObjectType, GraphQLScalarType,
13+
GraphQLUnionType)
1214
from ..validation import validate
13-
from .base import ExecutionContext, ExecutionResult, ResolveInfo, Undefined, collect_fields, default_resolve_fn, \
14-
get_field_def, get_operation_root_type
15+
from .base import (ExecutionContext, ExecutionResult, ResolveInfo, Undefined,
16+
collect_fields, default_resolve_fn, get_field_def,
17+
get_operation_root_type)
1518

1619

1720
class Executor(object):
21+
1822
def __init__(self, execution_middlewares=None, default_resolver=default_resolve_fn, map_type=dict):
1923
assert issubclass(map_type, collections.MutableMapping)
2024

graphql/core/execution/middlewares/asyncio.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def handle_future_result(future):
1717

1818

1919
class AsyncioExecutionMiddleware(object):
20+
2021
@staticmethod
2122
def run_resolve_fn(resolver, original_resolver):
2223
result = resolver()

graphql/core/execution/middlewares/gevent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def resolve_something(context, _*):
3030

3131

3232
class GeventExecutionMiddleware(object):
33+
3334
@staticmethod
3435
def run_resolve_fn(resolver, original_resolver):
3536
if resolver_has_tag(original_resolver, 'run_in_greenlet'):

graphql/core/execution/middlewares/sync.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
class SynchronousExecutionMiddleware(object):
6+
67
@staticmethod
78
def run_resolve_fn(resolver, original_resolver):
89
result = resolver()

graphql/core/execution/values.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
import collections
22
import json
3+
34
from six import string_types
5+
46
from ..error import GraphQLError
57
from ..language.printer import print_ast
6-
from ..type import (
7-
GraphQLEnumType,
8-
GraphQLInputObjectType,
9-
GraphQLList,
10-
GraphQLNonNull,
11-
GraphQLScalarType,
12-
is_input_type
13-
)
8+
from ..type import (GraphQLEnumType, GraphQLInputObjectType, GraphQLList,
9+
GraphQLNonNull, GraphQLScalarType, is_input_type)
1410
from ..utils.is_valid_value import is_valid_value
1511
from ..utils.type_from_ast import type_from_ast
1612
from ..utils.value_from_ast import value_from_ast

graphql/core/language/error.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66

77
class LanguageError(GraphQLError):
8+
89
def __init__(self, source, position, description):
910
location = get_location(source, position)
1011
super(LanguageError, self).__init__(

graphql/core/language/lexer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import json
2+
23
from six import unichr
4+
35
from .error import LanguageError
46

57
__all__ = ['Token', 'Lexer', 'TokenKind',

graphql/core/language/parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from six import string_types
2+
23
from . import ast
34
from .error import LanguageError
45
from .lexer import Lexer, TokenKind, get_token_desc, get_token_kind_desc

0 commit comments

Comments
 (0)