diff --git a/packages/sitecore-jss-nextjs/src/services/base-graphql-sitemap-service.ts b/packages/sitecore-jss-nextjs/src/services/base-graphql-sitemap-service.ts index 61b1fec4fe..089b901f7c 100644 --- a/packages/sitecore-jss-nextjs/src/services/base-graphql-sitemap-service.ts +++ b/packages/sitecore-jss-nextjs/src/services/base-graphql-sitemap-service.ts @@ -27,7 +27,7 @@ query ${usesPersonalize ? 'PersonalizeSitemapQuery' : 'DefaultSitemapQuery'}( $language: String! $includedPaths: [String] $excludedPaths: [String] - $pageSize: Int = 10 + $pageSize: Int = 100 $after: String ) { site { @@ -86,7 +86,7 @@ interface SiteRouteQueryVariables { /** common variable for all GraphQL queries * it will be used for every type of query to regulate result batch size * Optional. How many result items to fetch in each GraphQL call. This is needed for pagination. - * @default 10 + * @default 100 */ pageSize?: number; } @@ -223,21 +223,24 @@ export abstract class BaseGraphQLSitemapService { formatStaticPath: (path: string[], language: string) => StaticPath ) { const paths = new Array(); - await Promise.all( - languages.map(async (language) => { - if (language === '') { - throw new RangeError(languageEmptyError); - } - debug.sitemap('fetching sitemap data for %s %s', language, siteName); - const results = await this.fetchLanguageSitePaths(language, siteName); - const transformedPaths = await this.transformLanguageSitePaths( - results, - formatStaticPath, - language - ); - paths.push(...transformedPaths); - }) - ); + + for (const language of languages) { + if (language === '') { + throw new RangeError(languageEmptyError); + } + + debug.sitemap('fetching sitemap data for %s %s', language, siteName); + + const results = await this.fetchLanguageSitePaths(language, siteName); + const transformedPaths = await this.transformLanguageSitePaths( + results, + formatStaticPath, + language + ); + + paths.push(...transformedPaths); + } + return paths; } diff --git a/packages/sitecore-jss-nextjs/src/services/graphql-sitemap-service.test.ts b/packages/sitecore-jss-nextjs/src/services/graphql-sitemap-service.test.ts index 2ec30b73f8..aa12c658f9 100644 --- a/packages/sitecore-jss-nextjs/src/services/graphql-sitemap-service.test.ts +++ b/packages/sitecore-jss-nextjs/src/services/graphql-sitemap-service.test.ts @@ -439,7 +439,8 @@ describe('GraphQLSitemapService', () => { .post( '/', (body) => - body.query.indexOf('$pageSize: Int = 10') > 0 && body.variables.pageSize === undefined + body.query.indexOf('$pageSize: Int = 100') > 0 && + body.variables.pageSize === undefined ) .reply(200, sitemapDefaultQueryResult);