Skip to content

Commit 2508417

Browse files
committed
Use is_leaf_type instead of is_enum_type & is_scalar_type combo
Replicates graphql/graphql-js@56ad8a1
1 parent 81d7b0f commit 2508417

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graphql/utilities/ast_from_value.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
GraphQLNonNull,
2424
is_enum_type,
2525
is_input_object_type,
26+
is_leaf_type,
2627
is_list_type,
2728
is_non_null_type,
28-
is_scalar_type,
2929
)
3030

3131
__all__ = ["ast_from_value"]
@@ -96,7 +96,7 @@ def ast_from_value(value: Any, type_: GraphQLInputType) -> Optional[ValueNode]:
9696
)
9797
return ObjectValueNode(fields=field_nodes)
9898

99-
if is_scalar_type(type_) or is_enum_type(type_):
99+
if is_leaf_type(type_):
100100
# Since value is an internally represented value, it must be serialized to an
101101
# externally represented value before converting into an AST.
102102
serialized = type_.serialize(value) # type: ignore

0 commit comments

Comments
 (0)