Skip to content

The open alternative to Salesforce, designed for AI.

Fix widget and front component queries hitting wrong GraphQL endpoint (#17889)

nitinc48ccbca993b
diff --git a/packages/twenty-front/src/modules/front-components/components/FrontComponentRenderer.tsx b/packages/twenty-front/src/modules/front-components/components/FrontComponentRenderer.tsx
index dbd8819349e..682fb51ad58 100644
--- a/packages/twenty-front/src/modules/front-components/components/FrontComponentRenderer.tsx
+++ b/packages/twenty-front/src/modules/front-components/components/FrontComponentRenderer.tsx
@@ -1,5 +1,6 @@
import { REST_API_BASE_URL } from '@/apollo/constant/rest-api-base-url';
import { getTokenPair } from '@/apollo/utils/getTokenPair';
+import { useFrontComponentExecutionContext } from '@/front-components/hooks/useFrontComponentExecutionContext';
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
import { useTheme } from '@emotion/react';
import { t } from '@lingui/core/macro';
@@ -7,8 +8,6 @@ import { useState } from 'react';
import { FrontComponentRenderer as SharedFrontComponentRenderer } from 'twenty-sdk/front-component';
import { isDefined } from 'twenty-shared/utils';
-import { useFrontComponentExecutionContext } from '@/front-components/hooks/useFrontComponentExecutionContext';
-
type FrontComponentRendererProps = {
frontComponentId: string;
};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetBarChart/hooks/useGraphBarChartWidgetData.ts b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetBarChart/hooks/useGraphBarChartWidgetData.ts
index 0834c820ceb..cc1af494646 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetBarChart/hooks/useGraphBarChartWidgetData.ts
+++ b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetBarChart/hooks/useGraphBarChartWidgetData.ts
@@ -1,4 +1,3 @@
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItemById } from '@/object-metadata/hooks/useObjectMetadataItemById';
import { type FieldMetadataItemOption } from '@/object-metadata/types/FieldMetadataItem';
import { BAR_CHART_DATA } from '@/page-layout/widgets/graph/graphql/queries/barChartData';
@@ -57,8 +56,6 @@ export const useGraphBarChartWidgetData = ({
objectId: objectMetadataItemId,
});
- const apolloCoreClient = useApolloCoreClient();
-
const dataConfiguration = useMemo(
() => extractBarChartDataConfiguration(configuration),
[configuration],
@@ -70,7 +67,6 @@ export const useGraphBarChartWidgetData = ({
loading,
error,
} = useQuery(BAR_CHART_DATA, {
- client: apolloCoreClient,
variables: {
input: {
objectMetadataId: objectMetadataItemId,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetLineChart/hooks/useGraphLineChartWidgetData.ts b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetLineChart/hooks/useGraphLineChartWidgetData.ts
index 050e498e09e..bcd33063493 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetLineChart/hooks/useGraphLineChartWidgetData.ts
+++ b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetLineChart/hooks/useGraphLineChartWidgetData.ts
@@ -1,4 +1,3 @@
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItemById } from '@/object-metadata/hooks/useObjectMetadataItemById';
import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { LINE_CHART_DATA } from '@/page-layout/widgets/graph/graphql/queries/lineChartData';
@@ -46,8 +45,6 @@ export const useGraphLineChartWidgetData = ({
objectId: objectMetadataItemId,
});
- const apolloCoreClient = useApolloCoreClient();
-
const dataConfiguration = extractLineChartDataConfiguration(configuration);
const {
@@ -55,7 +52,6 @@ export const useGraphLineChartWidgetData = ({
loading,
error,
} = useQuery(LINE_CHART_DATA, {
- client: apolloCoreClient,
variables: {
input: {
objectMetadataId: objectMetadataItemId,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetPieChart/hooks/useGraphPieChartWidgetData.ts b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetPieChart/hooks/useGraphPieChartWidgetData.ts
index cf21905b309..c6ddf215dde 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetPieChart/hooks/useGraphPieChartWidgetData.ts
+++ b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetPieChart/hooks/useGraphPieChartWidgetData.ts
@@ -1,4 +1,3 @@
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useObjectMetadataItemById } from '@/object-metadata/hooks/useObjectMetadataItemById';
import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { PIE_CHART_DATA } from '@/page-layout/widgets/graph/graphql/queries/pieChartData';
@@ -42,8 +41,6 @@ export const useGraphPieChartWidgetData = ({
objectId: objectMetadataItemId,
});
- const apolloCoreClient = useApolloCoreClient();
-
const dataConfiguration = useMemo(
() => extractPieChartDataConfiguration(configuration),
[configuration],
@@ -54,7 +51,6 @@ export const useGraphPieChartWidgetData = ({
loading,
error,
} = useQuery(PIE_CHART_DATA, {
- client: apolloCoreClient,
variables: {
input: {
objectMetadataId: objectMetadataItemId,