Update cache properties

This commit is contained in:
Ramon Wenger 2022-01-29 21:15:57 +01:00
parent 9cc1ab5324
commit fc24958d9b
5 changed files with 6 additions and 22 deletions

View File

@ -5,6 +5,7 @@ const getOperations = ({readOnly = false, classReadOnly = false}) => ({
ProjectQuery: {
project: {
id: 'projectId',
slug: 'project-name',
final: false,
student: {
id: btoa('PrivateUserNode:1'),

View File

@ -69,23 +69,6 @@ const typePolicies = {
objective: {read: idToRefFactory('ObjectiveNode')},
objectiveGroup: {read: idToRefFactory('ObjectiveGroupNode')},
projectEntry: {read: idToRefFactory('ProjectEntryNode')},
// project: {read: idToRefFactory('ProjectNode')},
project: {
read(_, {args: {slug, id}, toReference}) {
console.log(`Trying to reference project with slug ${slug}, id ${id}`);
if (slug) {
return toReference({
__typename: 'ProjectNode',
id: slug
});
} else {
return toReference({
__typename: 'ProjectNode',
id
});
}
}
},
}
},
};

View File

@ -1,7 +1,7 @@
#import "../fragments/projectParts.gql"
#import "../fragments/projectEntryParts.gql"
query ProjectQuery($id: ID, $slug: String){
project(slug: $slug, id: $id) {
query ProjectQuery($slug: String){
project(slug: $slug) {
...ProjectParts
entries {
...ProjectEntryParts

View File

@ -43,7 +43,7 @@
</div>
<div class="project__content">
<add-project-entry
:project="project.id"
:project="project.slug"
class="project__add-entry"
data-cy="add-project-entry"
v-if="isOwner && !me.readOnly && !me.selectedClass.readOnly"
@ -91,7 +91,7 @@
return {
project: {
student: {
id: ' ',
id: '',
},
},
me: {

View File

@ -8,7 +8,7 @@ const portfolioRoutes = [
{path: '/portfolio', name: PROJECTS_PAGE, component: portfolio, meta: {hideFooter: true}},
{path: '/portfolio/:slug', name: 'project', component: project, props: true},
{path: '/new-project/', name: NEW_PROJECT_PAGE, component: newProject},
{path: '/edit-project/:id', name: 'edit-project', component: editProject, props: true},
{path: '/edit-project/:slug', name: 'edit-project', component: editProject, props: true},
];
const routes = process.env.VUE_APP_ENABLE_PORTFOLIO ? portfolioRoutes : [];