Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/place-order-errors-nullable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/magento-graphql': patch
---

Relax `PlaceOrderOutput.errors` to nullable in the unified schema. Magento 2.4.9 / MageOS 3.2.0 changed the field from `[PlaceOrderError]!` to `[PlaceOrderError]` and returns `null` when the order is placed successfully, so a storefront configured with `magentoVersion` < 249 talking to a 2.4.9 backend failed every successful order with `Cannot return null for non-nullable field PlaceOrderOutput.errors.`
12 changes: 12 additions & 0 deletions packages/magento-graphql/schema-249/PlaceOrderOutput.graphqls
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Magento 2.4.9 (and MageOS 3.2.0) relaxed `PlaceOrderOutput.errors` from
# `[PlaceOrderError]!` to `[PlaceOrderError]` and now returns `null` when the
# order is placed successfully. The unified schema must use the nullable
# variant, otherwise the mesh throws "Cannot return null for non-nullable field
# PlaceOrderOutput.errors." on every successful placeOrder once the backend
# runs 2.4.9, while a 2.4.8 backend still satisfies the relaxed contract.
type PlaceOrderOutput {
"""
An array of place order errors. Returns null on success since Magento 2.4.9.
"""
errors: [PlaceOrderError]
}
Loading