graphql-python / graphql-python/graphene-sqlalchemy

String ID

Aperta
#247 2 commenti 0 reazioni 1 assegnatario Rivendicata da @erikwrede Vedi su GitHub
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.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.