From 0b4c0c6ee6da97fa79695d6b77201bbf1362ee48 Mon Sep 17 00:00:00 2001 From: tomabolt Date: Thu, 30 Aug 2018 23:30:00 +0200 Subject: [PATCH] fixes #153: naming conflict when using Connection suffix --- examples/flask_sqlalchemy/schema.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/flask_sqlalchemy/schema.py b/examples/flask_sqlalchemy/schema.py index bca71d19..c9d22b4f 100644 --- a/examples/flask_sqlalchemy/schema.py +++ b/examples/flask_sqlalchemy/schema.py @@ -12,7 +12,7 @@ class Meta: interfaces = (relay.Node, ) -class DepartmentConnection(relay.Connection): +class DepartmentConn(relay.Connection): class Meta: node = Department @@ -23,7 +23,7 @@ class Meta: interfaces = (relay.Node, ) -class EmployeeConnection(relay.Connection): +class EmployeeConn(relay.Connection): class Meta: node = Employee @@ -34,7 +34,7 @@ class Meta: interfaces = (relay.Node, ) -class RoleConnection(relay.Connection): +class RoleConn(relay.Connection): class Meta: node = Role @@ -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])