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
{{ message }}
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.
Deeply nested create mutation is not working for the case where I have 3 models A, B, C.
The issue is in the field of Model B which is ManyToOneRel with Model C
Here is the use case:
Model A -> OneToOne Model B -> ManyToOneRel -> Model C
Model A => ProjectFinance
Model B => Transaction
Model C => TransactionLine
I get the error when making a deeply nested create mutation on Model A including nested Model B and Model C
But i get a successfull mutation when making deeply nested create mutation on Model B including Model C
here is the stack trace
File "/home/iroume/prj/prj/venv/lib/python3.11/site-packages/strawberry/extensions/base_extension.py", line 46, in resolve
return _next(root, info, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/iroume/prj/prj/venv/lib/python3.11/site-packages/strawberry_django_plus/directives.py", line 119, in resolve
return _next(root, info, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/iroume/prj/prj/venv/lib/python3.11/site-packages/strawberry/schema/schema_converter.py", line 564, in _resolver
return _get_result_with_extensions(_source, strawberry_info, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/iroume/prj/prj/venv/lib/python3.11/site-packages/strawberry/schema/schema_converter.py", line 538, in _get_result
return field.get_result(
^^^^^^^^^^^^^^^^^
File "/home/iroume/prj/prj/venv/lib/python3.11/site-packages/strawberry/field.py", line 178, in get_result
return self.base_resolver(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/iroume/prj/prj/venv/lib/python3.11/site-packages/strawberry/types/fields/resolver.py", line 187, in call
return self.wrapped_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/iroume/prj/prj/ast_mgr/backend/api/gql/mutations/init.py", line 1531, in projectfinance
return resolvers.create(info, ProjectFinance, resolvers.parse_input(info, data))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "/home/iroume/prj/prj/venv/lib/python3.11/site-packages/strawberry_django_plus/mutations/resolvers.py", line 218, in create
return update(info, model(), data, full_clean=full_clean)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "/home/iroume/prj/prj/venv/lib/python3.11/site-packages/strawberry_django_plus/mutations/resolvers.py", line 307, in update
value = field.related_model._default_manager.create(**value_data) # noqa: PLW2901
I think the issue is on the line
strawberry-django-plus/strawberry_django_plus/mutations/resolvers.py
Line 297 in 5e6b605
It should be a recursive call on create(...) instead of manager.create
The text was updated successfully, but these errors were encountered: