We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to have the same way of handling incorrect parameter id in promotion mutations
promotionRuleCreate
{ "errors": [ { "message": "Cannot assign \"<PromotionRule: PromotionRule object (a798c8a6-6c57-4688-9fd9-682853f58f2a)>\": \"PromotionRule.promotion\" must be a \"Promotion\" instance.", "locations": [ { "line": 2, "column": 3 } ], "path": [ "promotionRuleCreate" ], "extensions": { "exception": { "code": "ValueError", "stacktrace": [ "Traceback (most recent call last):", " File \"/usr/local/lib/python3.9/site-packages/graphql/execution/executor.py\", line 452, in resolve_or_error", " return executor.execute(resolve_fn, source, info, **args)", " File \"/usr/local/lib/python3.9/site-packages/graphql/execution/executors/sync.py\", line 16, in execute", " return fn(*args, **kwargs)", " File \"/app/saleor/graphql/core/mutations.py\", line 536, in mutate", " response = cls.perform_mutation(root, info, **data)", " File \"/app/saleor/graphql/core/mutations.py\", line 809, in perform_mutation", " instance = cls.construct_instance(instance, cleaned_input)", " File \"/app/saleor/graphql/core/mutations.py\", line 502, in construct_instance", " f.save_form_data(instance, data)", " File \"/usr/local/lib/python3.9/site-packages/django/db/models/fields/__init__.py\", line 910, in save_form_data", " setattr(instance, self.name, data)", " File \"/usr/local/lib/python3.9/site-packages/django/db/models/fields/related_descriptors.py\", line 215, in __set__", " raise ValueError(", "ValueError: Cannot assign \"<PromotionRule: PromotionRule object (a798c8a6-6c57-4688-9fd9-682853f58f2a)>\": \"PromotionRule.promotion\" must be a \"Promotion\" instance." ] } } } ], "data": { "promotionRuleCreate": null }, "extensions": { "cost": { "requestedQueryCost": 0, "maximumAvailable": 50000 } } }
In promotionUpdate mutation when I pass the promotion rule Id instead of the promotion Id I get GRAPHQL_ERROR
promotionUpdate
{ "data": { "promotionUpdate": { "errors": [ { "field": "id", "message": "Must receive a Promotion id.", "code": "GRAPHQL_ERROR" } ], "promotion": null } },
The same error can be displayed for promotionRuleCreate
No response
Saleor version: branch feature/promotion-rules-crud OS and version: …
feature/promotion-rules-crud
The text was updated successfully, but these errors were encountered:
It turns out that it's a global problem. I created a separate ticket for that: #15466
Sorry, something went wrong.
No branches or pull requests
What are you trying to achieve?
I want to have the same way of handling incorrect parameter id in promotion mutations
Steps to reproduce the problem
promotionRuleCreate
Response
What did you expect to happen?
In
promotionUpdate
mutation when I pass the promotion rule Id instead of the promotion Id I get GRAPHQL_ERRORThe same error can be displayed for promotionRuleCreate
Logs
No response
Environment
Saleor version: branch
feature/promotion-rules-crud
OS and version: …
The text was updated successfully, but these errors were encountered: