Skip to content

[Issue] Ensure that invoice comments are returned when requested by GraphQL queries #31643

@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #31606: Ensure that invoice comments are returned when requested by GraphQL queries


Description (*)

As part of the GraphQL schema for customer orders, invoices can be requested, along with their comments. However, the current implementation does not return any comments for invoices, resulting in a null value always.
This pull request ensures that invoice comments (that are visible in the front-end) are returned when requested in the query.

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. Create a customer order and an associated invoice.
  2. Add a number of comments to an order invoice, including both visible and not visible in the front-end.
  3. Call the customer GraphQL query, requesting orders, invoices and their associated comments - e.g:
query {
    customer {
        orders(filter: { number: { eq: "000000154" } }) {
            items {
                invoices {
                    comments {
                        message
                        timestamp
                    }
                    items {
                        product_name
                    }
                }
            }
        }
    }
}

Expected result:
Invoice comments are retrieved in the graphql response

Actual result:
Invoice comments are not retrieved in the graphql response.

Questions or comments

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)
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Labels

Area: OrderComponent: GraphQLGraphQLComponent: SalesGraphQlIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneProject: GraphQLReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions