SalesforceCommerceCloud / sfcc-sample-apps

Salesforce Commerce Cloud Sample Apps
BSD 3-Clause "New" or "Revised" License
122 stars 69 forks source link

Updates to componentExtension.md #215

Closed jorgehernandezSF closed 4 years ago

jorgehernandezSF commented 4 years ago

Hello dear devs, I'm presenting a workshop on May 14, and would love to use this documentation as an exercise for attendees to do on their own. I'm going to list some areas that are not clear, in the hope that one of the contributors can modify this great example with the latest code. I'll match the instructions from the file here:

  1. It seems to me that storefront-lwc/app/productDetailExtension.js. It should be in a different place based on where this type of code appears in @sfcc-bff/productdetailextensionapi/src/productDetailExtension.js
  2. The code should probably be similar to what appears in productapi.js: New TypeDefs and Resolvers identified (or should we just add a new typedef and resolver for productDetailsRecommendations?) core.registerExtension(API_EXTENSIONS_KEY, function() { return new productDetailExtension(core); });
  3. There should be a path to this TypeDef inside the @sfcc-bff.
  4. Not sure where this code resides: seems like it should be in the storefront-lwc layer.
  5. If we do steps 1-3 in the BFF, then the code in this step becomes: import '@sfcc-bff/productdetailextensionapi if we make the productdetailextension just a new TypeDef and Resolver inside productapi, then we don't need to add it as an extension.
  6. The current code does not use adaptors, so this code should move to a gqlQuery.js file.
  7. Seems to me we should invoke a commerce-recommendations lwc component that would be created as part of this exercise. But I could be missing a simpler solution here.

Thanks, Jorge

jbegleiter-sf commented 4 years ago

Hey @jorgehernandezSF ,

Let's take this one offline if it is still an issue.

Cheers, Josh

jorgehernandezSF commented 4 years ago

@jbegleiter-sf, this issues was taken care of with the refactoring that happened before GA. Thanks!