Skip to content

Commit 0b4c0c6

Browse files
committed
fixes #153: naming conflict when using Connection suffix
1 parent 8872577 commit 0b4c0c6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/flask_sqlalchemy/schema.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Meta:
1212
interfaces = (relay.Node, )
1313

1414

15-
class DepartmentConnection(relay.Connection):
15+
class DepartmentConn(relay.Connection):
1616
class Meta:
1717
node = Department
1818

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

2525

26-
class EmployeeConnection(relay.Connection):
26+
class EmployeeConn(relay.Connection):
2727
class Meta:
2828
node = Employee
2929

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

3636

37-
class RoleConnection(relay.Connection):
37+
class RoleConn(relay.Connection):
3838
class Meta:
3939
node = Role
4040

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

5959

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

0 commit comments

Comments
 (0)