Update cache properties
This commit is contained in:
parent
9cc1ab5324
commit
fc24958d9b
|
|
@ -5,6 +5,7 @@ const getOperations = ({readOnly = false, classReadOnly = false}) => ({
|
|||
ProjectQuery: {
|
||||
project: {
|
||||
id: 'projectId',
|
||||
slug: 'project-name',
|
||||
final: false,
|
||||
student: {
|
||||
id: btoa('PrivateUserNode:1'),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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 : [];
|
||||
|
|
|
|||
Loading…
Reference in New Issue