Only fetch steps and trigger for the current workflow version (#15003)
Avoid fetching full steps and trigger for versions that are not the current version. Because those won't be used anyway. Better for performances. Only difficulty was for the `createDraft` mutation. I needed to return the full created version so I can store it in cache and use it as new `currentVersion`. Otherwise the current version is considered as incomplete for a short time, since workflow is fetched separately from the current version. --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@@ -1646,7 +1646,7 @@ export type Mutation = {
|
||||
createCoreViewGroup: CoreViewGroup;
|
||||
createCoreViewSort: CoreViewSort;
|
||||
createDatabaseConfigVariable: Scalars['Boolean'];
|
||||
createDraftFromWorkflowVersion: WorkflowVersion;
|
||||
createDraftFromWorkflowVersion: WorkflowVersionDto;
|
||||
createEmailingDomain: EmailingDomain;
|
||||
createFile: File;
|
||||
createOIDCIdentityProvider: SetupSsoOutput;
|
||||
@@ -4296,9 +4296,16 @@ export type WorkflowStepPositionUpdateInput = {
|
||||
position: WorkflowStepPositionInput;
|
||||
};
|
||||
|
||||
export type WorkflowVersion = {
|
||||
__typename?: 'WorkflowVersion';
|
||||
export type WorkflowVersionDto = {
|
||||
__typename?: 'WorkflowVersionDTO';
|
||||
createdAt: Scalars['String'];
|
||||
id: Scalars['UUID'];
|
||||
name: Scalars['String'];
|
||||
status: Scalars['String'];
|
||||
steps?: Maybe<Scalars['JSON']>;
|
||||
trigger?: Maybe<Scalars['JSON']>;
|
||||
updatedAt: Scalars['String'];
|
||||
workflowId: Scalars['UUID'];
|
||||
};
|
||||
|
||||
export type WorkflowVersionStepChanges = {
|
||||
|
||||
Reference in New Issue
Block a user