graphql-python / graphql-python/graphene

Graphene Having Two DjangoObjectType of same Model

Offen
#1,341 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
✨ enhancement
Vorherrschende Sprache
Python
Sterne
8.2k
Forks
818
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.