graphql-python / graphql-python/graphene-sqlalchemy
geoalchemy2 support
- Linguagem predominante
- Python
- Estrelas
- 985
- Forks
- 223
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
## 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 ()
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)
```
Guia de contribuição
Direção de pesquisa
Start with the schema file and the reported conversion exception, then inspect how graphene_sqlalchemy.converter dispatches SQLAlchemy column types. Reproduce the Geography example and verify that schema creation handles the location field and produces the intended CoordinateJSON field.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- graphql, python, sqlalchemy
- Domínio
- backend-api-design
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 30/100