Fix widget and front component queries hitting wrong GraphQL endpoint (#17889)
This commit is contained in:
+1
-2
@@ -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;
|
||||
};
|
||||
|
||||
-4
@@ -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,
|
||||
|
||||
-4
@@ -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,
|
||||
|
||||
-4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user