graphql-python / graphql-python/graphene-sqlalchemy

String ID

未關閉
#247 2 則留言 0 個 reaction 已指派 1 人 已被 @erikwrede 認領 在 GitHub 檢視
enhancement
主要語言
Python
星號
985
分支
223
PR 合併指標
30 天內沒有已合併 PR

描述

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

```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。