Adobe Developers Live 2021, Session | CIF Extensibility via GraphQL | Community
Skip to main content
kautuk_sahni
Community Manager
Community Manager
January 22, 2021

Adobe Developers Live 2021, Session | CIF Extensibility via GraphQL

  • January 22, 2021
  • 2 replies
  • 4117 views

BlogImage.jpg

Session Details

Learn how to extend Commerce core components using GraphQL.

Experience League Session Recording 

Session Schedule

9-Feb, 12:15 PM - 12:45 PM PST

Speaker(s)

Mark J. Becker

Full Schedule

Check Here

Q&A

Please use this thread to ask the question related to this Session. Click here for the session slides.

Session FAQs

Q. can the Magento schema be customized and will the schema be imported into the model as well? Or is customizing Magento schema, not an option? 

A. Yes it can be customized. Especially the product schema part always will be custom, since you use your custom product attribute set. 

Additional customization is possible by custom Magento modules as well. And yes this can be imported and used by CIF. For simple things, this might not be even needed. You can always generate your project-specific model classes and used them in CIF. The generation tool is public on GitHub as well. 

Q. is there a roadmap for future features? 

A. At this point there is no public roadmap available. Feel free to request features on GitHub. 

Q. payment gateways from Magento can it be pulled into AEM for checkout? 

A. Checkout and cart are implemented via client-side components. The components access Magento GraphQL directly. As long as payment gateways are exposed via the GraphQL API, they can be used. 

Q.What's the recommended pattern for customizing the client-side portion of CIF Components? 

A. Logic of the components is exposed via React hooks. You can write a component with a custom markup that uses the component logic via React hooks. 

Don't forget to register yourself for this session using the registration link shared above. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

April 16, 2021

Fantastic post, thank you!

 

Will Banks

Level 3
July 19, 2021
Level 3
July 19, 2021

It appears this is the new url for the page,

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content-and-commerce/storefront/developing/customize-cif-components.html?lang=en

 

 

//MyProductTeaserImpl.java

private static final String ECO_FRIENDLY_ATTRIBUTE = "eco_friendly";

@PostConstruct
public void initModel() {
    productRetriever = productTeaser.getProductRetriever();

    if (productRetriever != null) {
        productRetriever.extendProductQueryWith(p ->
             productRetriever.extendProductQueryWith(p -> p
                .createdAt()
                .addCustomSimpleField(ECO_FRIENDLY_ATTRIBUTE)
            );
        );
    }
}

 

 

However, the example will not compile.  Does not like this code in step 5

 Also, the complilation instructions are wrong since there is no autoInstallPackage profile, should be autoInstallSinglePackage

$ cd aem-cif-guides-venia/
$ mvn clean install -PautoInstallPackage,cloud

 

Adobe Employee
July 20, 2021

You can use the following piece of code:

 

private static final String ECO_FRIENDLY_ATTRIBUTE = "eco_friendly";

@PostConstruct
public void initModel() {
    productRetriever = productTeaser.getProductRetriever();

    if (productRetriever != null) {
        productRetriever.extendProductQueryWith(p -> p
            .createdAt()
            .addCustomSimpleField(ECO_FRIENDLY_ATTRIBUTE)
        );
    }
}