Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions examples/flask_sqlalchemy/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Meta:
interfaces = (relay.Node, )


class DepartmentConnection(relay.Connection):
class DepartmentConn(relay.Connection):
class Meta:
node = Department

Expand All @@ -23,7 +23,7 @@ class Meta:
interfaces = (relay.Node, )


class EmployeeConnection(relay.Connection):
class EmployeeConn(relay.Connection):
class Meta:
node = Employee

Expand All @@ -34,7 +34,7 @@ class Meta:
interfaces = (relay.Node, )


class RoleConnection(relay.Connection):
class RoleConn(relay.Connection):
class Meta:
node = Role

Expand All @@ -47,14 +47,14 @@ class Query(graphene.ObjectType):
node = relay.Node.Field()
# Allow only single column sorting
all_employees = SQLAlchemyConnectionField(
EmployeeConnection,
EmployeeConn,
sort=graphene.Argument(
SortEnumEmployee,
default_value=utils.EnumValue('id_asc', EmployeeModel.id.asc())))
# Allows sorting over multiple columns, by default over the primary key
all_roles = SQLAlchemyConnectionField(RoleConnection)
all_roles = SQLAlchemyConnectionField(RoleConn)
# Disable sorting over this field
all_departments = SQLAlchemyConnectionField(DepartmentConnection, sort=None)
all_departments = SQLAlchemyConnectionField(DepartmentConn, sort=None)


schema = graphene.Schema(query=Query, types=[Department, Employee, Role])