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
When an ID type input is not the id of the main object on which the changes are applied and to which Meta.object_type refers to, the type of return ID node is not checked.
raise ValueError(ValueError: Cannot assign "<saleor.product.models.Product(pk=1, name='Test product')>": "Product.product_type" must be a "ProductType" instance.
What did you expect to happen?
We should introduce a solution to allow providing the required type of the provided ID.
E.g. we can introduce our custom ID scalar that will extend graphene.ID scalar with only_type parameter. Then this parameter will be used when fetching the nodes.
Logs
No response
Environment
Saleor version: all
OS and version: -
The text was updated successfully, but these errors were encountered:
What are you trying to achieve?
When an
ID
type input is not theid
of the main object on which the changes are applied and to whichMeta.object_type
refers to, the type of returnID
node is not checked.Examples:
product
onProductVariantCreateInput
productType
onProductCreateInput
That's only two but we can find plenty of them.
In such a scenario when an object of a different type is provided, the unhandled error is raised.
Related issue: #13698
Steps to reproduce the problem
createProdduct
mutation with theproduct id
provided asproductType
:What did you expect to happen?
We should introduce a solution to allow providing the required type of the provided
ID
.E.g. we can introduce our custom
ID
scalar that will extendgraphene.ID
scalar withonly_type
parameter. Then this parameter will be used when fetching the nodes.Logs
No response
Environment
Saleor version: all
OS and version: -
The text was updated successfully, but these errors were encountered: