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(), id: getModuleId(),
}), }),
TopicNode: () => ({ TopicNode: () => ({
modules: { modules: [],
edges: [],
},
}), }),
RoomNode: () => ({ RoomNode: () => ({
title: 'A Room', title: 'A Room',

View File

@ -1,5 +1,23 @@
describe('Create Content Block', () => { describe('Create Content Block', () => {
it('visits the page', () => { 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: { apollo: {
schoolClass: { schoolClass: {
query: MY_SCHOOL_CLASS_QUERY, query: MY_SCHOOL_CLASS_QUERY,
update(data) { update({me: {selectedClass}}) {
return this.$getRidOfEdges(data).me.selectedClass; return selectedClass;
} }
} }
}, },

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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