Remove custom type definition for now
This commit is contained in:
parent
e843f6be6a
commit
a3c616d10e
|
|
@ -1,4 +1,4 @@
|
|||
import {makeVar, defaultDataIdFromObject, InMemoryCache} from '@apollo/client/core';
|
||||
import {makeVar, InMemoryCache} from '@apollo/client/core';
|
||||
|
||||
const showNavigationSidebarVar = makeVar(false);
|
||||
const showProfileSidebarVar = makeVar(false);
|
||||
|
|
@ -7,6 +7,8 @@ const currentFilterVar = makeVar('');
|
|||
const helloEmailVar = makeVar('');
|
||||
|
||||
const idToRefFactory = (__typename) => (_, {args, toReference}) => {
|
||||
// todo: can we log this via Vue.$log somehow?
|
||||
console.log(`Trying to reference ${__typename} with id ${args.id}`);
|
||||
return toReference({
|
||||
__typename,
|
||||
id: args.id
|
||||
|
|
@ -55,22 +57,23 @@ const typePolicies = {
|
|||
objective: {read: idToRefFactory('ObjectiveNode')},
|
||||
objectiveGroup: {read: idToRefFactory('ObjectiveGroupNode')},
|
||||
projectEntry: {read: idToRefFactory('ProjectEntryNode')},
|
||||
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: 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
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue