Class AbstractRetriever
- java.lang.Object
-
- com.adobe.cq.commerce.core.components.models.retriever.AbstractRetriever
-
- Direct Known Subclasses:
AbstractCategoriesRetriever
,AbstractCategoryRetriever
,AbstractProductRetriever
,AbstractProductsRetriever
,BreadcrumbRetriever
public abstract class AbstractRetriever extends Object
Abstract implementation of retriever that fetches data using GraphQL.
-
-
Field Summary
Fields Modifier and Type Field Description protected MagentoGraphqlClient
client
Instance of the Magento GraphQL client.protected String
query
Generated or fully customized query.
-
Constructor Summary
Constructors Constructor Description AbstractRetriever(MagentoGraphqlClient client)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract com.adobe.cq.commerce.graphql.client.GraphqlResponse<com.adobe.cq.commerce.magento.graphql.Query,com.adobe.cq.commerce.magento.graphql.gson.Error>
executeQuery()
Execute the GraphQL query with the GraphQL client.protected abstract void
populate()
Executes the query and parses the response.void
setQuery(String query)
Replace the query with your own fully customized query.
-
-
-
Field Detail
-
query
protected String query
Generated or fully customized query.
-
client
protected MagentoGraphqlClient client
Instance of the Magento GraphQL client.
-
-
Constructor Detail
-
AbstractRetriever
public AbstractRetriever(MagentoGraphqlClient client)
-
-
Method Detail
-
setQuery
public void setQuery(String query)
Replace the query with your own fully customized query.- Parameters:
query
- GraphQL query
-
populate
protected abstract void populate()
Executes the query and parses the response.
-
executeQuery
protected abstract com.adobe.cq.commerce.graphql.client.GraphqlResponse<com.adobe.cq.commerce.magento.graphql.Query,com.adobe.cq.commerce.magento.graphql.gson.Error> executeQuery()
Execute the GraphQL query with the GraphQL client.- Returns:
- GraphqlResponse object
-
-