-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Area: PromotionComponent: GraphQLGraphQLGraphQLIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is 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.A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.8Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branch
Description
Preconditions and environment
Magento 2.4.8
Steps to reproduce
- Create a simple product, customer, sales rule with a coupon, and place an order using this customer and applying coupon.
- Get customer token via GraphQL query generateCustomerToken
- Issue GraphQL request
query {
customer {
firstname
lastname
orders {
items {
order_number
status
items {
product_sku
discounts {
coupon {
code
}
amount {
value
}
}
}
}
page_info {
current_page
page_size
total_pages
}
total_count
}
}
}
Expected result
There is a correct response from GraphQl with orders and order items discount data
Actual result
There is an error: "discount_model" value should be specified
exception.log:
[2025-06-05T07:21:43.918952+00:00] main.ERROR: "discount_model" value should be specified
GraphQL (28:13)
27: discounts {
28: coupon {
^
29: code
{"exception":"[object] (GraphQL\\Error\\Error(code: 0): \"discount_model\" value should be specified at /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Error/Error.php:155)
[previous exception] [object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): \"discount_model\" value should be specified at /home/zak/sites/magento/storefront/public/vendor/magento/module-sales-rule-graph-ql/Model/Resolver/Coupon.php:40)"} []
[2025-06-05T07:21:43.919095+00:00] main.ERROR: Magento\Framework\Exception\LocalizedException: "discount_model" value should be specified in /home/zak/sites/magento/storefront/public/vendor/magento/module-sales-rule-graph-ql/Model/Resolver/Coupon.php:40
Stack trace:
#0 /home/zak/sites/magento/storefront/public/vendor/magento/framework/Interception/Interceptor.php(58): Magento\SalesRuleGraphQl\Model\Resolver\Coupon->resolve()
#1 /home/zak/sites/magento/storefront/public/vendor/magento/framework/Interception/Interceptor.php(138): Magento\SalesRuleGraphQl\Model\Resolver\Coupon\Interceptor->___callParent()
#2 /home/zak/sites/magento/storefront/public/vendor/magento/module-graph-ql-resolver-cache/Model/Plugin/Resolver/Cache.php(212): Magento\SalesRuleGraphQl\Model\Resolver\Coupon\Interceptor->Magento\Framework\Interception\{closure}()
#3 /home/zak/sites/magento/storefront/public/vendor/magento/module-graph-ql-resolver-cache/Model/Plugin/Resolver/Cache.php(128): Magento\GraphQlResolverCache\Model\Plugin\Resolver\Cache->executeResolver()
#4 /home/zak/sites/magento/storefront/public/vendor/magento/framework/Interception/Interceptor.php(135): Magento\GraphQlResolverCache\Model\Plugin\Resolver\Cache->aroundResolve()
#5 /home/zak/sites/magento/storefront/public/vendor/magento/framework/Interception/Interceptor.php(153): Magento\SalesRuleGraphQl\Model\Resolver\Coupon\Interceptor->Magento\Framework\Interception\{closure}()
#6 /home/zak/sites/magento/storefront/public/generated/code/Magento/SalesRuleGraphQl/Model/Resolver/Coupon/Interceptor.php(23): Magento\SalesRuleGraphQl\Model\Resolver\Coupon\Interceptor->___callPlugins()
#7 /home/zak/sites/magento/storefront/public/vendor/magento/framework/GraphQl/Query/Resolver/PromiseFactory.php(63): Magento\SalesRuleGraphQl\Model\Resolver\Coupon\Interceptor->resolve()
#8 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(714): Magento\Framework\GraphQl\Query\Resolver\PromiseFactory->Magento\Framework\GraphQl\Query\Resolver\{closure}()
#9 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(631): GraphQL\Executor\ReferenceExecutor->resolveFieldValueOrError()
#10 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1317): GraphQL\Executor\ReferenceExecutor->resolveField()
#11 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1256): GraphQL\Executor\ReferenceExecutor->executeFields()
#12 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1210): GraphQL\Executor\ReferenceExecutor->collectAndExecuteSubfields()
#13 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(893): GraphQL\Executor\ReferenceExecutor->completeObjectValue()
#14 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(753): GraphQL\Executor\ReferenceExecutor->completeValue()
#15 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(985): GraphQL\Executor\ReferenceExecutor->completeValueCatchingError()
#16 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(871): GraphQL\Executor\ReferenceExecutor->completeListValue()
#17 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(753): GraphQL\Executor\ReferenceExecutor->completeValue()
#18 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(640): GraphQL\Executor\ReferenceExecutor->completeValueCatchingError()
#19 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1317): GraphQL\Executor\ReferenceExecutor->resolveField()
#20 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1256): GraphQL\Executor\ReferenceExecutor->executeFields()
#21 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1210): GraphQL\Executor\ReferenceExecutor->collectAndExecuteSubfields()
#22 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(1074): GraphQL\Executor\ReferenceExecutor->completeObjectValue()
#23 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(888): GraphQL\Executor\ReferenceExecutor->completeAbstractValue()
#24 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php(750): GraphQL\Executor\ReferenceExecutor->completeValue()
#25 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php(152): GraphQL\Executor\ReferenceExecutor->GraphQL\Executor\{closure}()
#26 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php(50): GraphQL\Executor\Promise\Adapter\SyncPromise->GraphQL\Executor\Promise\Adapter\{closure}()
#27 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php(144): GraphQL\Executor\Promise\Adapter\SyncPromise::runQueue()
#28 /home/zak/sites/magento/storefront/public/vendor/webonyx/graphql-php/src/GraphQL.php(108): GraphQL\Executor\Promise\Adapter\SyncPromiseAdapter->wait()
#29 /home/zak/sites/magento/storefront/public/vendor/magento/framework/GraphQl/Query/QueryProcessor.php(91): GraphQL\GraphQL::executeQuery()
#30 /home/zak/sites/magento/storefront/public/vendor/magento/module-graph-ql/Controller/GraphQl.php(202): Magento\Framework\GraphQl\Query\QueryProcessor->process()
#31 /home/zak/sites/magento/storefront/public/vendor/magento/framework/Interception/Interceptor.php(58): Magento\GraphQl\Controller\GraphQl->dispatch()
#32 /home/zak/sites/magento/storefront/public/vendor/magento/framework/Interception/Interceptor.php(138): Magento\GraphQl\Controller\GraphQl\Interceptor->___callParent()
#33 /home/zak/sites/magento/storefront/public/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(72): Magento\GraphQl\Controller\GraphQl\Interceptor->Magento\Framework\Interception\{closure}()
#34 /home/zak/sites/magento/storefront/public/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch()
#35 /home/zak/sites/magento/storefront/public/vendor/magento/framework/Interception/Interceptor.php(153): Magento\GraphQl\Controller\GraphQl\Interceptor->Magento\Framework\Interception\{closure}()
#36 /home/zak/sites/magento/storefront/public/generated/code/Magento/GraphQl/Controller/GraphQl/Interceptor.php(23): Magento\GraphQl\Controller\GraphQl\Interceptor->___callPlugins()
#37 /home/zak/sites/magento/storefront/public/vendor/magento/framework/App/Http.php(116): Magento\GraphQl\Controller\GraphQl\Interceptor->dispatch()
#38 /home/zak/sites/magento/storefront/public/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Http->launch()
#39 /home/zak/sites/magento/storefront/public/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\Http\Interceptor->___callParent()
#40 /home/zak/sites/magento/storefront/public/vendor/magento/module-application-performance-monitor/Plugin/ApplicationPerformanceMonitor.php(38): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}()
#41 /home/zak/sites/magento/storefront/public/vendor/magento/framework/Interception/Interceptor.php(135): Magento\ApplicationPerformanceMonitor\Plugin\ApplicationPerformanceMonitor->aroundLaunch()
#42 /home/zak/sites/magento/storefront/public/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}()
#43 /home/zak/sites/magento/storefront/public/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http\Interceptor->___callPlugins()
#44 /home/zak/sites/magento/storefront/public/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#45 /home/zak/sites/magento/storefront/public/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#46 {main} {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): \"discount_model\" value should be specified at /home/zak/sites/magento/storefront/public/vendor/magento/module-sales-rule-graph-ql/Model/Resolver/Coupon.php:40)"} []
Additional information
There is a related bug #39841 that has been fixed. It fixes a similar case, but not this one.
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Area: PromotionComponent: GraphQLGraphQLGraphQLIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is 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.A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.8Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branch
Type
Projects
Status
Ready for Development