diff --git a/packages/data-context/src/DataContextShell.ts b/packages/data-context/src/DataContextShell.ts index 96dff3799343..7c42a83a8764 100644 --- a/packages/data-context/src/DataContextShell.ts +++ b/packages/data-context/src/DataContextShell.ts @@ -61,8 +61,7 @@ export class DataContextShell { return new DataEmitterActions(this) } - @cached - get graphql () { + graphqlClient () { return new GraphQLDataSource(this, this.shellConfig.schema) } diff --git a/packages/data-context/src/sources/HtmlDataSource.ts b/packages/data-context/src/sources/HtmlDataSource.ts index 59d84a523e7d..f0dd86d39720 100644 --- a/packages/data-context/src/sources/HtmlDataSource.ts +++ b/packages/data-context/src/sources/HtmlDataSource.ts @@ -10,15 +10,17 @@ export class HtmlDataSource { constructor (private ctx: DataContextShell) {} async fetchAppInitialData () { + const graphql = this.ctx.graphqlClient() + await Promise.all([ - this.ctx.graphql.executeQuery('AppQueryDocument', {}), - this.ctx.graphql.executeQuery('NewSpec_NewSpecQueryDocument', {}), - this.ctx.graphql.executeQuery('ProjectSettingsDocument', {}), - this.ctx.graphql.executeQuery('SpecsPageContainerDocument', {}), - this.ctx.graphql.executeQuery('HeaderBar_HeaderBarQueryDocument', {}), + graphql.executeQuery('AppQueryDocument', {}), + graphql.executeQuery('NewSpec_NewSpecQueryDocument', {}), + graphql.executeQuery('ProjectSettingsDocument', {}), + graphql.executeQuery('SpecsPageContainerDocument', {}), + graphql.executeQuery('HeaderBar_HeaderBarQueryDocument', {}), ]) - return this.ctx.graphql.getSSRData() + return graphql.getSSRData() } async fetchAppHtml () {