graphql-python / graphql-python/graphene
Graphene Having Two DjangoObjectType of same Model
- Ngôn ngữ chính
- Python
- Star
- 8.2k
- Fork
- 818
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hi, I am new to graphene and my company has big application running over django and graphene. I have to segregate some services but that takes djangoobjectype with a model which has been defined already in another django app.
Bascially :
MyClassTypeA(DjangoObjectType:)
ModelA
MyClassTypeB(DjangoObjectType)
ModelB
while querying, from class type A, i realize that class type B overrides classtype A It causes other app not fetching data properly as query of class a reads from b.
What I want is both class doesn't interfere with each other while querying . Something like creating multiple seriailzerclass of same model with different classname which works independently.
Or can i easily inherit previous class and add some custom field .
I checked the docs and didn't get proper solution. DO we need to define Django object type of same model only once? I need duplicate djangoobjectype of different class name of same model.
Any help of this will be appreciated.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu bằng cách xem xét cách hai định nghĩa DjangoObjectType được đăng ký và phân giải khi chúng tham chiếu đến cùng một model Django. Tái hiện xung đột với kịch bản MyClassTypeA và MyClassTypeB, sau đó xác định xem cả hai type có thể truy vấn độc lập hay việc kế thừa và các field tùy chỉnh mới cung cấp sự phân tách như dự kiến.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- graphql, python
- Lĩnh vực
- api, backend
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100