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: docs/inheritance.rst
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,13 @@
1
1
Inheritance Examples
2
2
====================
3
3
4
+
4
5
Create interfaces from inheritance relationships
5
6
------------------------------------------------
6
-
.. note:: If you're using `AsyncSession`, please check the section `Eager Loading & Using with AsyncSession`_.
7
+
8
+
.. note::
9
+
If you're using `AsyncSession`, please check the chapter `Eager Loading & Using with AsyncSession`_.
10
+
7
11
SQLAlchemy has excellent support for class inheritance hierarchies.
8
12
These hierarchies can be represented in your GraphQL schema by means
9
13
of interfaces_. Much like ObjectTypes, Interfaces in
@@ -111,8 +115,10 @@ class to the Schema constructor via the `types=` argument:
111
115
112
116
See also: `Graphene Interfaces <https://docs.graphene-python.org/en/latest/types/interfaces/>`_
113
117
118
+
114
119
Eager Loading & Using with AsyncSession
115
120
----------------------------------------
121
+
116
122
When querying the base type in multi-table inheritance or joined table inheritance, you can only directly refer to polymorphic fields when they are loaded eagerly.
117
123
This restricting is in place because AsyncSessions don't allow implicit async operations such as the loads of the joined tables.
118
124
To load the polymorphic fields eagerly, you can use the `with_polymorphic` attribute of the mapper args in the base model:
0 commit comments