Skip to content

[Issue] [Graphql] applied_to must exist on an orderItem #39782

New issue

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

Open
2 of 5 tasks
m2-assistant bot opened this issue Apr 1, 2025 · 0 comments · May be fixed by #39772
Open
2 of 5 tasks

[Issue] [Graphql] applied_to must exist on an orderItem #39782

m2-assistant bot opened this issue Apr 1, 2025 · 0 comments · May be fixed by #39772
Labels
Reported on 2.4.x Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@m2-assistant
Copy link

m2-assistant bot commented Apr 1, 2025

This issue is automatically created based on existing pull request: #39772: [Graphql] applied_to must exist on an orderItem


Description (*)

Due to

applied_to: CartDiscountType! @doc(description:"The type of the entity the discount is applied to.")
discount being used in order_item applied_to MUST be present if a discount is present.

Because this is missing errors will be thrown once the applied_to is missing. There are 2 ways to fix this. Remove the not null requirement on applied_to or adding the applied_to on the order item as well.
I believe adding it to the order item could result in more consistent frontend as we keep the data between cart item and order item te same.

Manual testing scenarios (*)

Create/fetch an order using Graphql that has orderitems with discounts, make sure to get the discounts and applied_to (as defined by the graphql schema).
You will see the following error
image

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
@m2-assistant m2-assistant bot linked a pull request Apr 1, 2025 that will close this issue
6 tasks
@engcom-Hotel engcom-Hotel added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Apr 1, 2025
@engcom-Bravo engcom-Bravo added the Reported on 2.4.x Indicates original Magento version for the Issue report. label Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reported on 2.4.x Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants