-
Notifications
You must be signed in to change notification settings - Fork 227
Subclassing Connection in 2.0 #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am also having trouble with this as I am adding custom specification for my connections. For now, my workaround is to overwrite import graphene.relay
class MyConnection(graphene.relay.Connection):
class Meta:
abstract = True
graphene.relay.Connection = MyConnection |
@neriusmika Your fix is great and this is a fix that was done for the Django-version as well. Best would be to rename |
I just submitted #120 which should fix this issue |
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. |
Uh oh!
There was an error while loading. Please reload this page.
Hi, in 2.0dev version I can't see the way to subclass
relay.Connection
. Because SQLAlchemyObjectType doesn't have a Connection attribute, the only way I see is to pass connection via the Meta class. Otherwise the connection is automatically created with default Connection class. But I can't specify the subclassed connection in Meta, because it needs a node attribute and I get circular reference. E. g.So I don't understand what's the point of connection parameter in SQLAlchemyObjectType Meta class? To make it work, I have changed SQLAlchemyObjectType.__init_subclass_with_meta__ and introduced connection_type parameter. Now I can make an abstract subclassed Connection and pass it to Meta:
Maybe I don't understand something and there is an easier way to make it work?
The text was updated successfully, but these errors were encountered: