Closed coderanger closed 1 year ago
Hey @coderanger ,
Hrm, I'm trying to understand your modeling there. Is it a OneToOne
to the same item (self)? Because your are querying both the foreignkey and the related item in the same object.
Btw, which django version are you using?
Django 4.2.2 just got released today, and one of the fixes is this: https://code.djangoproject.com/ticket/34612
I'm wondering if it has anything to do with the issue
Yes, sorry it's a self-referencing field https://github.com/coderanger/farmrpg-etl2/blob/06920220df55376277462749b82bf046994a0dca/items/models.py#L39-L45 . I switched it to a FK since that works and it's easy enough to add a ...[0]
in the client code but it used to be a OneToOne instead.
It's 4.2 right now, will give the new release a try and report back.
@coderanger please tell me if 4.2.2 fixed the issue for you, so we can close this issue. Otherwise I'll need to investigate what might be going on here =P
Apologies, got distracted. I tried it just now and it appears to work with 4.2.2 so I think we can close this out as a Django bug. If I find a new way to trigger it, I'll reopen :)
DB Model:
GraphQL Model:
Query:
Error:
It works fine if only one direction or the other is in the query. And it works with ForeignKeys in the same kind of configuration.