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
The mutate_object method of the LettercraftMutation (for handling mutation requests to the backend) has separate handlers for relational fields. The method decides on the handler by checking field.many_to_many and field.many_to_one:
This does not account for the OneToOneField - this is also a relational field, but it is not many_to_many or many_to_one, so it won't be handled properly and the mutation will return an error.
A OneToOneField is essentially a ForeignKey with a uniqueness requirement. I think you could just use the handler for ForeignKey fields here. In that case, you could just adjust this tree as follows:
The
mutate_object
method of theLettercraftMutation
(for handling mutation requests to the backend) has separate handlers for relational fields. The method decides on the handler by checkingfield.many_to_many
andfield.many_to_one
:lettercraft/backend/graphql_app/LettercraftMutation.py
Lines 110 to 115 in dd3fb51
This does not account for the OneToOneField - this is also a relational field, but it is not
many_to_many
ormany_to_one
, so it won't be handled properly and the mutation will return an error.A OneToOneField is essentially a ForeignKey with a uniqueness requirement. I think you could just use the handler for ForeignKey fields here. In that case, you could just adjust this tree as follows:
I didn't test this yet, however.
The text was updated successfully, but these errors were encountered: