Skip to content

Commit 9d104eb

Browse files
committed
More clean-up after auto formatting with black
1 parent 77d52ff commit 9d104eb

28 files changed

+629
-634
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ a query language for APIs created by Facebook.
1212
[![Python 3 Status](https://pyup.io/repos/github/graphql-python/graphql-core-next/python-3-shield.svg)](https://pyup.io/repos/github/graphql-python/graphql-core-next/)
1313

1414
The current version 1.0.1 of GraphQL-core-next is up-to-date with GraphQL.js version
15-
14.0.2. All parts of the API are covered by an extensive test suite of currently 1617
15+
14.0.2. All parts of the API are covered by an extensive test suite of currently 1618
1616
unit tests.
1717

1818

graphql/execution/execute.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ def complete_leaf_value(return_type: GraphQLLeafType, result: Any) -> Any:
842842
serialized_result = return_type.serialize(result)
843843
if is_invalid(serialized_result):
844844
raise TypeError(
845-
f"Expected a value of type '{return_type}'" f" but received: {result!r}"
845+
f"Expected a value of type '{return_type}' but received: {result!r}"
846846
)
847847
return serialized_result
848848

@@ -1084,8 +1084,7 @@ def invalid_return_type_error(
10841084
) -> GraphQLError:
10851085
"""Create a GraphQLError for an invalid return type."""
10861086
return GraphQLError(
1087-
f"Expected value of type '{return_type.name}'" f" but got: {result!r}.",
1088-
field_nodes,
1087+
f"Expected value of type '{return_type.name}' but got: {result!r}.", field_nodes
10891088
)
10901089

10911090

graphql/language/lexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def read_number(source: Source, start, char, line, col, prev) -> Token:
278278
raise GraphQLSyntaxError(
279279
source,
280280
position,
281-
"Invalid number," f" unexpected digit after 0: {print_char(char)}.",
281+
f"Invalid number, unexpected digit after 0: {print_char(char)}.",
282282
)
283283
else:
284284
position = read_digits(source, position, char)

graphql/subscription/subscribe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ async def create_source_event_stream(
103103
104104
Returns a coroutine that yields an AsyncIterable.
105105
106-
If the client-provided invalid arguments, the source stream could not be created,
106+
If the client provided invalid arguments, the source stream could not be created,
107107
or the resolver did not return an AsyncIterable, this function will throw an error,
108108
which should be caught and handled by the caller.
109109
@@ -173,5 +173,5 @@ async def create_source_event_stream(
173173
if isinstance(event_stream, AsyncIterable):
174174
return cast(AsyncIterable, event_stream)
175175
raise TypeError(
176-
"Subscription field must return AsyncIterable." f" Received: {event_stream!r}"
176+
f"Subscription field must return AsyncIterable. Received: {event_stream!r}"
177177
)

graphql/type/definition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class GraphQLWrappingType(GraphQLType, Generic[GT]):
158158
def __init__(self, type_: GT) -> None:
159159
if not is_type(type_):
160160
raise TypeError(
161-
"Can only create a wrapper for a GraphQLType, but got:" f" {type_}."
161+
f"Can only create a wrapper for a GraphQLType, but got: {type_}."
162162
)
163163
self.of_type = type_
164164

graphql/type/validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def validate_root_types(self):
112112
self.report_error("Query root type must be provided.", schema.ast_node)
113113
elif not is_object_type(query_type):
114114
self.report_error(
115-
"Query root type must be Object type," f" it cannot be {query_type}.",
115+
f"Query root type must be Object type, it cannot be {query_type}.",
116116
get_operation_type_node(schema, query_type, OperationType.QUERY),
117117
)
118118

graphql/utilities/assert_valid_name.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def is_valid_name_error(name: str, node: Node = None) -> Optional[GraphQLError]:
3030
)
3131
if not re_name.match(name):
3232
return GraphQLError(
33-
"Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/" f" but {name!r} does not.",
34-
node,
33+
f"Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but {name!r} does not.", node
3534
)
3635
return None

graphql/utilities/build_client_schema.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def build_object_def(object_introspection: Dict) -> GraphQLObjectType:
143143
interfaces = object_introspection.get("interfaces")
144144
if interfaces is None:
145145
raise TypeError(
146-
"Introspection result missing interfaces:" f" {object_introspection!r}"
146+
f"Introspection result missing interfaces: {object_introspection!r}"
147147
)
148148
return GraphQLObjectType(
149149
name=object_introspection["name"],
@@ -180,7 +180,7 @@ def build_union_def(union_introspection: Dict) -> GraphQLUnionType:
180180
def build_enum_def(enum_introspection: Dict) -> GraphQLEnumType:
181181
if enum_introspection.get("enumValues") is None:
182182
raise TypeError(
183-
"Introspection result missing enumValues:" f" {enum_introspection!r}"
183+
f"Introspection result missing enumValues: {enum_introspection!r}"
184184
)
185185
return GraphQLEnumType(
186186
name=enum_introspection["name"],
@@ -222,7 +222,7 @@ def build_input_object_def(
222222
def build_field(field_introspection: Dict) -> GraphQLField:
223223
if field_introspection.get("args") is None:
224224
raise TypeError(
225-
"Introspection result missing field args:" f" {field_introspection!r}"
225+
f"Introspection result missing field args: {field_introspection!r}"
226226
)
227227
return GraphQLField(
228228
get_output_type(field_introspection["type"]),
@@ -234,7 +234,7 @@ def build_field(field_introspection: Dict) -> GraphQLField:
234234
def build_field_def_map(type_introspection: Dict) -> Dict[str, GraphQLField]:
235235
if type_introspection.get("fields") is None:
236236
raise TypeError(
237-
"Introspection result missing fields:" f" {type_introspection!r}"
237+
f"Introspection result missing fields: {type_introspection!r}"
238238
)
239239
return {
240240
field_introspection["name"]: build_field(field_introspection)

graphql/utilities/coerce_value.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def coerce_value(
166166
errors = add(
167167
errors,
168168
coercion_error(
169-
f"Field '{field_name}'" f" is not defined by type {type_.name}",
169+
f"Field '{field_name}' is not defined by type {type_.name}",
170170
blame_node,
171171
path,
172172
did_you_mean,

graphql/utilities/find_breaking_changes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def find_types_removed_from_unions(
554554
types_removed_from_union.append(
555555
BreakingChange(
556556
BreakingChangeType.TYPE_REMOVED_FROM_UNION,
557-
f"{type_name} was removed" f" from union type {old_type_name}.",
557+
f"{type_name} was removed from union type {old_type_name}.",
558558
)
559559
)
560560
return types_removed_from_union

graphql/validation/rules/fragments_on_composite_types.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ def inline_fragment_on_non_composite_error_message(type_: str) -> str:
1616

1717

1818
def fragment_on_non_composite_error_message(frag_name: str, type_: str) -> str:
19-
return (
20-
f"Fragment '{frag_name}'" f" cannot condition on non composite type '{type_}'."
21-
)
19+
return f"Fragment '{frag_name}' cannot condition on non composite type '{type_}'."
2220

2321

2422
class FragmentsOnCompositeTypesRule(ValidationRule):

graphql/validation/rules/known_argument_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def unknown_arg_message(
2929
def unknown_directive_arg_message(
3030
arg_name: str, directive_name: str, suggested_args: List[str]
3131
) -> str:
32-
message = f"Unknown argument '{arg_name}'" f" on directive '@{directive_name}'."
32+
message = f"Unknown argument '{arg_name}' on directive '@{directive_name}'."
3333
if suggested_args:
3434
message += f" Did you mean {quoted_or_list(suggested_args)}?"
3535
return message

graphql/validation/rules/overlapping_fields_can_be_merged.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ def find_conflict(
564564

565565
if type1 and type2 and do_types_conflict(type1, type2):
566566
return (
567-
(response_name, "they return conflicting types" f" {type1} and {type2}"),
567+
(response_name, f"they return conflicting types {type1} and {type2}"),
568568
[node1],
569569
[node2],
570570
)

graphql/validation/rules/variables_are_input_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
def non_input_type_on_var_message(variable_name: str, type_name: str) -> str:
11-
return f"Variable '${variable_name}'" f" cannot be non-input type '{type_name}'."
11+
return f"Variable '${variable_name}' cannot be non-input type '{type_name}'."
1212

1313

1414
class VariablesAreInputTypesRule(ValidationRule):

tests/execution/test_nonnull.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -560,10 +560,10 @@ def succeeds_when_passed_non_null_literal_value():
560560
schema_with_non_null_arg,
561561
parse(
562562
"""
563-
query {
564-
withNonNullArg (cannotBeNull: "literal value")
565-
}
566-
"""
563+
query {
564+
withNonNullArg (cannotBeNull: "literal value")
565+
}
566+
"""
567567
),
568568
)
569569

@@ -574,10 +574,10 @@ def succeeds_when_passed_non_null_variable_value():
574574
schema_with_non_null_arg,
575575
parse(
576576
"""
577-
query ($testVar: String = "default value") {
578-
withNonNullArg (cannotBeNull: $testVar)
579-
}
580-
"""
577+
query ($testVar: String = "default value") {
578+
withNonNullArg (cannotBeNull: $testVar)
579+
}
580+
"""
581581
),
582582
variable_values={},
583583
) # intentionally missing variable
@@ -592,10 +592,10 @@ def field_error_when_missing_non_null_arg():
592592
schema_with_non_null_arg,
593593
parse(
594594
"""
595-
query {
596-
withNonNullArg
597-
}
598-
"""
595+
query {
596+
withNonNullArg
597+
}
598+
"""
599599
),
600600
)
601601

@@ -605,7 +605,7 @@ def field_error_when_missing_non_null_arg():
605605
{
606606
"message": "Argument 'cannotBeNull' of required type"
607607
" 'String!' was not provided.",
608-
"locations": [(3, 19)],
608+
"locations": [(3, 23)],
609609
"path": ["withNonNullArg"],
610610
}
611611
],
@@ -619,10 +619,10 @@ def field_error_when_non_null_arg_provided_null():
619619
schema_with_non_null_arg,
620620
parse(
621621
"""
622-
query {
623-
withNonNullArg(cannotBeNull: null)
624-
}
625-
"""
622+
query {
623+
withNonNullArg(cannotBeNull: null)
624+
}
625+
"""
626626
),
627627
)
628628

@@ -632,7 +632,7 @@ def field_error_when_non_null_arg_provided_null():
632632
{
633633
"message": "Argument 'cannotBeNull' of non-null type"
634634
" 'String!' must not be null.",
635-
"locations": [(3, 48)],
635+
"locations": [(3, 52)],
636636
"path": ["withNonNullArg"],
637637
}
638638
],
@@ -646,10 +646,10 @@ def field_error_when_non_null_arg_not_provided_variable_value():
646646
schema_with_non_null_arg,
647647
parse(
648648
"""
649-
query ($testVar: String) {
650-
withNonNullArg(cannotBeNull: $testVar)
651-
}
652-
"""
649+
query ($testVar: String) {
650+
withNonNullArg(cannotBeNull: $testVar)
651+
}
652+
"""
653653
),
654654
variable_values={},
655655
) # intentionally missing variable
@@ -662,7 +662,7 @@ def field_error_when_non_null_arg_not_provided_variable_value():
662662
" 'String!' was provided the variable"
663663
" '$testVar' which was not provided"
664664
" a runtime value.",
665-
"locations": [(3, 48)],
665+
"locations": [(3, 52)],
666666
"path": ["withNonNullArg"],
667667
}
668668
],
@@ -673,10 +673,10 @@ def field_error_when_non_null_arg_provided_explicit_null_variable():
673673
schema_with_non_null_arg,
674674
parse(
675675
"""
676-
query ($testVar: String = "default value") {
677-
withNonNullArg (cannotBeNull: $testVar)
678-
}
679-
"""
676+
query ($testVar: String = "default value") {
677+
withNonNullArg (cannotBeNull: $testVar)
678+
}
679+
"""
680680
),
681681
variable_values={"testVar": None},
682682
)
@@ -687,7 +687,7 @@ def field_error_when_non_null_arg_provided_explicit_null_variable():
687687
{
688688
"message": "Argument 'cannotBeNull' of non-null type"
689689
" 'String!' must not be null.",
690-
"locations": [(3, 49)],
690+
"locations": [(3, 53)],
691691
"path": ["withNonNullArg"],
692692
}
693693
],

tests/language/test_schema_parser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,11 @@ def extension_do_not_include_descriptions():
215215
)
216216
assert_syntax_error(
217217
"""
218-
extend "Description" type Hello {
219-
world: String
220-
}""",
218+
extend "Description" type Hello {
219+
world: String
220+
}""",
221221
"Unexpected String 'Description'",
222-
(2, 18),
222+
(2, 20),
223223
)
224224

225225
def schema_extension():

0 commit comments

Comments
 (0)