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 Account(models.Model):
name = models.CharField(max_length=100)
class OrgMember(models.Model):
account = models.OneToOneField(Account, on_delete=models.CASCADE, related_name="member")
class Org(models.Model):
owner = models.OneToOneField(OrgMember, on_delete=models.CASCADE, related_name="org")
and the following mutations:
class AccountType(DjangoObjectType):
class Meta:
model = Account
class OrgMemberType(DjangoObjectType):
class Meta:
model = OrgMember
class OrgType(DjangoObjectType):
class Meta:
model = Org
class CreateAccountMutation(DjangoCreateMutation):
class Meta:
model = Account
class CreateOrgMemberMutation(DjangoCreateMutation):
class Meta:
model = OrgMember
one_to_one_extras = {"account": {"type": "auto"}}
class CreateOrgMutation(DjangoCreateMutation):
class Meta:
model = Org
one_to_one_extras = {"owner": {"type": "auto"}}
class Mutation(graphene.ObjectType):
create_category = CreateOrgMutation.Field()
I have nested structure of one-to-one fields.
I have the following models:
and the following mutations:
One level deep an ID is required. This would work
Howerever, I would expect that this would work, (which it does not because account requires an ID:
I tried "auto" and "Create..Input". That's seems to make no difference.
What am I missing here? Or could it be a bug?
The text was updated successfully, but these errors were encountered: