Skip to content

Commit a46477d

Browse files
committed
Improve documentation for ast_from_value
1 parent 518e243 commit a46477d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/graphql/utilities/ast_from_value.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@
3434

3535

3636
def ast_from_value(value: Any, type_: GraphQLInputType) -> Optional[ValueNode]:
37-
"""Produce a GraphQL Value AST given a Python value.
37+
"""Produce a GraphQL Value AST given a Python object.
38+
39+
This function will match Python/JSON values to GraphQL AST schema format by using
40+
the suggested GraphQLInputType. For example::
41+
42+
ast_from_value('value', GraphQLString)
3843
3944
A GraphQL type must be provided, which will be used to interpret different Python
4045
values.

0 commit comments

Comments
 (0)