You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class A(Base):
name = Column()
class B(A):
for_b = Column()
class C(A):
for_c = Column()
I then made graphql object for them like this
class Ainterface(Interface):
name = String()
class Meta:
interfaces = (Node,)
class AType(SQLAlchemyObjectType):
class Meta:
interfaces = (Ainterface)
model = A
class BType(SQLAlchemyObjectType):
class Meta:
interfaces = (Ainterface)
model = B
class CType(SQLAlchemyObjectType):
class Meta:
interfaces = (Ainterface)
model = C
class AllObjects(Union):
@classmethod
def resolve_type(cls, instance, info):
if isinstance(instance, A):
return AType
if isinstance(instance, B):
return BType
if isinstance(instance, C):
return CType
class Meta:
types = (AType, BType,CType)
what hurts is the fact that even though name is shared in all the children of class A
i cannot do something like this
{
objects: {
name
... on BType {
for_b
}
... on CType {
for_c
}
}
}
to query the data, is there a way that I can work this to be able to query
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics referencing this issue.
I have some polymorphic models
I then made graphql object for them like this
what hurts is the fact that even though name is shared in all the children of class A
i cannot do something like this
to query the data, is there a way that I can work this to be able to query
The text was updated successfully, but these errors were encountered: