Free AD0-E718 Exam Braindumps (page: 3)

Page 2 of 13

An Adobe Commerce Architect is creating a new GraphQL API mutation to alter the process of adding configurable products to the cart. The mutation accepts configurable product ID. If the given product has only one variant, then the mutation should add this variant to the cart and return not nullable cart type. If the configurable product has more variants, then the mutation should return not nullable conf igurableProduct type.
The mutation declaration looks as follows:



How should the Adobe Commerce Architect declare output of this mutation?

A)



B)



C)

  1. Option A
  2. Option B
  3. Option C

Answer(s): C

Explanation:

According to the Adobe Commerce Developer Guide2, a union type is a special kind of object that can be one of several types. It is useful for returning disjoint data types from a single field. In this case, the output of the mutation can be either Cart or ConfigurableProduct, depending on the number of variants of the given product. Therefore, a union type should be declared for the output of this mutation, as shown in option C. The other options are not valid syntax for union types.



An Adobe Commerce Architect needs to create a new customer segment condition to enable admins to specify an 'Average sales amount' condition for certain segments.
The Architect develops the custom condition under vendor\Module\Model\Segment\condition\AverageSalesAmount with all of its requirements:



During testing, the following error appears:



Which two steps should the Architect complete to fix the problem? (Choose two.) A)



B)



C)



D)



E)

  1. Option A
  2. Option B
  3. Option C
  4. Option D
  5. Option E

Answer(s): B,E

Explanation:

According to the Adobe Commerce Developer Guide1, to create a new customer segment condition, the custom condition class must implement the
Magento\CustomerSegment\Model\Segment\Condition\Combine\Interface interface. The class must also have a constructor that accepts an array of data and a context object that contains the required dependencies. Therefore, option B is correct because the constructor is missing the context object parameter. Option E is also correct because the class does not implement the required interface. The other options are not relevant for this problem.



An Architect working on a headless Adobe Commerce project creates a new customer attribute named my_attribure. Based on the attribute value of the customer, the results of GraphQI queries are modified using a plugin. The frontend application is communicating with Adobe Commerce through Varnish by Fastly, which is already caching the queries that will be modified. The Adobe Commerce Fastly extension is installed, and no other modifications are made to the application.
Which steps should the Architect take to make sure the vcl_hash function of Varnish also considers the newly created attribute?
A)



B)



C)

  1. Option A
  2. Option B
  3. Option C

Answer(s): B

Explanation:

Option B is the correct way to make sure the vcl_hash function of Varnish also considers the newly created attribute. The Architect should create a new module that depends on Magento_Fastly and declare a plugin for \Magento\Fastly\Model\Config::getVclSnippets() method. The plugin should add a new snippet to the result array with the type `recv' and the content `set req.http.my_attribute = req.http.X-Magento-Vary;'. This will append the value of the customer attribute to the hash key used by Varnish for caching. Option A is incorrect because it modifies the core file of Magento_Fastly module, which is not recommended and can cause issues during upgrades. Option C is incorrect because it uses the wrong type and content for the snippet, which will not affect the vcl_hash function.


Reference:

https://devdocs.magento.com/cloud/cdn/fastly-vcl-bypass-to-origin.html According to the Adobe Commerce Developer Guide2, to make sure the vcl_hash function of Varnish also considers the newly created attribute, the Architect should use a plugin for Magento\Customer\Model\Context::getVaryString method and add the attribute value to the vary string. This will ensure that Varnish caches different versions of GraphQL queries based on the attribute value of the customer. Therefore, option B is correct. Option A is not correct because it does not affect the vcl_hash function. Option C is not correct because it does not use a plugin for the getVaryString method.



A company has an Adobe Commerce store. An attribute named "my.attribute" (type "text") is created to save each product's global ID that is shared between multiple systems.

Several months after going live, the values of "my.attribute" are all integer. This causes a problem for the other systems when those systems receive this data. An Adobe Commerce Architect needs to recommend a solution to change the type of "my.attribute" from textXo int
Which two steps should the Architect take to achieve this? (Choose two.)

  1. Migrate data from table "catalog_product_entity_text" to "catalog.producLentityjnt" for the attribute.id
  2. Go to Admin > Stores > Attributes > Product, edit "my.attribute" and update type from "text' to "inf
  3. Write a plugin for \Magento\Eav\Model\Entity\Attrlbute\Backend\AbstractBackend::afterLoad() and load data from "catalog_product_entity_int"
  4. Create a Data Patch and update 'my.attribute' type from "text" to "inf
  5. Run the Command bin/magentc indexer: reset catalog_product_attribute

Answer(s): A,D

Explanation:

Option A is correct because it will migrate data from one table to another based on the attribute id, which is required when changing the attribute type14. Option D is correct because it will create a data patch that will update `my.attribute' type from "text" to "int", which is a recommended way of changing the attribute type programmatically4.
To change the type of "my.attribute" from text to int, the Architect should take two steps: A) Migrate data from table "catalog_product_entity_text" to "catalog_product_entity_int" for the attribute_id. This step will move the existing values of the attribute from the text table to the int table, which corresponds to the new type. D) Create a Data Patch and update `my.attribute' type from "text" to "int". This step will update the attribute metadata in the database and reflect the new type. Option B is incorrect because the Admin panel does not allow changing the type of an existing attribute.
Option C is incorrect because writing a plugin for
\Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend::afterLoad() will not change the type of the attribute, but only load data from a different table. Option E is incorrect because running the command bin/magento indexer:reset catalog_product_attribute will not change the type of the attribute, but only reset the indexer status.


Reference:

https://devdocs.magento.com/guides/v2.4/extension-dev-guide/attributes.html






Post your Comments and Discuss Adobe AD0-E718 exam with other Community members:

AD0-E718 Discussions & Posts