graphql-python / graphql-python/graphene-sqlalchemy
String ID
Aperta
enhancement
- Lingua principale
- Python
- Stelle
- 985
- Fork
- 223
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Not only ints should be converted to the ID type, but also strings. Especially as GraphQL itself considers IDs as strings.
```python
@convert_sqlalchemy_type.register(types.String)
@convert_sqlalchemy_type.register(types.SmallInteger)
@convert_sqlalchemy_type.register(types.Integer)
def convert_column_to_int_or_id(type, column, registry=None):
return ID if column.primary_key else String
```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.