Skip to content

Commit 4af4286

Browse files
committed
fix: don't loose extensions when sorting schemas
1 parent e1ccf45 commit 4af4286

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/graphql/utilities/lexicographic_sort_schema.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def sort_input_fields(
9797
),
9898
description=field.description,
9999
default_value=field.default_value,
100+
extensions=field.extensions,
100101
ast_node=field.ast_node,
101102
)
102103
for name, field in sorted(fields_map.items())
@@ -143,6 +144,7 @@ def sort_named_type(type_: GraphQLNamedType) -> GraphQLNamedType:
143144
val.value,
144145
description=val.description,
145146
deprecation_reason=val.deprecation_reason,
147+
extensions=val.extensions,
146148
ast_node=val.ast_node,
147149
)
148150
for name, val in sorted(type_.values.items())
@@ -179,6 +181,7 @@ def sort_named_type(type_: GraphQLNamedType) -> GraphQLNamedType:
179181
subscription=cast(
180182
Optional[GraphQLObjectType], replace_maybe_type(schema.subscription_type)
181183
),
184+
extensions=schema.extensions,
182185
ast_node=schema.ast_node,
183186
)
184187

0 commit comments

Comments
 (0)