graphql-python / graphql-python/graphene-sqlalchemy
String ID
Offen
enhancement
- Vorherrschende Sprache
- Python
- Sterne
- 985
- Forks
- 223
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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
```
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.