Refetch current module after class change

This commit is contained in:
Christian Cueni 2021-11-18 13:39:55 +01:00
parent 3c4646bff6
commit ca82a080d1
1 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@ import ME_QUERY from '@/graphql/gql/queries/meQuery.gql';
import UPDATE_USER_SETTING from '@/graphql/gql/mutations/updateUserSetting.gql'; import UPDATE_USER_SETTING from '@/graphql/gql/mutations/updateUserSetting.gql';
import MY_SCHOOL_CLASS_QUERY from '@/graphql/gql/queries/mySchoolClass.gql'; import MY_SCHOOL_CLASS_QUERY from '@/graphql/gql/queries/mySchoolClass.gql';
import DELETE_MODULE_NODES from '@/graphql/gql/local/mutations/deleteModuleNodes.gql'; import DELETE_MODULE_NODES from '@/graphql/gql/local/mutations/deleteModuleNodes.gql';
import MODULE_DETAILS_QUERY from "@/graphql/gql/queries/modules/moduleDetailsQuery.gql";
export default { export default {
methods: { methods: {
@ -31,6 +32,11 @@ export default {
}, },
refetchQueries: [{ refetchQueries: [{
query: MY_SCHOOL_CLASS_QUERY query: MY_SCHOOL_CLASS_QUERY
}, {
query: MODULE_DETAILS_QUERY,
variables: {
slug: this.$route.params.slug
}
}] }]
}).catch((error) => { }).catch((error) => {
console.warn('failed to update selected class', error); console.warn('failed to update selected class', error);