diff options
Diffstat (limited to 'frontend/src/components/ArticleItem.tsx')
| -rw-r--r-- | frontend/src/components/ArticleItem.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/frontend/src/components/ArticleItem.tsx b/frontend/src/components/ArticleItem.tsx index 4942518..c61923a 100644 --- a/frontend/src/components/ArticleItem.tsx +++ b/frontend/src/components/ArticleItem.tsx @@ -20,6 +20,8 @@ interface Props { onReadChange?: (articleId: string, isRead: boolean) => void; } +const urqlContextArticle = { additionalTypenames: ["Article"] }; + export function ArticleItem({ article, onReadChange }: Props) { const [, markArticleRead] = useMutation(MarkArticleReadDocument); const [, markArticleUnread] = useMutation(MarkArticleUnreadDocument); @@ -32,9 +34,9 @@ export function ArticleItem({ article, onReadChange }: Props) { onReadChange?.(articleId, newReadState); if (isCurrentlyRead) { - await markArticleUnread({ id: articleId }); + await markArticleUnread({ id: articleId }, urqlContextArticle); } else { - await markArticleRead({ id: articleId }); + await markArticleRead({ id: articleId }, urqlContextArticle); } }; @@ -43,7 +45,7 @@ export function ArticleItem({ article, onReadChange }: Props) { window.open(article.url, "_blank", "noreferrer"); if (!article.isRead) { onReadChange?.(article.id, true); - await markArticleRead({ id: article.id }); + await markArticleRead({ id: article.id }, urqlContextArticle); } }; |
