diff --git a/client/src/components/toggle-menu/ToggleSolutionsForModule.vue b/client/src/components/toggle-menu/ToggleSolutionsForModule.vue index 42a96e12..c009ce33 100644 --- a/client/src/components/toggle-menu/ToggleSolutionsForModule.vue +++ b/client/src/components/toggle-menu/ToggleSolutionsForModule.vue @@ -55,13 +55,11 @@ }, update(store, {data: {updateSolutionVisibility: {success, solutionsEnabled}}}) { if (success) { - // according to the documentation, this should be - // const id = `ModuleNode:${slug}`; - // see: https://www.apollographql.com/docs/react/caching/cache-interaction/#readfragment - // but in the actual cache, it's found like this - const id = `ModuleNode:{"slug":"${slug}"}`; - // there's an open issue on Stackoverflow here - // https://stackoverflow.com/questions/70264586/apollo-client-readfragment-with-custom-id-keyfields + // https://www.apollographql.com/docs/react/caching/cache-interaction/#obtaining-an-objects-cache-id + const id = store.identify({ + __typename: 'ModuleNode', + slug + }); const fragment = MODULE_FRAGMENT; const module = store.readFragment({fragment, id}); const data = {