Skip to content

Empty data on order items via createOrder mutation #946

@kermage

Description

@kermage

Describe the bug
This happens when lineItems are only supplied with the productId.

Image

To Reproduce

mutation {
  createOrder(input: {
    lineItems: [
      {
        productId: 1
      },
      {
        productId: 3
      }
    ]
  }) {
    orderId
  }
}

Expected behavior
Ideally, it should automatically get and set data from the specified IDs: name, price, and total. If not, stop creating the order; throw an error if they were actually required.

Plugin Versions

  • WooGraphQL Version: 0.21.2
  • WPGraphQL Version: 2.3.3
  • WordPress Version: 6.8.2
  • WooCommerce Version: 10.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions