Clean up graphql definitions

This commit is contained in:
Ramon Wenger 2022-01-27 17:59:01 +01:00
parent 04c850753f
commit 1462b08ecd
10 changed files with 34 additions and 39 deletions

View File

@ -92,9 +92,7 @@ export default {
id: getModuleId(),
}),
TopicNode: () => ({
modules: {
edges: [],
},
modules: [],
}),
RoomNode: () => ({
title: 'A Room',

View File

@ -1,5 +1,23 @@
describe('Create Content Block', () => {
it('visits the page', () => {
cy.visit();
// todo:
// add mocks
// cy.visit('/module/some-module/add/bliblablub');
// add title
// add text element
// add list item
// add text element to list item
// add second list item
// add text element to second list item
// add another text element to second list item
// save
// another test
// go to pase
// click cancel, go back
});
});
// todo: another test
// edit existing content block

View File

@ -63,8 +63,8 @@
apollo: {
schoolClass: {
query: MY_SCHOOL_CLASS_QUERY,
update(data) {
return this.$getRidOfEdges(data).me.selectedClass;
update({me: {selectedClass}}) {
return selectedClass;
}
}
},

View File

@ -1,10 +1,6 @@
#import "../fragments/assignmentParts.gql"
query AssignmentsQuery {
assignments {
edges {
node {
...AssignmentParts
}
}
...AssignmentParts
}
}

View File

@ -9,11 +9,7 @@ query ModuleDetailsQuery($slug: String, $id: ID) {
module(slug: $slug, id: $id) {
...ModuleParts
assignments {
edges {
node {
...AssignmentParts
}
}
...AssignmentParts
}
objectiveGroups {
...ObjectiveGroupParts

View File

@ -1,15 +1,11 @@
query NewsTeasers {
newsTeasers {
edges {
node {
id
description
title
imageUrl
newsArticleUrl
displayDate
imageSource
}
}
}
newsTeasers {
id
description
title
imageUrl
newsArticleUrl
displayDate
imageSource
}
}

View File

@ -7,9 +7,6 @@ export function moduleQuery() {
variables: {
slug: this.$route.params.slug
},
update({module}) {
return this.$getRidOfEdges(module) || {};
}
};
}

View File

@ -9,9 +9,6 @@ export default {
apollo: {
newsTeasers: {
query: NEWS_TEASER_QUERY,
update(data) {
return this.$getRidOfEdges(data).newsTeasers;
},
}
}
};

View File

@ -42,9 +42,6 @@
variables: {
slug: this.$route.params.slug,
},
update(data) {
return this.$getRidOfEdges(data).module || {};
},
result({data: {module: {id}}}) {
if (!this.updateSent) {
this.$log.debug(`=== updating result for module ${id} ===`);

View File

@ -80,5 +80,5 @@
</script>
<style scoped lang="scss">
@import "@/styles/_room.scss";
@import "~styles/_room.scss";
</style>