graphql-python / graphql-python/graphene-sqlalchemy
required should be inferred from the return type of a hybrid property
Đang mở
- Ngôn ngữ chính
- Python
- Star
- 985
- Fork
- 223
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
With a definition like:
```
@hybrid_property
def is_active(self) -> bool:
return self.state == 'ACTIVE'
```
The resulting graphql field type is currently marked `Boolean` unless overridden by `ORMField()`. Column properties correctly determine the nullability from the column definition. It seems reasonable to do the same for the hybrid_property based on the declared type. If the return type were `bool | None`, then it would be optional, otherwise it should be required.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.