Skip to content

Commit c39f2ca

Browse files
committed
extend_schema: remove dead check on number of directives
Replicates graphql/graphql-js@94b7e72
1 parent 2fdd376 commit c39f2ca

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/graphql/utilities/extend_schema.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,6 @@ def replace_directive(directive: GraphQLDirective) -> GraphQLDirective:
138138
}
139139
)
140140

141-
def replace_directives(
142-
directives: List[GraphQLDirective],
143-
) -> List[GraphQLDirective]:
144-
if not directives:
145-
raise TypeError("schema must have default directives.")
146-
147-
return [replace_directive(directive) for directive in schema.directives]
148-
149141
def extend_named_type(type_: GraphQLNamedType) -> GraphQLNamedType:
150142
if is_introspection_type(type_) or is_specified_scalar_type(type_):
151143
# Builtin types are not extended.
@@ -357,7 +349,7 @@ def resolve_type(type_name: str) -> GraphQLNamedType:
357349
mutation=get_operation(OperationType.MUTATION),
358350
subscription=get_operation(OperationType.SUBSCRIPTION),
359351
types=type_map.values(),
360-
directives=replace_directives(schema.directives)
352+
directives=[replace_directive(directive) for directive in schema.directives]
361353
+ ast_builder.build_directives(directive_defs),
362354
ast_node=schema_def or schema.ast_node,
363355
extension_ast_nodes=(

0 commit comments

Comments
 (0)