A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/graphql-python/graphene-sqlalchemy/issues/140 below:

geoalchemy2 support · Issue #140 · graphql-python/graphene-sqlalchemy · GitHub

Help! geoalchemy2 support!

class CoordinateMixin():
    location = db.Column('location', Geography(geometry_type='POINT' ,srid=4326, spatial_index=True, dimension=2), doc='gps coordinate')


Exception: Don't know how to convert the SQLAlchemy field user.location (<class 'sqlalchemy.sql.schema.Column'>)

I'v already add the following code in schema file.


from geoalchemy2 import Geography
from graphene_sqlalchemy.converter import get_column_doc, convert_sqlalchemy_type
from app.graphql.extesions import CoordinateJSON

@convert_sqlalchemy_type.register(Geography)
def convert_column_to_coordinatejson(type, column, registry=None):
    return graphene.Field(CoordinateJSON, description=get_column_doc(column))

schema = graphene.Schema(query=RootQuery, types=types, mutation=MyMutation)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4