The reason the UI was not refreshed was a regression introduced by cf550a0ca17a8b6b44f7839454b1758704e701c0. Adding the argument "(statuses: $articleCategoryStatuses)" changes the key used by InMemoryCache from "articleCategories" to "articleCategories({"statuses":["NORMAL"]})". This results in cache.readFragment() (called in components/ArticleCategories/CategoryOption.js throwing this error:
coverage: 71.353%. remained the same
when pulling 478d1578912bc3e2bec3baaa4e2915e992ca72e9 on jiru:fix_add_categories
into 91dcbfb8de06d05f79047099f3d50d753932705c on cofacts:master.
Closes #481.
The reason the UI was not refreshed was a regression introduced by cf550a0ca17a8b6b44f7839454b1758704e701c0. Adding the argument "(statuses: $articleCategoryStatuses)" changes the key used by InMemoryCache from "articleCategories" to "articleCategories({"statuses":["NORMAL"]})". This results in cache.readFragment() (called in components/ArticleCategories/CategoryOption.js throwing this error:
This commits solves this issue by forcing the key to be "articleCategories".
The technique of using an
@connection
directive is documented here: https://www.apollographql.com/docs/react/data/directives/#connection