graphql-python / graphql-python/graphene
Graphene Having Two DjangoObjectType of same Model
- 主要言語
- Python
- スター
- 8.2k
- フォーク
- 818
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Start by reviewing how the two DjangoObjectType definitions are registered and resolved when they reference the same Django model. Reproduce the conflict with the MyClassTypeA and MyClassTypeB scenario, then determine whether both types can query independently or whether inheritance and custom fields provide the intended separation.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- graphql, python
- 領域
- api, backend
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100