Skip to content

Commit 637655b

Browse files
committed
introspection: simplify 'include_deprecated' logic
Replicates graphql/graphql-js@e43d6d5
1 parent 66334cc commit 637655b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/graphql/type/introspection.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,11 @@ def specified_by_url(type_, _info):
290290
def fields(type_, _info, includeDeprecated=False):
291291
if is_object_type(type_) or is_interface_type(type_):
292292
items = type_.fields.items()
293-
if not includeDeprecated:
294-
return [item for item in items if item[1].deprecation_reason is None]
295-
return list(items)
293+
return (
294+
list(items)
295+
if includeDeprecated
296+
else [item for item in items if item[1].deprecation_reason is None]
297+
)
296298

297299
@staticmethod
298300
def interfaces(type_, _info):

0 commit comments

Comments
 (0)