Open
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
Type
Projects
Status
Ready for Development
Activity
m2-assistant commentedon Jun 5, 2025
Hi @zakdma. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.
@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
m2-assistant commentedon Jun 5, 2025
Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branchDetails
- If the issue is reproducible on2.4-develop
branch, please, add the labelReproduced on 2.4.x
.- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
Issue: Confirmed
once verification is complete.zakdma commentedon Jun 5, 2025
Related issues
engcom-Bravo commentedon Jun 5, 2025
Hi @zakdma,
Thanks for your reporting and collaboration.
Can we close one of the issue looks like both are similar can you please confirm.
Thanks.
zakdma commentedon Jun 5, 2025
Hey, @engcom-Bravo
Please do not close any, they are different issues, but regarding the same functionality.
engcom-Bravo commentedon Jun 6, 2025
Hi @zakdma,
Thanks for your Update.
We have tried to reproduce the issue in Latest 2.4-develop instance and we are able to reproduce the issue.Kindly refer the screenshots.
There is an error: "discount_model" value should be specified
Hence Confirming the issue.
Thanks.
github-jira-sync-bot commentedon Jun 6, 2025
✅ Jira issue https://jira.corp.adobe.com/browse/AC-14889 is successfully created for this GitHub issue.
m2-assistant commentedon Jun 6, 2025
✅ Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.