-
Notifications
You must be signed in to change notification settings - Fork 227
Closed
Description
Hi there, does graphene-sqlalchemy support overriding the automapper to allow us to map resolved ORM objects to custom db objects?
As an example, I'd like a graphsql schema of the following:
class MyCustomObject(graphene.ObjectType):
customField = Field(String)
and my ORM object:
class MyDBObject(db.Model):
str_field = db.Column(db.String(128))
Now if I query MyCustomObject:
{
my_custom_objects {
customField
}
}
I want to be able to map the custom object fields to my db object, return my db objects, and have them mapped back to MyCustomObject.
I'm fairly new to graphql and graphene, so I apologize in advance if this is an extremely basic connection or if this isn't how graphql is meant to work.
Note: the reason I'm apprehensive of just mapping the field in the resolver is that we have to return MyDBObject.query.all() which will be expensive to serialize
Metadata
Metadata
Assignees
Labels
No labels