ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 9 - AD0-E722 discussion

Report
Export

An existing Adobe Commerce website is moving to a headless implementation.

The existing website features an 'All Brands'' page, as well as individual pages for each brand. All brand-related pages are cached in Varnish using tags in the same manner as products and categories.

Two new GraphQL queries have been created to make this information available to the frontend for the new headless implementation:

During testing, the queries sometimes return out-of-date information. How should this problem be solved while maintaining performance?

A.
Specify a @cacgecacheable(cacheable: false) directive for each GraphQL query, making sure that the data returned is not cached, and is up to date
Answers
A.
Specify a @cacgecacheable(cacheable: false) directive for each GraphQL query, making sure that the data returned is not cached, and is up to date
B.
Specify a $cache(cacheidentity: Path\\To\\identityclass) directive for each GraphQL query, corresponding to a class that adds cache tags for relevant brands and associated products
Answers
B.
Specify a $cache(cacheidentity: Path\\To\\identityclass) directive for each GraphQL query, corresponding to a class that adds cache tags for relevant brands and associated products
C.
Each GraphQL query's resolver class should inject \Magento\GraphQlcache\Model\cacheableQuery and call setcachevalidity(true) on it as part of the resolver's resolve function.
Answers
C.
Each GraphQL query's resolver class should inject \Magento\GraphQlcache\Model\cacheableQuery and call setcachevalidity(true) on it as part of the resolver's resolve function.
Suggested answer: B

Explanation:

This solution ensures that the data returned by the GraphQL queries is up to date, while also maintaining performance. By specifying a $cache(cacheidentity: Path\To\identityclass) directive for each GraphQL query, the relevant brands and associated products will be added as cache tags.

asked 02/10/2024
PATRICK ADUSEI
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first