Closed
Description
Thanks for the awesome work team! Since 2.8.1 I get these warning from graphene_django
(and many more which are similar, because I added same fields to the exclude tag
- My
orders.Project
model has a ForeignKey calledtenant
mapping tousers.Tenant
. I can access the Tenant in graphql direct from the project if I do not put it in the exclude (works even though the warning is there)
warnings.warn(
/usr/local/lib/python3.8/site-packages/graphene_django/types.py:76: UserWarning: Field name "tenant" matches an attribute on Django model "orders.Project" but it's not a model field so Graphene cannot determine what type it should be. Either define the type of the field on DjangoObjectType "ProjectNode" or remove it from the "fields" list.
- Same situation as above. But this time other way around. Since I am using relay I could normally query the field by
membership_set { edges { node { id} } }
if not putting it in exclude. If adding it to exclude I get this warning.
warnings.warn(
/usr/local/lib/python3.8/site-packages/graphene_django/types.py:76: UserWarning: Field name "project_set" matches an attribute on Django model "users.Tenant" but it's not a model field so Graphene cannot determine what type it should be. Either define the type of the field on DjangoObjectType "TenantNode" or remove it from the "fields" list.
Question: Is this intended? If yes how do can I resolve it? I have read through the PRs related to the latest version (I can definitely see where this error comes from), but am still clueless.
Metadata
Metadata
Assignees
Labels
No labels