You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+78Lines changed: 78 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,8 @@ Please see the [Contributing Guide](./CONTRIBUTING.md). Note that you must sign
106
106
107
107
### Caveats
108
108
109
+
#### Mappings
110
+
109
111
Note that even though Pydantic is perfectly happy with fields that hold mappings (e.g. dictionaries), because [GraphQL's type system doesn't have them](https://graphql.org/learn/schema/) those fields can't be exported to Graphene types. For instance, this will fail with an error `Don't know how to handle mappings in Graphene`:
110
112
111
113
```python
@@ -132,3 +134,79 @@ class GraphQLPerson(PydanticObjectType):
132
134
model = Person
133
135
exclude_fields = ("pets_by_name",)
134
136
```
137
+
138
+
#### Union types
139
+
140
+
There are some caveats when using Unions. Let's take the following pydantic models as an example for this section:
0 commit comments