From 5123b0ab46a2aab1b7fb883fd1c565c9472507a6 Mon Sep 17 00:00:00 2001 From: Frederick Polgardy Date: Wed, 18 Jan 2023 00:14:39 +0000 Subject: [PATCH] fix call to convert_sqlalchemy_type to take a type see https://github.com/graphql-python/graphene-sqlalchemy/pull/371 --- graphene_sqlalchemy_filter/filters.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/graphene_sqlalchemy_filter/filters.py b/graphene_sqlalchemy_filter/filters.py index 28cd93a..357f732 100644 --- a/graphene_sqlalchemy_filter/filters.py +++ b/graphene_sqlalchemy_filter/filters.py @@ -587,7 +587,12 @@ def _get_gql_type_from_sqla_type( if column_type is None: return GenericScalar else: - _type = convert_sqlalchemy_type(column_type, sqla_column) + # `convert_sqlalchemy_type` expects a type now + # - see https://github.com/graphql-python/graphene-sqlalchemy/pull/371 + # (Breaking Change: The first argument to converter functions is always a type) + if not isinstance(column_type, type): + column_type = type(column_type) + _type = convert_sqlalchemy_type(column_type, column=sqla_column) if inspect.isfunction(_type): return _type() # only graphene-sqlalchemy>2.2.0 return _type