-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversation
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -1532,7 +1532,8 @@ export enum WorkspaceActivationStatus { | |||
Active = 'ACTIVE', | |||
Inactive = 'INACTIVE', | |||
OngoingCreation = 'ONGOING_CREATION', | |||
PendingCreation = 'PENDING_CREATION' | |||
PendingCreation = 'PENDING_CREATION', | |||
Suspended = 'SUSPENDED' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this 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?
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.