Prevent querying too much on worklow index page (#14916)
## Performance short term fix Done in this PR: workflowVersions and workflowRuns are heavy object. I'm preventing loading their data when they are loaded as relations. This will reduce the work on backend ## Long term fix Todo: We should make sure workflow data is ligher
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ export const useActiveWorkflowVersionsWithManualTrigger = ({
|
||||
const { records } = useFindManyRecords<
|
||||
Pick<
|
||||
ManualTriggerWorkflowVersion,
|
||||
'id' | '__typename' | 'trigger' | 'status' | 'workflowId'
|
||||
'id' | '__typename' | 'status' | 'workflowId' | 'trigger'
|
||||
> & {
|
||||
workflow: Workflow;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import { isDefined } from 'twenty-shared/utils';
|
||||
export const useWorkflowWithCurrentVersion = (
|
||||
workflowId: string | undefined,
|
||||
): WorkflowWithCurrentVersion | undefined => {
|
||||
// TODO: we should only load the data for the current version
|
||||
const { record: workflow } = useFindOneRecord<Workflow>({
|
||||
objectNameSingular: CoreObjectNameSingular.Workflow,
|
||||
objectRecordId: workflowId,
|
||||
|
||||
Reference in New Issue
Block a user