QuestionQ17

VerifiedTroubleshoot to identify the root cause of issues with Adobe Commerce

An external system integrates product-catalog search functionality by using the Adobe Commerce GraphQL API. An Architect creates a new my_attribute attribute in the Admin panel with the frontend type select.

Later, the Architect finds that ProductInterface already includes the my_attribute field, but it returns an Int value. The Architect wants this field to use a new type that contains both the option ID and label.

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

Question Image

After running the setup:upgrade command, introspection still shows the ProductInterface field my_attribute as Int.

What prevented the value type of the my_attribute field from changing?

Explanation

CatalogGraphQl dynamically processes product EAV attributes when assembling the GraphQL schema. If a declared ProductInterface field matches a product attribute, its GraphQL scalar type is determined from that attribute’s EAV backend_type. A select product attribute is stored with an integer backend type, so the dynamically generated field remains Int despite the custom field declaration and resolver.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!