Fixed refetch query for GetCommentThreadsByTargets (#336)

* Fixed refetch query for GetCommentThreadsByTargets

* Improvement : use apollo util getOperationName to de-hard code refetch queries arrays
This commit is contained in:
Lucas Bordeau
2023-06-19 17:44:05 +02:00
committed by GitHub
parent 96a53ad765
commit 950a0b77fe
7 changed files with 47 additions and 14 deletions

View File

@ -1,5 +1,7 @@
import { getOperationName } from '@apollo/client/utilities';
import { useRecoilValue } from 'recoil';
import { GET_COMPANIES } from '@/companies/services';
import { EntityTableActionBarButton } from '@/ui/components/table/action-bar/EntityTableActionBarButton';
import { IconTrash } from '@/ui/icons/index';
import { useResetTableRowSelection } from '@/ui/tables/hooks/useResetTableRowSelection';
@ -12,7 +14,7 @@ export function TableActionBarButtonDeleteCompanies() {
const resetRowSelection = useResetTableRowSelection();
const [deleteCompanies] = useDeleteCompaniesMutation({
refetchQueries: ['GetCompanies'],
refetchQueries: [getOperationName(GET_COMPANIES) ?? ''],
});
async function handleDeleteClick() {

View File

@ -1,5 +1,7 @@
import { getOperationName } from '@apollo/client/utilities';
import { useRecoilValue } from 'recoil';
import { GET_PEOPLE } from '@/people/services';
import { EntityTableActionBarButton } from '@/ui/components/table/action-bar/EntityTableActionBarButton';
import { IconTrash } from '@/ui/icons/index';
import { useResetTableRowSelection } from '@/ui/tables/hooks/useResetTableRowSelection';
@ -12,7 +14,7 @@ export function TableActionBarButtonDeletePeople() {
const resetRowSelection = useResetTableRowSelection();
const [deletePeople] = useDeletePeopleMutation({
refetchQueries: ['GetPeople'],
refetchQueries: [getOperationName(GET_PEOPLE) ?? ''],
});
async function handleDeleteClick() {