-
Notifications
You must be signed in to change notification settings - Fork 766
Closed
Closed
Copy link
Labels
Description
- What is the current behavior?
When setting up a node with a name specified using thenameoption in theMetaclass the type of the Connection and Edge type associated still use the Node class name as base name.
For example if you do:
# cookbook/graphql/category.py
import graphene
from cookbook.models import Category, Ingredient
class CategoryNode(DjangoObjectType):
class Meta:
model = Category
interfaces = (graphene.relay.Node, )
name = "Category"
class Query(graphene.ObjectType):
category = graphene.relay.Node.Field(CategoryNode)
all_categories = DjangoFilterConnectionField(CategoryNode)The exposed types will be Category, CategoryNodeConnection and CategoryNodeEdge.
-
What is the expected behavior?
I would have expected that the types would be:Category,CategoryConnectionandCategoryEdge. -
Environment:
- Version: graphene-django=2.12.1
- Platform: all
-
Other information
This is due to this line which should be instead:
connection = connection_class.create_type(
"{}Connection".format(options.get("name") or cls.__name__), node=cls
)