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

fix(app): do not cache graphql #18716

Merged
merged 3 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/data-context/src/DataContextShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export class DataContextShell {
return new DataEmitterActions(this)
}

@cached
get graphql () {
lmiller1990 marked this conversation as resolved.
Show resolved Hide resolved
return new GraphQLDataSource(this, this.shellConfig.schema)
}
Expand Down
14 changes: 8 additions & 6 deletions packages/data-context/src/sources/HtmlDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ export class HtmlDataSource {
constructor (private ctx: DataContextShell) {}

async fetchAppInitialData () {
const graphql = this.ctx.graphql
lmiller1990 marked this conversation as resolved.
Show resolved Hide resolved

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 () {
Expand Down