PlaceOrderOutput.errors is nullable since Magento 2.4.9 - #2655
Closed
paales wants to merge 1 commit into
Closed
Conversation
…2.4.9 Magento 2.4.9 / MageOS 3.2.0 relaxed PlaceOrderOutput.errors from [PlaceOrderError]! to [PlaceOrderError] and returns null on a successfully placed order. A mesh built for magentoVersion < 249 still declared the field non-null, so every successful placeOrder against a 2.4.9 backend failed with 'Cannot return null for non-nullable field PlaceOrderOutput.errors.' Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 64fd234 The changes in this PR will be included in the next version bump. This PR includes changesets to release 86 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
|
SLOP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Magento 2.4.9 / MageOS 3.2.0 relaxed
PlaceOrderOutput.errorsfrom[PlaceOrderError]!to[PlaceOrderError]and the resolver now returnsnullwhen the order is placed successfully (see the schema diff: ho-nl/magento2-graphql-versions@2.4.8...2.4.9#diff-efc1675187620595b0844197a25c35eac9b6df752f9182e5cffddee6f27a8489L8943-R9032).A mesh whose unified schema still declares the field non-null (introspected from an older backend, or any
magentoVersion< 249 setup) then fails every successful order at the gateway with:while the order is placed in Magento — the customer just sees a generic payment error.
Fix
Add
packages/magento-graphql/schema-249/PlaceOrderOutput.graphqlsredeclaringerrorsas nullable. Theschema-249additionalTypeDefs are applied for every project withmagentoVersion< 249, so the unified schema always carries the loosest contract across supported Magento versions:magentoVersion: 248: mesh no longer bombs onerrors: null(this was the bug).magentoVersion: 249: typedef not applied; live introspection is already nullable.Verified that stitching merges a partial type redefinition as expected:
errorsbecomes nullable whileorder/orderV2and the rest of the introspected type are preserved. Client code (assertOrderPlaced,PaymentMethodPlaceOrderNoop) already handleserrors: null.🤖 Generated with Claude Code