AD0-E716 · Question #45
An Adobe Commerce developer is creating a new module to extend the functionality of the cart. The module is installed in app/code/CompanyName/ModuleName/. How would an Adobe Commerce developer…
The correct answer is B. Option B. The developer can extend the existing CartltemPrices GraphQL schema to include a custom base_price field by adding the following code to the module's etc/schema.graphqls file: extend type CartltemPrices { base_price: Money! @doc(description: "The base price of the cart This…
Question
An Adobe Commerce developer is creating a new module to extend the functionality of the cart. The module is installed in app/code/CompanyName/ModuleName/. How would an Adobe Commerce developer extend the existing CartltemPrices GraphQL schema to
Exhibit
Options
- AOption A
- BOption B
- COption C
How the community answered
(41 responses)- A10% (4)
- B73% (30)
- C17% (7)
Explanation
The developer can extend the existing CartltemPrices GraphQL schema to include a custom base_price field by adding the following code to the module's etc/schema.graphqls file: extend type CartltemPrices { base_price: Money! @doc(description: "The base price of the cart This code adds a new field called base_price to the CartltemPrices type and specifies that it is of type Money and it is not nullable. The @doc directive adds a description for the field that will be shown in the schema documentation. The developer also needs to create a custom resolver class for the base_price field and declare it in the di.xml file of the module. Verified Reference: [Magento 2.4 DevDocs] [Magento Stack Exchange]
Topics
Community Discussion
No community discussion yet for this question.
