diff --git a/client/src/graphql/cache.js b/client/src/graphql/cache.js index d8a3360e..b854e31d 100644 --- a/client/src/graphql/cache.js +++ b/client/src/graphql/cache.js @@ -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 + // }); + // } + // } + // }, } }, };