ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 13 - AD0-E722 discussion

Report
Export

An external system integrates functionality of a product catalog search using Adobe Commerce GraphQL API. The Architect creates a new attribute my_attribute in the admin panel with frontend type select-Later, the Architect sees that Productlnterf ace already has the field my_attribute, but returns an Int value. The Architect wants this field to be a new type that contains both option id and label.

To meet this requirement, an Adobe Commerce Architect creates a new module and file etc/schema.graphqls that declares as follows:

After calling command setup:upgrade, the introspection of Productlnterface field my_attribute remains Int. What prevented the value type of field my_attribute from changing?

A.
The Magento_CatalogGraphQI module occurs later in sequence than the Magento_GraphQI module and merging output of dynamic attributes schema reader overrides types declared in schema.graphqls
Answers
A.
The Magento_CatalogGraphQI module occurs later in sequence than the Magento_GraphQI module and merging output of dynamic attributes schema reader overrides types declared in schema.graphqls
B.
The fields of Productlnterface are checked during processing schema.graphqls files. If they have a corresponding attribute, then the backendjype of product attribute is set for field type.
Answers
B.
The fields of Productlnterface are checked during processing schema.graphqls files. If they have a corresponding attribute, then the backendjype of product attribute is set for field type.
C.
The interface Productlnterface is already declared in Magento.CatalogGraphQI module. Extending requires use of the keyword extend before a new declaration of Productlnterface.
Answers
C.
The interface Productlnterface is already declared in Magento.CatalogGraphQI module. Extending requires use of the keyword extend before a new declaration of Productlnterface.
Suggested answer: C

Explanation:

According to the Adobe Commerce documentation, to extend an existing GraphQL interface, the keyword extend must be used before the interface name. This indicates that the new declaration is adding or modifying fields to the existing interface, rather than redefining it. If the keyword extend is omitted, the new declaration will be ignored and the original interface will be used. In this case, the Architect wants to change the type of the my_attribute field in the ProductInterface interface, which is already declared in the Magento.CatalogGraphQl module. Therefore, the Architect should use the keyword extend before declaring the ProductInterface interface in the schema.graphqls file of the custom module. This will allow the Architect to override the type of the my_attribute field from Int to MyAttributeType.

Extend existing schema | Adobe Commerce Developer Guide

Schema language with GraphQL | Adobe Commerce

asked 02/10/2024
Waleed Bahadaq
40 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first