|
2 | 2 | import sqlalchemy as sa
|
3 | 3 |
|
4 | 4 | from graphene import Argument, Enum, List, ObjectType, Schema
|
5 |
| -from graphene.relay import Connection, Node |
| 5 | +from graphene.relay import Node |
6 | 6 |
|
7 | 7 | from ..fields import SQLAlchemyConnectionField
|
8 | 8 | from ..types import SQLAlchemyObjectType
|
@@ -249,22 +249,18 @@ class Meta:
|
249 | 249 | model = Pet
|
250 | 250 | interfaces = (Node,)
|
251 | 251 |
|
252 |
| - class PetConnection(Connection): |
253 |
| - class Meta: |
254 |
| - node = PetNode |
255 |
| - |
256 | 252 | class Query(ObjectType):
|
257 |
| - defaultSort = SQLAlchemyConnectionField(PetConnection) |
258 |
| - nameSort = SQLAlchemyConnectionField(PetConnection) |
259 |
| - multipleSort = SQLAlchemyConnectionField(PetConnection) |
260 |
| - descSort = SQLAlchemyConnectionField(PetConnection) |
| 253 | + defaultSort = SQLAlchemyConnectionField(PetNode.connection) |
| 254 | + nameSort = SQLAlchemyConnectionField(PetNode.connection) |
| 255 | + multipleSort = SQLAlchemyConnectionField(PetNode.connection) |
| 256 | + descSort = SQLAlchemyConnectionField(PetNode.connection) |
261 | 257 | singleColumnSort = SQLAlchemyConnectionField(
|
262 |
| - PetConnection, sort=Argument(PetNode.sort_enum()) |
| 258 | + PetNode.connection, sort=Argument(PetNode.sort_enum()) |
263 | 259 | )
|
264 | 260 | noDefaultSort = SQLAlchemyConnectionField(
|
265 |
| - PetConnection, sort=PetNode.sort_argument(has_default=False) |
| 261 | + PetNode.connection, sort=PetNode.sort_argument(has_default=False) |
266 | 262 | )
|
267 |
| - noSort = SQLAlchemyConnectionField(PetConnection, sort=None) |
| 263 | + noSort = SQLAlchemyConnectionField(PetNode.connection, sort=None) |
268 | 264 |
|
269 | 265 | query = """
|
270 | 266 | query sortTest {
|
|
0 commit comments