Update cache code
This commit is contained in:
parent
a3c616d10e
commit
656b2be364
|
|
@ -58,22 +58,22 @@ const typePolicies = {
|
|||
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',
|
||||
// slug
|
||||
// });
|
||||
// } else {
|
||||
// return toReference({
|
||||
// __typename: 'ProjectNode',
|
||||
// id
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
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
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,12 +14,13 @@ export default {
|
|||
variables: {
|
||||
input,
|
||||
},
|
||||
update(store, {data: {updateProjectSharedState: {shared: final, errors}}}) {
|
||||
update: (store, {data: {updateProjectSharedState: {shared: final, errors}}}) => {
|
||||
if (!errors) {
|
||||
const query = PROJECT_QUERY;
|
||||
const variables = {
|
||||
id: id,
|
||||
};
|
||||
|
||||
const {project} = store.readQuery({query, variables});
|
||||
this.$log.debug(`updating project ${project.id} ${project.title}`);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue