GHC 2019-06-14

2 comments.

, https://git.io/fj2ye in graphql-python/graphene-sqlalchemy
> With only one class subclassing the SQLAlchemyObjectType you don't get the warning.

Nah, that’s probably because your `Channel` does not auto-generate a connection field, while your `Model` does. Check your schema, including nested levels. There’s nothing magical about the warning: it’s printed every time a connection field is created with the default factory.

, https://git.io/fj22Z in graphql-python/graphene-sqlalchemy
Expanding on previous comments, here's a working example of a custom connection type (`graphene-sqlalchemy==2.2.0`):

```py
from graphene import Int, NonNull, ObjectType
from graphene.relay import Connection, Node
from graphene_sqlalchemy import SQLAlchemyObjectType, SQLAlchemyConnectionField


# Implements the totalCount field in a connection.
class CountedConnection(Connection):
    class Meta:
        # Being abstract is important because we can't reference the
        # node type here without creating a circular reference. Also, it
        # makes reuse easy.
        #
        # The node type will be populated later with
        # `CountedConnection.create_class()` in `Foo`'s
        # `__init_subclass_with_meta__()`.
        abstract = True

    total_count = NonNull(Int)

    def resolve_total_count(self, info, **kwargs):
        return self.length


# FooConnection is autogenerated due to the Node interface.
class Foo(SQLAlchemyObjectType):
    class Meta:
        model = FooModel
        interfaces = (Node,)
        connection_class = CountedConnection


# The connection field can be customized too.
class FooConnectionField(SQLAlchemyConnectionField):
    pass


class Query(ObjectType):
    fooList = FooConnectionField(Foo)
```