Skip to content

[Issue] Fixed customerOrders GraphQL queries containing sub-resolvers requiring 'model' #36829

Closed
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #33805: Fixed customerOrders GraphQL queries containing sub-resolvers requiring 'model'


Description (*)

This PR fixes the customerOrders GraphQL query containing arguments that require $value['model'] to be filled with the order object. Although the query itself is deprecated already and the data can be retrieved by a customer query (which works well) with appropriate arguments, I think that we should support customerOrders for as long as it's not removed from the codebase.

Related Pull Requests

Fixed Issues (if relevant)

Manual testing scenarios (*)

  1. Register a customer and place an order in the admin panel for that customer
  2. Generate an invoice for that order
  3. Use the following GraphQL mutation to generate the customer token:
mutation {
  generateCustomerToken(
    email: "your.customer@email.here"
    password: "your-password"
  ) {
    token
  }
}
  1. Use the token from from the previous mutation to authorize the following query:
query {
  customerOrders {
    items {
      order_number
      grand_total
      status
      invoices {
          id
          items {
              id
              discounts {
                  amount {
                    value
                  }
              }
          }
      }
    }
  }
}

This will trigger the faulty behavior.

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)
  • 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)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions