Skip to content

Commit d3877cc

Browse files
committed
Removed prints and tweaked docs.
1 parent 0927e22 commit d3877cc

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,6 @@ Python 3.6's typing will not preserve the Union and throws away the annotation f
260260
See [this issue](https://github.com/upsidetravel/graphene-pydantic/issues/11) for more details.
261261
The solution at present is to use Python 3.7.
262262

263-
##### Unions don't work in Input Object Types
263+
##### Input Object Types don't support unions as fields
264264

265-
GraphQL currently only supports unions for object types. See [this RFC](https://github.com/graphql/graphql-spec/blob/master/rfcs/InputUnion.md) for the progress on supporting input unions.
265+
This is a GraphQL limitation. See [this RFC](https://github.com/graphql/graphql-spec/blob/master/rfcs/InputUnion.md) for the progress on supporting input unions. If you see an error like '{union-type} may only contain Object types', you are most likely encountering this limitation.

graphene_pydantic/converters.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ def convert_pydantic_input_field(
9494
Convert a Pydantic model field into a Graphene type field that we can add
9595
to the generated Graphene data model type.
9696
"""
97-
print("convert_pydantic_input_field", type(field))
9897
declared_type = getattr(field, "type_", None)
9998
field_kwargs.setdefault(
10099
"type",
@@ -124,7 +123,6 @@ def convert_pydantic_field(
124123
Convert a Pydantic model field into a Graphene type field that we can add
125124
to the generated Graphene data model type.
126125
"""
127-
print("convert_pydantic_field", type(field))
128126
declared_type = getattr(field, "type_", None)
129127
field_kwargs.setdefault(
130128
"type",

tests/test_graphene.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def test_query():
8080

8181
assert result.errors is None
8282
assert result.data is not None
83-
print(result)
8483
assert pydantic.parse_obj_as(List[FooBar], result.data["listFooBars"]) == foo_bars
8584

8685

0 commit comments

Comments
 (0)