Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #25 from solocommand/content-related-content-site
Browse files Browse the repository at this point in the history
  • Loading branch information
zarathustra323 authored Feb 18, 2021
2 parents 6ea0718 + 00ce218 commit ae29869
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ query ContentForLeadersSection(
teaser(input: { maxLength: 0 })
website
promotions: relatedContent(input: {
withSite: false,
queryTypes: [company],
includeContentTypes: [Promotion],
pagination: { limit: $promotionLimit },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ input RelatedPublishedContentQueryInput {
}
input ContentRelatedContentInput {
withSite: Boolean = true
siteId: ObjectID
excludeContentTypes: [ContentType!] = []
includeContentTypes: [ContentType!] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,15 +498,14 @@ module.exports = {
relatedContent: (doc, { input }, { basedb, site }, info) => {
const {
queryTypes,
withSite,
} = input;
// If no query types were specified (owned, inverse, etc), return an empty response.
if (!queryTypes.length) return BaseDB.paginateEmpty();

const siteId = input.siteId || site.id();

// Run perform the related content query.
return relatedContent.performQuery(doc, {
siteId,
...(withSite && { siteId: input.siteId || site.id() }),
input,
basedb,
info,
Expand Down

0 comments on commit ae29869

Please sign in to comment.