Skip to content

Commit 555a266

Browse files
authored
Fix rendering ReST rendering in docstrings (#86)
1 parent 9c8dac7 commit 555a266

File tree

3 files changed

+32
-26
lines changed

3 files changed

+32
-26
lines changed

src/graphql/utilities/ast_from_value.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,17 @@ def ast_from_value(value: Any, type_: GraphQLInputType) -> Optional[ValueNode]:
4545
A GraphQL type must be provided, which will be used to interpret different Python
4646
values.
4747
48-
| JSON Value | GraphQL Value |
49-
| ------------- | -------------------- |
50-
| Object | Input Object |
51-
| Array | List |
52-
| Boolean | Boolean |
53-
| String | String / Enum Value |
54-
| Number | Int / Float |
55-
| Mixed | Enum Value |
56-
| null | NullValue |
48+
================ =======================
49+
JSON Value GraphQL Value
50+
================ =======================
51+
Object Input Object
52+
Array List
53+
Boolean Boolean
54+
String String / Enum Value
55+
Number Int / Float
56+
Mixed Enum Value
57+
null NullValue
58+
================ =======================
5759
5860
"""
5961
if is_non_null_type(type_):

src/graphql/utilities/value_from_ast.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@ def value_from_ast(
3636
Returns `Undefined` when the value could not be validly coerced according
3737
to the provided type.
3838
39-
| GraphQL Value | JSON Value | Python Value |
40-
| -------------------- | ------------- | ------------ |
41-
| Input Object | Object | dict |
42-
| List | Array | list |
43-
| Boolean | Boolean | bool |
44-
| String | String | str |
45-
| Int / Float | Number | int / float |
46-
| Enum Value | Mixed | Any |
47-
| NullValue | null | None |
39+
=================== ============== ================
40+
GraphQL Value JSON Value Python Value
41+
=================== ============== ================
42+
Input Object Object dict
43+
List Array list
44+
Boolean Boolean bool
45+
String String str
46+
Int / Float Number int / float
47+
Enum Value Mixed Any
48+
NullValue null None
49+
=================== ============== ================
4850
4951
"""
5052
if not value_node:

src/graphql/utilities/value_from_ast_untyped.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ def value_from_ast_untyped(
1515
Unlike `value_from_ast()`, no type is provided. The resulting Python value will
1616
reflect the provided GraphQL value AST.
1717
18-
| GraphQL Value | JSON Value | Python Value |
19-
| -------------------- | ---------- | ------------ |
20-
| Input Object | Object | dict |
21-
| List | Array | list |
22-
| Boolean | Boolean | bool |
23-
| String / Enum | String | str |
24-
| Int / Float | Number | int / float |
25-
| Null | null | None |
18+
=================== ============== ================
19+
GraphQL Value JSON Value Python Value
20+
=================== ============== ================
21+
Input Object Object dict
22+
List Array list
23+
Boolean Boolean bool
24+
String / Enum String str
25+
Int / Float Number int / float
26+
Null null None
27+
=================== ============== ================
2628
2729
"""
2830
func = _value_from_kind_functions.get(value_node.kind)

0 commit comments

Comments
 (0)