Skip to content

Commit 6dc34f0

Browse files
committed
Mark unused arguments with underscore
Replicates graphql/graphql-js@ed2563b
1 parent 81ed84a commit 6dc34f0

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/graphql/type/introspection.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -469,23 +469,23 @@ class TypeKind(Enum):
469469
GraphQLNonNull(__Schema), # name = '__schema'
470470
description="Access the current type schema of this server.",
471471
args={},
472-
resolve=lambda source, info: info.schema,
472+
resolve=lambda _source, info: info.schema,
473473
)
474474

475475

476476
TypeMetaFieldDef = GraphQLField(
477477
__Type, # name = '__type'
478478
description="Request the type information of a single type.",
479479
args={"name": GraphQLArgument(GraphQLNonNull(GraphQLString))},
480-
resolve=lambda source, info, **args: info.schema.get_type(args["name"]),
480+
resolve=lambda _source, info, **args: info.schema.get_type(args["name"]),
481481
)
482482

483483

484484
TypeNameMetaFieldDef = GraphQLField(
485485
GraphQLNonNull(GraphQLString), # name='__typename'
486486
description="The name of the current Object type at runtime.",
487487
args={},
488-
resolve=lambda source, info, **args: info.parent_type.name,
488+
resolve=lambda _source, info, **_args: info.parent_type.name,
489489
)
490490

491491

tests/execution/test_executor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ def uses_a_custom_field_resolver():
867867
)
868868
document = parse("{ foo }")
869869

870-
def field_resolver(source_, info):
870+
def field_resolver(_source, info):
871871
# For the purposes of test, just return the name of the field!
872872
return info.field_name
873873

tests/execution/test_union_interface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ def allows_fragment_conditions_to_be_abstract_types():
449449
def gets_execution_info_in_resolver():
450450
encountered = {}
451451

452-
def resolve_type(_obj, info, _type):
452+
def resolve_type(_source, info, _type):
453453
encountered["context"] = info.context
454454
encountered["schema"] = info.schema
455455
encountered["root_value"] = info.root_value

tests/star_wars_schema.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
),
230230
)
231231
},
232-
resolve=lambda root, _info, episode=None: get_hero(episode),
232+
resolve=lambda _source, _info, episode=None: get_hero(episode),
233233
),
234234
"human": GraphQLField(
235235
human_type,
@@ -238,7 +238,7 @@
238238
GraphQLNonNull(GraphQLString), description="id of the human"
239239
)
240240
},
241-
resolve=lambda root, _info, id: get_human(id),
241+
resolve=lambda _source, _info, id: get_human(id),
242242
),
243243
"droid": GraphQLField(
244244
droid_type,
@@ -247,7 +247,7 @@
247247
GraphQLNonNull(GraphQLString), description="id of the droid"
248248
)
249249
},
250-
resolve=lambda root, _info, id: get_droid(id),
250+
resolve=lambda _source, _info, id: get_droid(id),
251251
),
252252
},
253253
)

tests/type/test_enum.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Complex2:
5050
"fromInt": GraphQLArgument(GraphQLInt),
5151
"fromString": GraphQLArgument(GraphQLString),
5252
},
53-
resolve=lambda value, info, **args: args.get("fromInt")
53+
resolve=lambda _source, info, **args: args.get("fromInt")
5454
or args.get("fromString")
5555
or args.get("fromEnum"),
5656
),
@@ -60,7 +60,7 @@ class Complex2:
6060
"fromEnum": GraphQLArgument(ColorType),
6161
"fromInt": GraphQLArgument(GraphQLInt),
6262
},
63-
resolve=lambda value, info, **args: args.get("fromInt")
63+
resolve=lambda _source, info, **args: args.get("fromInt")
6464
or args.get("fromEnum"),
6565
),
6666
"complexEnum": GraphQLField(
@@ -72,7 +72,7 @@ class Complex2:
7272
"provideGoodValue": GraphQLArgument(GraphQLBoolean),
7373
"provideBadValue": GraphQLArgument(GraphQLBoolean),
7474
},
75-
resolve=lambda value, info, **args:
75+
resolve=lambda _source, info, **args:
7676
# Note: this is one of the references of the internal values
7777
# which ComplexEnum allows.
7878
complex2 if args.get("provideGoodValue")
@@ -89,7 +89,7 @@ class Complex2:
8989
"favoriteEnum": GraphQLField(
9090
ColorType,
9191
args={"color": GraphQLArgument(ColorType)},
92-
resolve=lambda value, info, color=None: color,
92+
resolve=lambda _source, info, color=None: color,
9393
)
9494
},
9595
)
@@ -100,7 +100,7 @@ class Complex2:
100100
"subscribeToEnum": GraphQLField(
101101
ColorType,
102102
args={"color": GraphQLArgument(ColorType)},
103-
resolve=lambda value, info, color=None: color,
103+
resolve=lambda _source, info, color=None: color,
104104
)
105105
},
106106
)

0 commit comments

Comments
 (0)