Skip to content
Permalink
Browse files

fix(performance): improve loading performance and caching

  • Loading branch information...
anehx authored and czosel committed Jul 18, 2019
1 parent a15161a commit 7bcedabc7c61520b74ce19a7ee590bdc8aa3af04
@@ -143,19 +143,19 @@ export default Component.extend(ComponentQueryManager, {
"allDocuments.edges"
)).map(({ node }) => node);

const [formDocument] = (yield this.apollo.query(
const [form] = (yield this.apollo.query(
{
query: getDocumentFormsQuery,
networkPolicy: "cache-first",
variables: { id: this.documentId }
variables: { slug: answerDocument.form.slug }
},
"allDocuments.edges"
"allForms.edges"
)).map(({ node }) => node);

this.calumaStore.clear();

return Document.create(getOwner(this).ownerInjection(), {
raw: parseDocument({ ...answerDocument, ...formDocument })
raw: parseDocument({ ...answerDocument, form })
});
})
});
@@ -5,6 +5,9 @@ query($id: ID!) {
edges {
node {
id
form {
slug
}
answers {
edges {
node {
@@ -1,18 +1,15 @@
#import 'ember-caluma/gql/fragments/field-question'

query($id: ID!) {
allDocuments(id: $id) {
query($slug: String!) {
allForms(slug: $slug) {
edges {
node {
id
form {
slug
name
questions {
edges {
node {
...FieldQuestion
}
slug
name
questions {
edges {
node {
...FieldQuestion
}
}
}

0 comments on commit 7bcedab

Please sign in to comment.
You can’t perform that action at this time.