How to use the graphene-sqlalchemy.graphene_sqlalchemy.fields.SQLAlchemyConnectionField function in graphene-sqlalchemy

To help you get started, we’ve selected a few graphene-sqlalchemy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphql-python / graphene / graphene-sqlalchemy / graphene_sqlalchemy / converter.py View on Github external
def dynamic_type():
        _type = registry.get_type_for_model(model)
        if not _type:
            return None
        if (direction == interfaces.MANYTOONE or not relationship.uselist):
            return Field(_type)
        elif (direction == interfaces.ONETOMANY or
              direction == interfaces.MANYTOMANY):
            if is_node(_type):
                return SQLAlchemyConnectionField(_type)
            return Field(List(_type))