Skip to content

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

Open
@m2-assistant

Description

@m2-assistant

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Reported on 2.4.xIndicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @engcom-Bravo@engcom-Hotel

      Issue actions

        [Issue] [Graphql] applied_to must exist on an orderItem · Issue #39782 · magento/magento2