Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make Sitemap data available via GraphQL query #4927

Merged
merged 4 commits into from Jan 24, 2019

Conversation

Projects
None yet
3 participants
@impactmass
Copy link
Member

commented Jan 18, 2019

Resolves #4796
Impact: major
Type: feature

To be tested along with reactioncommerce/reaction-next-starterkit#488

Issue

#4796
The sitemaps are generated in the core API app (ie. the reaction service), and currently available on the API domain/url. We need to make the sitemap information available through GraphQL so standalone storefronts can use it.

Solution

Details

  • The query takes 2 params: handle and shopUrl. The handle is a string used when the sitemap was created. It can have values like sitemap.xml, sitemap-tags-1.xml.
  • Sitemaps are saved with the shopId they belong to. Storefront apps like starkerkit get shopId value later on in the rendering process. To get sitemap information without depending on the rendering process, the shopUrl is passed as param.
  • The shopUrl is confirmed in the GQL implementation to ensure the domain requested is for a known shop domain Shops.findOne({ domains: domain })
  • The shopUrl param is also used to replace the xml placeholder: sitemap.xml.replace(/BASE_URL/g, shopUrl)

Testing

[ @kieckhafer as the primary reviewer. @dancastellon I added you to take a pass based on the fact that you worked previously on sitemap. ]

impactmass added some commits Jan 22, 2019

fix: fix Typo
Signed-off-by: Seun Martins <seundotme@gmail.com>
feat: Setup GQL query for retrieving sitemaps
Signed-off-by: Seun Martins <seundotme@gmail.com>

@impactmass impactmass force-pushed the feat-4796-impactmass-sitemap-query branch from 81be91f to 732eb84 Jan 22, 2019

@impactmass impactmass changed the title WIP 4796 Add Sitemap data GQL query feat: Make Sitemap data available via GraphQL query Jan 22, 2019

@impactmass impactmass requested review from dancastellon and kieckhafer Jan 22, 2019

fix: formatting fix
Signed-off-by: Erik Kieckhafer <ek@ato.la>

@kieckhafer kieckhafer force-pushed the feat-4796-impactmass-sitemap-query branch from 9b1cbbe to 147143d Jan 23, 2019

@kieckhafer
Copy link
Member

left a comment

Works as described. IMO can be merged once @dancastellon takes a look.

Make handle and xml field required
Signed-off-by: Seun Martins <seundotme@gmail.com>

@impactmass impactmass force-pushed the feat-4796-impactmass-sitemap-query branch from 7d9f183 to dd7b7f7 Jan 24, 2019

@dancastellon
Copy link
Contributor

left a comment

Looks good!

@impactmass impactmass merged commit c58d8ce into develop Jan 24, 2019

4 of 5 checks passed

License Compliance FOSSA is analyzing this commit
Details
DCO DCO
Details
WIP ready for review
Details
build_and_test Workflow: build_and_test
Details
security/snyk - package.json (Reaction Commerce) No new issues
Details

@impactmass impactmass deleted the feat-4796-impactmass-sitemap-query branch Jan 24, 2019

@jeffcorpuz jeffcorpuz referenced this pull request Mar 1, 2019

Merged

Release v2.0.0 rc.10 #5016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.