Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refetch query on draft creation #9650

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

thomtrp
Copy link
Contributor

@thomtrp thomtrp commented Jan 15, 2025

After hitting use as draft, we redirect the user to the workflow page. If the user already accessed that page, the workflow and its current version will be stored in cache. So we also need to update that cache.

I tried to update it manually but it was more complex than expected. Steps and trigger are not fully defined objects.

I ended with a simple refetch query that I wanted to avoid but that is at least fully working with minimum logic.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Implemented refetch query functionality in the workflow draft creation process to ensure data consistency after redirecting users to the workflow page.

  • Added refetchQueries configuration in packages/twenty-front/src/modules/workflow/hooks/useCreateDraftFromWorkflowVersion.ts to update workflow cache after draft creation
  • Added findManyWorkflowsQuery to handle workflow data synchronization
  • Added 'Suspended' status to WorkspaceActivationStatus enum in GraphQL schema

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@bosiraphael bosiraphael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomtrp thomtrp merged commit c79cb14 into main Jan 16, 2025
34 checks passed
@thomtrp thomtrp deleted the tt-fix-optimistic-rendering-on-use-as-draft branch January 16, 2025 09:46
@@ -1532,7 +1532,8 @@ export enum WorkspaceActivationStatus {
Active = 'ACTIVE',
Inactive = 'INACTIVE',
OngoingCreation = 'ONGOING_CREATION',
PendingCreation = 'PENDING_CREATION'
PendingCreation = 'PENDING_CREATION',
Suspended = 'SUSPENDED'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor

@martmull martmull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm what is this new workspaceActivationStatus?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants