diff --git a/front/src/generated/graphql.tsx b/front/src/generated/graphql.tsx index 7f6964ea0..d2e7f2255 100644 --- a/front/src/generated/graphql.tsx +++ b/front/src/generated/graphql.tsx @@ -2637,6 +2637,25 @@ export type WorkspaceUpdateInput = { workspaceMember?: InputMaybe; }; +export type ActivityQueryFragmentFragment = { __typename?: 'Activity', id: string, createdAt: string, title?: string | null, body?: string | null, type: ActivityType, completedAt?: string | null, dueAt?: string | null, assignee?: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string, avatarUrl?: string | null } | null, author: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string }, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } }> | null, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, companyId?: string | null, personId?: string | null, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null, person?: { __typename?: 'Person', id: string, displayName: string, avatarUrl?: string | null } | null }> | null }; + +export type ActivityUpdatePartsFragment = { __typename?: 'Activity', id: string, body?: string | null, title?: string | null, type: ActivityType, completedAt?: string | null, dueAt?: string | null, assignee?: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string } | null }; + +export type AddActivityTargetsOnActivityMutationVariables = Exact<{ + activityId: Scalars['String']; + activityTargetInputs: Array | ActivityTargetCreateManyActivityInput; +}>; + + +export type AddActivityTargetsOnActivityMutation = { __typename?: 'Mutation', updateOneActivity: { __typename?: 'Activity', id: string, createdAt: string, updatedAt: string, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, createdAt: string, updatedAt: string, companyId?: string | null, personId?: string | null }> | null } }; + +export type CreateActivityMutationVariables = Exact<{ + data: ActivityCreateInput; +}>; + + +export type CreateActivityMutation = { __typename?: 'Mutation', createOneActivity: { __typename?: 'Activity', id: string, createdAt: string, updatedAt: string, authorId: string, type: ActivityType, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, createdAt: string, updatedAt: string, activityId: string, companyId?: string | null, personId?: string | null }> | null, comments?: Array<{ __typename?: 'Comment', id: string, createdAt: string, updatedAt: string, body: string, author: { __typename?: 'User', id: string } }> | null } }; + export type CreateCommentMutationVariables = Exact<{ commentId: Scalars['String']; commentText: Scalars['String']; @@ -2648,45 +2667,12 @@ export type CreateCommentMutationVariables = Exact<{ export type CreateCommentMutation = { __typename?: 'Mutation', createOneComment: { __typename?: 'Comment', id: string, createdAt: string, body: string, activityId?: string | null, author: { __typename?: 'User', id: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } } }; -export type CreateActivityMutationVariables = Exact<{ - data: ActivityCreateInput; -}>; - - -export type CreateActivityMutation = { __typename?: 'Mutation', createOneActivity: { __typename?: 'Activity', id: string, createdAt: string, updatedAt: string, authorId: string, type: ActivityType, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, createdAt: string, updatedAt: string, activityId: string, companyId?: string | null, personId?: string | null }> | null, comments?: Array<{ __typename?: 'Comment', id: string, createdAt: string, updatedAt: string, body: string, author: { __typename?: 'User', id: string } }> | null } }; - -export type ActivityQueryFragmentFragment = { __typename?: 'Activity', id: string, createdAt: string, title?: string | null, body?: string | null, type: ActivityType, completedAt?: string | null, dueAt?: string | null, assignee?: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string, avatarUrl?: string | null } | null, author: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string }, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } }> | null, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, companyId?: string | null, personId?: string | null, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null, person?: { __typename?: 'Person', id: string, displayName: string, avatarUrl?: string | null } | null }> | null }; - -export type GetActivitiesByTargetsQueryVariables = Exact<{ - activityTargetIds: Array | Scalars['String']; - orderBy?: InputMaybe | ActivityOrderByWithRelationInput>; -}>; - - -export type GetActivitiesByTargetsQuery = { __typename?: 'Query', findManyActivities: Array<{ __typename?: 'Activity', id: string, createdAt: string, title?: string | null, body?: string | null, type: ActivityType, completedAt?: string | null, dueAt?: string | null, assignee?: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string, avatarUrl?: string | null } | null, author: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string }, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } }> | null, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, companyId?: string | null, personId?: string | null, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null, person?: { __typename?: 'Person', id: string, displayName: string, avatarUrl?: string | null } | null }> | null }> }; - -export type GetActivitiesQueryVariables = Exact<{ - where: ActivityWhereInput; - orderBy?: InputMaybe | ActivityOrderByWithRelationInput>; -}>; - - -export type GetActivitiesQuery = { __typename?: 'Query', findManyActivities: Array<{ __typename?: 'Activity', id: string, createdAt: string, title?: string | null, body?: string | null, type: ActivityType, completedAt?: string | null, dueAt?: string | null, assignee?: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string, avatarUrl?: string | null } | null, author: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string }, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } }> | null, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, companyId?: string | null, personId?: string | null, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null, person?: { __typename?: 'Person', id: string, displayName: string, avatarUrl?: string | null } | null }> | null }> }; - -export type GetActivityQueryVariables = Exact<{ +export type DeleteActivityMutationVariables = Exact<{ activityId: Scalars['String']; }>; -export type GetActivityQuery = { __typename?: 'Query', findManyActivities: Array<{ __typename?: 'Activity', id: string, createdAt: string, title?: string | null, body?: string | null, type: ActivityType, completedAt?: string | null, dueAt?: string | null, assignee?: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string, avatarUrl?: string | null } | null, author: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string }, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } }> | null, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, companyId?: string | null, personId?: string | null, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null, person?: { __typename?: 'Person', id: string, displayName: string, avatarUrl?: string | null } | null }> | null }> }; - -export type AddActivityTargetsOnActivityMutationVariables = Exact<{ - activityId: Scalars['String']; - activityTargetInputs: Array | ActivityTargetCreateManyActivityInput; -}>; - - -export type AddActivityTargetsOnActivityMutation = { __typename?: 'Mutation', updateOneActivity: { __typename?: 'Activity', id: string, createdAt: string, updatedAt: string, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, createdAt: string, updatedAt: string, companyId?: string | null, personId?: string | null }> | null } }; +export type DeleteActivityMutation = { __typename?: 'Mutation', deleteManyActivities: { __typename?: 'AffectedRows', count: number } }; export type RemoveActivityTargetsOnActivityMutationVariables = Exact<{ activityId: Scalars['String']; @@ -2696,15 +2682,6 @@ export type RemoveActivityTargetsOnActivityMutationVariables = Exact<{ export type RemoveActivityTargetsOnActivityMutation = { __typename?: 'Mutation', updateOneActivity: { __typename?: 'Activity', id: string, createdAt: string, updatedAt: string, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, createdAt: string, updatedAt: string, companyId?: string | null, personId?: string | null }> | null } }; -export type DeleteActivityMutationVariables = Exact<{ - activityId: Scalars['String']; -}>; - - -export type DeleteActivityMutation = { __typename?: 'Mutation', deleteManyActivities: { __typename?: 'AffectedRows', count: number } }; - -export type ActivityUpdatePartsFragment = { __typename?: 'Activity', id: string, body?: string | null, title?: string | null, type: ActivityType, completedAt?: string | null, dueAt?: string | null, assignee?: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string } | null }; - export type UpdateActivityMutationVariables = Exact<{ where: ActivityWhereUniqueInput; data: ActivityUpdateInput; @@ -2721,6 +2698,29 @@ export type UploadAttachmentMutationVariables = Exact<{ export type UploadAttachmentMutation = { __typename?: 'Mutation', uploadAttachment: string }; +export type GetActivitiesQueryVariables = Exact<{ + where: ActivityWhereInput; + orderBy?: InputMaybe | ActivityOrderByWithRelationInput>; +}>; + + +export type GetActivitiesQuery = { __typename?: 'Query', findManyActivities: Array<{ __typename?: 'Activity', id: string, createdAt: string, title?: string | null, body?: string | null, type: ActivityType, completedAt?: string | null, dueAt?: string | null, assignee?: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string, avatarUrl?: string | null } | null, author: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string }, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } }> | null, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, companyId?: string | null, personId?: string | null, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null, person?: { __typename?: 'Person', id: string, displayName: string, avatarUrl?: string | null } | null }> | null }> }; + +export type GetActivitiesByTargetsQueryVariables = Exact<{ + activityTargetIds: Array | Scalars['String']; + orderBy?: InputMaybe | ActivityOrderByWithRelationInput>; +}>; + + +export type GetActivitiesByTargetsQuery = { __typename?: 'Query', findManyActivities: Array<{ __typename?: 'Activity', id: string, createdAt: string, title?: string | null, body?: string | null, type: ActivityType, completedAt?: string | null, dueAt?: string | null, assignee?: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string, avatarUrl?: string | null } | null, author: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string }, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } }> | null, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, companyId?: string | null, personId?: string | null, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null, person?: { __typename?: 'Person', id: string, displayName: string, avatarUrl?: string | null } | null }> | null }> }; + +export type GetActivityQueryVariables = Exact<{ + activityId: Scalars['String']; +}>; + + +export type GetActivityQuery = { __typename?: 'Query', findManyActivities: Array<{ __typename?: 'Activity', id: string, createdAt: string, title?: string | null, body?: string | null, type: ActivityType, completedAt?: string | null, dueAt?: string | null, assignee?: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string, avatarUrl?: string | null } | null, author: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null, displayName: string }, comments?: Array<{ __typename?: 'Comment', id: string, body: string, createdAt: string, updatedAt: string, author: { __typename?: 'User', id: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } }> | null, activityTargets?: Array<{ __typename?: 'ActivityTarget', id: string, companyId?: string | null, personId?: string | null, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null, person?: { __typename?: 'Person', id: string, displayName: string, avatarUrl?: string | null } | null }> | null }> }; + export type CreateEventMutationVariables = Exact<{ type: Scalars['String']; data: Scalars['JSON']; @@ -2729,12 +2729,7 @@ export type CreateEventMutationVariables = Exact<{ export type CreateEventMutation = { __typename?: 'Mutation', createEvent: { __typename?: 'Analytics', success: boolean } }; -export type CheckUserExistsQueryVariables = Exact<{ - email: Scalars['String']; -}>; - - -export type CheckUserExistsQuery = { __typename?: 'Query', checkUserExists: { __typename?: 'UserExists', exists: boolean } }; +export type UserQueryFragmentFragment = { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } }; export type ChallengeMutationVariables = Exact<{ email: Scalars['String']; @@ -2744,6 +2739,20 @@ export type ChallengeMutationVariables = Exact<{ export type ChallengeMutation = { __typename?: 'Mutation', challenge: { __typename?: 'LoginToken', loginToken: { __typename?: 'AuthToken', expiresAt: string, token: string } } }; +export type ImpersonateMutationVariables = Exact<{ + userId: Scalars['String']; +}>; + + +export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'Verify', user: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } }, tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } }; + +export type RenewTokenMutationVariables = Exact<{ + refreshToken: Scalars['String']; +}>; + + +export type RenewTokenMutation = { __typename?: 'Mutation', renewToken: { __typename?: 'AuthTokens', tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', expiresAt: string, token: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } }; + export type SignUpMutationVariables = Exact<{ email: Scalars['String']; password: Scalars['String']; @@ -2760,25 +2769,42 @@ export type VerifyMutationVariables = Exact<{ export type VerifyMutation = { __typename?: 'Mutation', verify: { __typename?: 'Verify', user: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } }, tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } }; -export type RenewTokenMutationVariables = Exact<{ - refreshToken: Scalars['String']; +export type CheckUserExistsQueryVariables = Exact<{ + email: Scalars['String']; }>; -export type RenewTokenMutation = { __typename?: 'Mutation', renewToken: { __typename?: 'AuthTokens', tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', expiresAt: string, token: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } }; - -export type ImpersonateMutationVariables = Exact<{ - userId: Scalars['String']; -}>; - - -export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'Verify', user: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } }, tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } }; +export type CheckUserExistsQuery = { __typename?: 'Query', checkUserExists: { __typename?: 'UserExists', exists: boolean } }; export type GetClientConfigQueryVariables = Exact<{ [key: string]: never; }>; export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', signInPrefilled: boolean, debugMode: boolean, authProviders: { __typename?: 'AuthProviders', google: boolean, password: boolean }, telemetry: { __typename?: 'Telemetry', enabled: boolean, anonymizationEnabled: boolean }, support: { __typename?: 'Support', supportDriver: string, supportFrontChatId?: string | null } } }; +export type CompanyFieldsFragmentFragment = { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null }; + +export type DeleteManyCompaniesMutationVariables = Exact<{ + ids?: InputMaybe | Scalars['String']>; +}>; + + +export type DeleteManyCompaniesMutation = { __typename?: 'Mutation', deleteManyCompany: { __typename?: 'AffectedRows', count: number } }; + +export type InsertOneCompanyMutationVariables = Exact<{ + data: CompanyCreateInput; +}>; + + +export type InsertOneCompanyMutation = { __typename?: 'Mutation', createOneCompany: { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null } }; + +export type UpdateOneCompanyMutationVariables = Exact<{ + where: CompanyWhereUniqueInput; + data: CompanyUpdateInput; +}>; + + +export type UpdateOneCompanyMutation = { __typename?: 'Mutation', updateOneCompany?: { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null } | null }; + export type GetCompaniesQueryVariables = Exact<{ orderBy?: InputMaybe | CompanyOrderByWithRelationInput>; where?: InputMaybe; @@ -2794,41 +2820,12 @@ export type GetCompanyQueryVariables = Exact<{ export type GetCompanyQuery = { __typename?: 'Query', findUniqueCompany: { __typename?: 'Company', id: string, domainName: string, name: string, createdAt: string, address: string, linkedinUrl?: string | null, employees?: number | null, _activityCount: number, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null, Favorite?: Array<{ __typename?: 'Favorite', id: string, person?: { __typename?: 'Person', id: string } | null, company?: { __typename?: 'Company', id: string } | null }> | null } }; -export type CompanyFieldsFragmentFragment = { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null }; - -export type UpdateOneCompanyMutationVariables = Exact<{ - where: CompanyWhereUniqueInput; - data: CompanyUpdateInput; +export type DeleteFavoriteMutationVariables = Exact<{ + where: FavoriteWhereInput; }>; -export type UpdateOneCompanyMutation = { __typename?: 'Mutation', updateOneCompany?: { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null } | null }; - -export type InsertOneCompanyMutationVariables = Exact<{ - data: CompanyCreateInput; -}>; - - -export type InsertOneCompanyMutation = { __typename?: 'Mutation', createOneCompany: { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null } }; - -export type DeleteManyCompaniesMutationVariables = Exact<{ - ids?: InputMaybe | Scalars['String']>; -}>; - - -export type DeleteManyCompaniesMutation = { __typename?: 'Mutation', deleteManyCompany: { __typename?: 'AffectedRows', count: number } }; - -export type GetFavoritesQueryVariables = Exact<{ [key: string]: never; }>; - - -export type GetFavoritesQuery = { __typename?: 'Query', findFavorites: Array<{ __typename?: 'Favorite', id: string, person?: { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } | null, company?: { __typename?: 'Company', id: string, name: string, domainName: string, accountOwner?: { __typename?: 'User', id: string, displayName: string, avatarUrl?: string | null } | null } | null }> }; - -export type InsertPersonFavoriteMutationVariables = Exact<{ - data: FavoriteMutationForPersonArgs; -}>; - - -export type InsertPersonFavoriteMutation = { __typename?: 'Mutation', createFavoriteForPerson: { __typename?: 'Favorite', id: string, person?: { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, displayName: string } | null } }; +export type DeleteFavoriteMutation = { __typename?: 'Mutation', deleteFavorite: { __typename?: 'Favorite', id: string } }; export type InsertCompanyFavoriteMutationVariables = Exact<{ data: FavoriteMutationForCompanyArgs; @@ -2837,12 +2834,56 @@ export type InsertCompanyFavoriteMutationVariables = Exact<{ export type InsertCompanyFavoriteMutation = { __typename?: 'Mutation', createFavoriteForCompany: { __typename?: 'Favorite', id: string, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null } }; -export type DeleteFavoriteMutationVariables = Exact<{ - where: FavoriteWhereInput; +export type InsertPersonFavoriteMutationVariables = Exact<{ + data: FavoriteMutationForPersonArgs; }>; -export type DeleteFavoriteMutation = { __typename?: 'Mutation', deleteFavorite: { __typename?: 'Favorite', id: string } }; +export type InsertPersonFavoriteMutation = { __typename?: 'Mutation', createFavoriteForPerson: { __typename?: 'Favorite', id: string, person?: { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, displayName: string } | null } }; + +export type GetFavoritesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetFavoritesQuery = { __typename?: 'Query', findFavorites: Array<{ __typename?: 'Favorite', id: string, person?: { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } | null, company?: { __typename?: 'Company', id: string, name: string, domainName: string, accountOwner?: { __typename?: 'User', id: string, displayName: string, avatarUrl?: string | null } | null } | null }> }; + +export type InsertPersonFragmentFragment = { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, displayName: string, createdAt: string }; + +export type DeleteManyPersonMutationVariables = Exact<{ + ids?: InputMaybe | Scalars['String']>; +}>; + + +export type DeleteManyPersonMutation = { __typename?: 'Mutation', deleteManyPerson: { __typename?: 'AffectedRows', count: number } }; + +export type InsertOnePersonMutationVariables = Exact<{ + data: PersonCreateInput; +}>; + + +export type InsertOnePersonMutation = { __typename?: 'Mutation', createOnePerson: { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, displayName: string, createdAt: string } }; + +export type RemovePersonPictureMutationVariables = Exact<{ + where: PersonWhereUniqueInput; +}>; + + +export type RemovePersonPictureMutation = { __typename?: 'Mutation', updateOnePerson?: { __typename?: 'Person', id: string, avatarUrl?: string | null } | null }; + +export type UpdateOnePersonMutationVariables = Exact<{ + where: PersonWhereUniqueInput; + data: PersonUpdateInput; +}>; + + +export type UpdateOnePersonMutation = { __typename?: 'Mutation', updateOnePerson?: { __typename?: 'Person', id: string, city?: string | null, email?: string | null, jobTitle?: string | null, linkedinUrl?: string | null, xUrl?: string | null, firstName?: string | null, lastName?: string | null, displayName: string, phone?: string | null, createdAt: string, company?: { __typename?: 'Company', domainName: string, name: string, id: string } | null } | null }; + +export type UploadPersonPictureMutationVariables = Exact<{ + id: Scalars['String']; + file: Scalars['Upload']; +}>; + + +export type UploadPersonPictureMutation = { __typename?: 'Mutation', uploadPersonPicture: string }; export type GetPeopleQueryVariables = Exact<{ orderBy?: InputMaybe | PersonOrderByWithRelationInput>; @@ -2853,12 +2894,40 @@ export type GetPeopleQueryVariables = Exact<{ export type GetPeopleQuery = { __typename?: 'Query', people: Array<{ __typename?: 'Person', id: string, phone?: string | null, email?: string | null, city?: string | null, firstName?: string | null, lastName?: string | null, displayName: string, jobTitle?: string | null, linkedinUrl?: string | null, xUrl?: string | null, avatarUrl?: string | null, createdAt: string, _activityCount: number, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null }> }; -export type GetPersonPhoneByIdQueryVariables = Exact<{ +export type GetPersonQueryVariables = Exact<{ id: Scalars['String']; }>; -export type GetPersonPhoneByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, phone?: string | null } }; +export type GetPersonQuery = { __typename?: 'Query', findUniquePerson: { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, displayName: string, email?: string | null, createdAt: string, city?: string | null, jobTitle?: string | null, linkedinUrl?: string | null, xUrl?: string | null, avatarUrl?: string | null, phone?: string | null, _activityCount: number, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null, Favorite?: Array<{ __typename?: 'Favorite', id: string, person?: { __typename?: 'Person', id: string } | null, company?: { __typename?: 'Company', id: string } | null }> | null } }; + +export type GetPersonCityByIdQueryVariables = Exact<{ + id: Scalars['String']; +}>; + + +export type GetPersonCityByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, city?: string | null } }; + +export type GetPersonCommentCountByIdQueryVariables = Exact<{ + id: Scalars['String']; +}>; + + +export type GetPersonCommentCountByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, _activityCount: number } }; + +export type GetPersonCompanyByIdQueryVariables = Exact<{ + id: Scalars['String']; +}>; + + +export type GetPersonCompanyByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null } }; + +export type GetPersonCreatedAtByIdQueryVariables = Exact<{ + id: Scalars['String']; +}>; + + +export type GetPersonCreatedAtByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, createdAt: string } }; export type GetPersonEmailByIdQueryVariables = Exact<{ id: Scalars['String']; @@ -2874,94 +2943,22 @@ export type GetPersonNamesAndCommentCountByIdQueryVariables = Exact<{ export type GetPersonNamesAndCommentCountByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, displayName: string, _activityCount: number } }; -export type GetPersonCompanyByIdQueryVariables = Exact<{ +export type GetPersonPhoneByIdQueryVariables = Exact<{ id: Scalars['String']; }>; -export type GetPersonCompanyByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null } }; +export type GetPersonPhoneByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, phone?: string | null } }; -export type GetPersonCommentCountByIdQueryVariables = Exact<{ - id: Scalars['String']; +export type CreateOneCompanyPipelineProgressMutationVariables = Exact<{ + uuid: Scalars['String']; + companyId: Scalars['String']; + pipelineId: Scalars['String']; + pipelineStageId: Scalars['String']; }>; -export type GetPersonCommentCountByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, _activityCount: number } }; - -export type GetPersonCreatedAtByIdQueryVariables = Exact<{ - id: Scalars['String']; -}>; - - -export type GetPersonCreatedAtByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, createdAt: string } }; - -export type GetPersonCityByIdQueryVariables = Exact<{ - id: Scalars['String']; -}>; - - -export type GetPersonCityByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, city?: string | null } }; - -export type GetPersonQueryVariables = Exact<{ - id: Scalars['String']; -}>; - - -export type GetPersonQuery = { __typename?: 'Query', findUniquePerson: { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, displayName: string, email?: string | null, createdAt: string, city?: string | null, jobTitle?: string | null, linkedinUrl?: string | null, xUrl?: string | null, avatarUrl?: string | null, phone?: string | null, _activityCount: number, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null, Favorite?: Array<{ __typename?: 'Favorite', id: string, person?: { __typename?: 'Person', id: string } | null, company?: { __typename?: 'Company', id: string } | null }> | null } }; - -export type UpdateOnePersonMutationVariables = Exact<{ - where: PersonWhereUniqueInput; - data: PersonUpdateInput; -}>; - - -export type UpdateOnePersonMutation = { __typename?: 'Mutation', updateOnePerson?: { __typename?: 'Person', id: string, city?: string | null, email?: string | null, jobTitle?: string | null, linkedinUrl?: string | null, xUrl?: string | null, firstName?: string | null, lastName?: string | null, displayName: string, phone?: string | null, createdAt: string, company?: { __typename?: 'Company', domainName: string, name: string, id: string } | null } | null }; - -export type InsertPersonFragmentFragment = { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, displayName: string, createdAt: string }; - -export type InsertOnePersonMutationVariables = Exact<{ - data: PersonCreateInput; -}>; - - -export type InsertOnePersonMutation = { __typename?: 'Mutation', createOnePerson: { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, displayName: string, createdAt: string } }; - -export type DeleteManyPersonMutationVariables = Exact<{ - ids?: InputMaybe | Scalars['String']>; -}>; - - -export type DeleteManyPersonMutation = { __typename?: 'Mutation', deleteManyPerson: { __typename?: 'AffectedRows', count: number } }; - -export type UploadPersonPictureMutationVariables = Exact<{ - id: Scalars['String']; - file: Scalars['Upload']; -}>; - - -export type UploadPersonPictureMutation = { __typename?: 'Mutation', uploadPersonPicture: string }; - -export type RemovePersonPictureMutationVariables = Exact<{ - where: PersonWhereUniqueInput; -}>; - - -export type RemovePersonPictureMutation = { __typename?: 'Mutation', updateOnePerson?: { __typename?: 'Person', id: string, avatarUrl?: string | null } | null }; - -export type GetPipelinesQueryVariables = Exact<{ - where?: InputMaybe; -}>; - - -export type GetPipelinesQuery = { __typename?: 'Query', findManyPipeline: Array<{ __typename?: 'Pipeline', id: string, name: string, pipelineProgressableType: PipelineProgressableType, pipelineStages?: Array<{ __typename?: 'PipelineStage', id: string, name: string, color: string, index?: number | null }> | null }> }; - -export type GetPipelineProgressQueryVariables = Exact<{ - where?: InputMaybe; - orderBy?: InputMaybe | PipelineProgressOrderByWithRelationInput>; -}>; - - -export type GetPipelineProgressQuery = { __typename?: 'Query', findManyPipelineProgress: Array<{ __typename?: 'PipelineProgress', id: string, pipelineStageId: string, companyId?: string | null, personId?: string | null, amount?: number | null, closeDate?: string | null, pointOfContactId?: string | null, probability?: number | null, pointOfContact?: { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, displayName: string, avatarUrl?: string | null } | null }> }; +export type CreateOneCompanyPipelineProgressMutation = { __typename?: 'Mutation', createOnePipelineProgress: { __typename?: 'PipelineProgress', id: string } }; export type DeleteManyPipelineProgressMutationVariables = Exact<{ ids?: InputMaybe | Scalars['String']>; @@ -2970,14 +2967,6 @@ export type DeleteManyPipelineProgressMutationVariables = Exact<{ export type DeleteManyPipelineProgressMutation = { __typename?: 'Mutation', deleteManyPipelineProgress: { __typename?: 'AffectedRows', count: number } }; -export type UpdatePipelineStageMutationVariables = Exact<{ - id?: InputMaybe; - data: PipelineStageUpdateInput; -}>; - - -export type UpdatePipelineStageMutation = { __typename?: 'Mutation', updateOnePipelineStage?: { __typename?: 'PipelineStage', id: string, name: string, color: string } | null }; - export type UpdateOnePipelineProgressMutationVariables = Exact<{ data: PipelineProgressUpdateInput; where: PipelineProgressWhereUniqueInput; @@ -2994,15 +2983,46 @@ export type UpdateOnePipelineProgressStageMutationVariables = Exact<{ export type UpdateOnePipelineProgressStageMutation = { __typename?: 'Mutation', updateOnePipelineProgress?: { __typename?: 'PipelineProgress', id: string } | null }; -export type CreateOneCompanyPipelineProgressMutationVariables = Exact<{ - uuid: Scalars['String']; - companyId: Scalars['String']; - pipelineId: Scalars['String']; - pipelineStageId: Scalars['String']; +export type UpdatePipelineStageMutationVariables = Exact<{ + id?: InputMaybe; + data: PipelineStageUpdateInput; }>; -export type CreateOneCompanyPipelineProgressMutation = { __typename?: 'Mutation', createOnePipelineProgress: { __typename?: 'PipelineProgress', id: string } }; +export type UpdatePipelineStageMutation = { __typename?: 'Mutation', updateOnePipelineStage?: { __typename?: 'PipelineStage', id: string, name: string, color: string } | null }; + +export type GetPipelineProgressQueryVariables = Exact<{ + where?: InputMaybe; + orderBy?: InputMaybe | PipelineProgressOrderByWithRelationInput>; +}>; + + +export type GetPipelineProgressQuery = { __typename?: 'Query', findManyPipelineProgress: Array<{ __typename?: 'PipelineProgress', id: string, pipelineStageId: string, companyId?: string | null, personId?: string | null, amount?: number | null, closeDate?: string | null, pointOfContactId?: string | null, probability?: number | null, pointOfContact?: { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, displayName: string, avatarUrl?: string | null } | null }> }; + +export type GetPipelinesQueryVariables = Exact<{ + where?: InputMaybe; +}>; + + +export type GetPipelinesQuery = { __typename?: 'Query', findManyPipeline: Array<{ __typename?: 'Pipeline', id: string, name: string, pipelineProgressableType: PipelineProgressableType, pipelineStages?: Array<{ __typename?: 'PipelineStage', id: string, name: string, color: string, index?: number | null }> | null }> }; + +export type SearchActivityQueryVariables = Exact<{ + where?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe | ActivityOrderByWithRelationInput>; +}>; + + +export type SearchActivityQuery = { __typename?: 'Query', searchResults: Array<{ __typename?: 'Activity', id: string, title?: string | null, body?: string | null }> }; + +export type SearchCompanyQueryVariables = Exact<{ + where?: InputMaybe; + limit?: InputMaybe; + orderBy?: InputMaybe | CompanyOrderByWithRelationInput>; +}>; + + +export type SearchCompanyQuery = { __typename?: 'Query', searchResults: Array<{ __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null }> }; export type SearchPeopleQueryVariables = Exact<{ where?: InputMaybe; @@ -3022,46 +3042,17 @@ export type SearchUserQueryVariables = Exact<{ export type SearchUserQuery = { __typename?: 'Query', searchResults: Array<{ __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null }> }; -export type EmptyQueryQueryVariables = Exact<{ [key: string]: never; }>; +export type DeleteUserAccountMutationVariables = Exact<{ [key: string]: never; }>; -export type EmptyQueryQuery = { __typename?: 'Query', searchResults: Array<{ __typename?: 'User', id: string }> }; +export type DeleteUserAccountMutation = { __typename?: 'Mutation', deleteUserAccount: { __typename?: 'User', id: string } }; -export type SearchCompanyQueryVariables = Exact<{ - where?: InputMaybe; - limit?: InputMaybe; - orderBy?: InputMaybe | CompanyOrderByWithRelationInput>; -}>; - - -export type SearchCompanyQuery = { __typename?: 'Query', searchResults: Array<{ __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null }> }; - -export type SearchActivityQueryVariables = Exact<{ - where?: InputMaybe; - limit?: InputMaybe; - orderBy?: InputMaybe | ActivityOrderByWithRelationInput>; -}>; - - -export type SearchActivityQuery = { __typename?: 'Query', searchResults: Array<{ __typename?: 'Activity', id: string, title?: string | null, body?: string | null }> }; - -export type GetCurrentUserQueryVariables = Exact<{ [key: string]: never; }>; - - -export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, locale: string, colorScheme: ColorScheme } } }; - -export type GetUsersQueryVariables = Exact<{ [key: string]: never; }>; - - -export type GetUsersQuery = { __typename?: 'Query', findManyUser: Array<{ __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null }> }; - -export type UpdateUserMutationVariables = Exact<{ - data: UserUpdateInput; +export type RemoveProfilePictureMutationVariables = Exact<{ where: UserWhereUniqueInput; }>; -export type UpdateUserMutation = { __typename?: 'Mutation', updateUser: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, locale: string, colorScheme: ColorScheme } } }; +export type RemoveProfilePictureMutation = { __typename?: 'Mutation', updateUser: { __typename?: 'User', id: string, avatarUrl?: string | null } }; export type UpdateAllowImpersonationMutationVariables = Exact<{ allowImpersonation: Scalars['Boolean']; @@ -3077,17 +3068,23 @@ export type UploadProfilePictureMutationVariables = Exact<{ export type UploadProfilePictureMutation = { __typename?: 'Mutation', uploadProfilePicture: string }; -export type RemoveProfilePictureMutationVariables = Exact<{ +export type UpdateUserMutationVariables = Exact<{ + data: UserUpdateInput; where: UserWhereUniqueInput; }>; -export type RemoveProfilePictureMutation = { __typename?: 'Mutation', updateUser: { __typename?: 'User', id: string, avatarUrl?: string | null } }; +export type UpdateUserMutation = { __typename?: 'Mutation', updateUser: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, locale: string, colorScheme: ColorScheme } } }; -export type DeleteUserAccountMutationVariables = Exact<{ [key: string]: never; }>; +export type GetCurrentUserQueryVariables = Exact<{ [key: string]: never; }>; -export type DeleteUserAccountMutation = { __typename?: 'Mutation', deleteUserAccount: { __typename?: 'User', id: string } }; +export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, locale: string, colorScheme: ColorScheme } } }; + +export type GetUsersQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetUsersQuery = { __typename?: 'Query', findManyUser: Array<{ __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null }> }; export type CreateViewFieldsMutationVariables = Exact<{ data: Array | ViewFieldCreateManyInput; @@ -3110,21 +3107,6 @@ export type DeleteViewSortsMutationVariables = Exact<{ export type DeleteViewSortsMutation = { __typename?: 'Mutation', deleteManyViewSort: { __typename?: 'AffectedRows', count: number } }; -export type GetViewFieldsQueryVariables = Exact<{ - where?: InputMaybe; - orderBy?: InputMaybe | ViewFieldOrderByWithRelationInput>; -}>; - - -export type GetViewFieldsQuery = { __typename?: 'Query', viewFields: Array<{ __typename?: 'ViewField', id: string, fieldName: string, isVisible: boolean, sizeInPx: number, index: number }> }; - -export type GetViewSortsQueryVariables = Exact<{ - where?: InputMaybe; -}>; - - -export type GetViewSortsQuery = { __typename?: 'Query', viewSorts: Array<{ __typename?: 'ViewSort', direction: ViewSortDirection, key: string, name: string }> }; - export type UpdateViewFieldMutationVariables = Exact<{ data: ViewFieldUpdateInput; where: ViewFieldWhereUniqueInput; @@ -3141,17 +3123,37 @@ export type UpdateViewSortMutationVariables = Exact<{ export type UpdateViewSortMutation = { __typename?: 'Mutation', viewSort: { __typename?: 'ViewSort', direction: ViewSortDirection, key: string, name: string } }; -export type GetWorkspaceMembersQueryVariables = Exact<{ [key: string]: never; }>; - - -export type GetWorkspaceMembersQuery = { __typename?: 'Query', workspaceMembers: Array<{ __typename?: 'WorkspaceMember', id: string, user: { __typename?: 'User', id: string, email: string, avatarUrl?: string | null, firstName?: string | null, lastName?: string | null, displayName: string } }> }; - -export type GetWorkspaceFromInviteHashQueryVariables = Exact<{ - inviteHash: Scalars['String']; +export type GetViewFieldsQueryVariables = Exact<{ + where?: InputMaybe; + orderBy?: InputMaybe | ViewFieldOrderByWithRelationInput>; }>; -export type GetWorkspaceFromInviteHashQuery = { __typename?: 'Query', findWorkspaceFromInviteHash: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null } }; +export type GetViewFieldsQuery = { __typename?: 'Query', viewFields: Array<{ __typename?: 'ViewField', id: string, fieldName: string, isVisible: boolean, sizeInPx: number, index: number }> }; + +export type GetViewSortsQueryVariables = Exact<{ + where?: InputMaybe; +}>; + + +export type GetViewSortsQuery = { __typename?: 'Query', viewSorts: Array<{ __typename?: 'ViewSort', direction: ViewSortDirection, key: string, name: string }> }; + +export type DeleteCurrentWorkspaceMutationVariables = Exact<{ [key: string]: never; }>; + + +export type DeleteCurrentWorkspaceMutation = { __typename?: 'Mutation', deleteCurrentWorkspace: { __typename?: 'Workspace', id: string } }; + +export type RemoveWorkspaceLogoMutationVariables = Exact<{ [key: string]: never; }>; + + +export type RemoveWorkspaceLogoMutation = { __typename?: 'Mutation', updateWorkspace: { __typename?: 'Workspace', id: string } }; + +export type RemoveWorkspaceMemberMutationVariables = Exact<{ + where: WorkspaceMemberWhereUniqueInput; +}>; + + +export type RemoveWorkspaceMemberMutation = { __typename?: 'Mutation', deleteWorkspaceMember: { __typename?: 'WorkspaceMember', id: string } }; export type UpdateWorkspaceMutationVariables = Exact<{ data: WorkspaceUpdateInput; @@ -3167,22 +3169,17 @@ export type UploadWorkspaceLogoMutationVariables = Exact<{ export type UploadWorkspaceLogoMutation = { __typename?: 'Mutation', uploadWorkspaceLogo: string }; -export type RemoveWorkspaceLogoMutationVariables = Exact<{ [key: string]: never; }>; - - -export type RemoveWorkspaceLogoMutation = { __typename?: 'Mutation', updateWorkspace: { __typename?: 'Workspace', id: string } }; - -export type RemoveWorkspaceMemberMutationVariables = Exact<{ - where: WorkspaceMemberWhereUniqueInput; +export type GetWorkspaceFromInviteHashQueryVariables = Exact<{ + inviteHash: Scalars['String']; }>; -export type RemoveWorkspaceMemberMutation = { __typename?: 'Mutation', deleteWorkspaceMember: { __typename?: 'WorkspaceMember', id: string } }; +export type GetWorkspaceFromInviteHashQuery = { __typename?: 'Query', findWorkspaceFromInviteHash: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null } }; -export type DeleteCurrentWorkspaceMutationVariables = Exact<{ [key: string]: never; }>; +export type GetWorkspaceMembersQueryVariables = Exact<{ [key: string]: never; }>; -export type DeleteCurrentWorkspaceMutation = { __typename?: 'Mutation', deleteCurrentWorkspace: { __typename?: 'Workspace', id: string } }; +export type GetWorkspaceMembersQuery = { __typename?: 'Query', workspaceMembers: Array<{ __typename?: 'WorkspaceMember', id: string, user: { __typename?: 'User', id: string, email: string, avatarUrl?: string | null, firstName?: string | null, lastName?: string | null, displayName: string } }> }; export const ActivityQueryFragmentFragmentDoc = gql` fragment ActivityQueryFragment on Activity { @@ -3252,6 +3249,33 @@ export const ActivityUpdatePartsFragmentDoc = gql` } } `; +export const UserQueryFragmentFragmentDoc = gql` + fragment UserQueryFragment on User { + id + email + displayName + firstName + lastName + canImpersonate + supportUserHash + workspaceMember { + id + allowImpersonation + workspace { + id + domainName + displayName + logo + inviteHash + } + } + settings { + id + colorScheme + locale + } +} + `; export const CompanyFieldsFragmentFragmentDoc = gql` fragment CompanyFieldsFragment on Company { accountOwner { @@ -3278,55 +3302,52 @@ export const InsertPersonFragmentFragmentDoc = gql` createdAt } `; -export const CreateCommentDocument = gql` - mutation CreateComment($commentId: String!, $commentText: String!, $authorId: String!, $activityId: String!, $createdAt: DateTime!) { - createOneComment( - data: {id: $commentId, createdAt: $createdAt, body: $commentText, author: {connect: {id: $authorId}}, activity: {connect: {id: $activityId}}} +export const AddActivityTargetsOnActivityDocument = gql` + mutation AddActivityTargetsOnActivity($activityId: String!, $activityTargetInputs: [ActivityTargetCreateManyActivityInput!]!) { + updateOneActivity( + where: {id: $activityId} + data: {activityTargets: {createMany: {data: $activityTargetInputs}}} ) { id createdAt - body - author { + updatedAt + activityTargets { id - displayName - firstName - lastName - avatarUrl + createdAt + updatedAt + companyId + personId } - activityId } } `; -export type CreateCommentMutationFn = Apollo.MutationFunction; +export type AddActivityTargetsOnActivityMutationFn = Apollo.MutationFunction; /** - * __useCreateCommentMutation__ + * __useAddActivityTargetsOnActivityMutation__ * - * To run a mutation, you first call `useCreateCommentMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useCreateCommentMutation` returns a tuple that includes: + * To run a mutation, you first call `useAddActivityTargetsOnActivityMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAddActivityTargetsOnActivityMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [createCommentMutation, { data, loading, error }] = useCreateCommentMutation({ + * const [addActivityTargetsOnActivityMutation, { data, loading, error }] = useAddActivityTargetsOnActivityMutation({ * variables: { - * commentId: // value for 'commentId' - * commentText: // value for 'commentText' - * authorId: // value for 'authorId' * activityId: // value for 'activityId' - * createdAt: // value for 'createdAt' + * activityTargetInputs: // value for 'activityTargetInputs' * }, * }); */ -export function useCreateCommentMutation(baseOptions?: Apollo.MutationHookOptions) { +export function useAddActivityTargetsOnActivityMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(CreateCommentDocument, options); + return Apollo.useMutation(AddActivityTargetsOnActivityDocument, options); } -export type CreateCommentMutationHookResult = ReturnType; -export type CreateCommentMutationResult = Apollo.MutationResult; -export type CreateCommentMutationOptions = Apollo.BaseMutationOptions; +export type AddActivityTargetsOnActivityMutationHookResult = ReturnType; +export type AddActivityTargetsOnActivityMutationResult = Apollo.MutationResult; +export type AddActivityTargetsOnActivityMutationOptions = Apollo.BaseMutationOptions; export const CreateActivityDocument = gql` mutation CreateActivity($data: ActivityCreateInput!) { createOneActivity(data: $data) { @@ -3381,162 +3402,88 @@ export function useCreateActivityMutation(baseOptions?: Apollo.MutationHookOptio export type CreateActivityMutationHookResult = ReturnType; export type CreateActivityMutationResult = Apollo.MutationResult; export type CreateActivityMutationOptions = Apollo.BaseMutationOptions; -export const GetActivitiesByTargetsDocument = gql` - query GetActivitiesByTargets($activityTargetIds: [String!]!, $orderBy: [ActivityOrderByWithRelationInput!]) { - findManyActivities( - orderBy: $orderBy - where: {activityTargets: {some: {OR: [{personId: {in: $activityTargetIds}}, {companyId: {in: $activityTargetIds}}]}}} - ) { - ...ActivityQueryFragment - } -} - ${ActivityQueryFragmentFragmentDoc}`; - -/** - * __useGetActivitiesByTargetsQuery__ - * - * To run a query within a React component, call `useGetActivitiesByTargetsQuery` and pass it any options that fit your needs. - * When your component renders, `useGetActivitiesByTargetsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetActivitiesByTargetsQuery({ - * variables: { - * activityTargetIds: // value for 'activityTargetIds' - * orderBy: // value for 'orderBy' - * }, - * }); - */ -export function useGetActivitiesByTargetsQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetActivitiesByTargetsDocument, options); - } -export function useGetActivitiesByTargetsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetActivitiesByTargetsDocument, options); - } -export type GetActivitiesByTargetsQueryHookResult = ReturnType; -export type GetActivitiesByTargetsLazyQueryHookResult = ReturnType; -export type GetActivitiesByTargetsQueryResult = Apollo.QueryResult; -export const GetActivitiesDocument = gql` - query GetActivities($where: ActivityWhereInput!, $orderBy: [ActivityOrderByWithRelationInput!]) { - findManyActivities(orderBy: $orderBy, where: $where) { - ...ActivityQueryFragment - } -} - ${ActivityQueryFragmentFragmentDoc}`; - -/** - * __useGetActivitiesQuery__ - * - * To run a query within a React component, call `useGetActivitiesQuery` and pass it any options that fit your needs. - * When your component renders, `useGetActivitiesQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetActivitiesQuery({ - * variables: { - * where: // value for 'where' - * orderBy: // value for 'orderBy' - * }, - * }); - */ -export function useGetActivitiesQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetActivitiesDocument, options); - } -export function useGetActivitiesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetActivitiesDocument, options); - } -export type GetActivitiesQueryHookResult = ReturnType; -export type GetActivitiesLazyQueryHookResult = ReturnType; -export type GetActivitiesQueryResult = Apollo.QueryResult; -export const GetActivityDocument = gql` - query GetActivity($activityId: String!) { - findManyActivities(where: {id: {equals: $activityId}}) { - ...ActivityQueryFragment - } -} - ${ActivityQueryFragmentFragmentDoc}`; - -/** - * __useGetActivityQuery__ - * - * To run a query within a React component, call `useGetActivityQuery` and pass it any options that fit your needs. - * When your component renders, `useGetActivityQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetActivityQuery({ - * variables: { - * activityId: // value for 'activityId' - * }, - * }); - */ -export function useGetActivityQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetActivityDocument, options); - } -export function useGetActivityLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetActivityDocument, options); - } -export type GetActivityQueryHookResult = ReturnType; -export type GetActivityLazyQueryHookResult = ReturnType; -export type GetActivityQueryResult = Apollo.QueryResult; -export const AddActivityTargetsOnActivityDocument = gql` - mutation AddActivityTargetsOnActivity($activityId: String!, $activityTargetInputs: [ActivityTargetCreateManyActivityInput!]!) { - updateOneActivity( - where: {id: $activityId} - data: {activityTargets: {createMany: {data: $activityTargetInputs}}} +export const CreateCommentDocument = gql` + mutation CreateComment($commentId: String!, $commentText: String!, $authorId: String!, $activityId: String!, $createdAt: DateTime!) { + createOneComment( + data: {id: $commentId, createdAt: $createdAt, body: $commentText, author: {connect: {id: $authorId}}, activity: {connect: {id: $activityId}}} ) { id createdAt - updatedAt - activityTargets { + body + author { id - createdAt - updatedAt - companyId - personId + displayName + firstName + lastName + avatarUrl } + activityId } } `; -export type AddActivityTargetsOnActivityMutationFn = Apollo.MutationFunction; +export type CreateCommentMutationFn = Apollo.MutationFunction; /** - * __useAddActivityTargetsOnActivityMutation__ + * __useCreateCommentMutation__ * - * To run a mutation, you first call `useAddActivityTargetsOnActivityMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAddActivityTargetsOnActivityMutation` returns a tuple that includes: + * To run a mutation, you first call `useCreateCommentMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useCreateCommentMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [addActivityTargetsOnActivityMutation, { data, loading, error }] = useAddActivityTargetsOnActivityMutation({ + * const [createCommentMutation, { data, loading, error }] = useCreateCommentMutation({ * variables: { + * commentId: // value for 'commentId' + * commentText: // value for 'commentText' + * authorId: // value for 'authorId' * activityId: // value for 'activityId' - * activityTargetInputs: // value for 'activityTargetInputs' + * createdAt: // value for 'createdAt' * }, * }); */ -export function useAddActivityTargetsOnActivityMutation(baseOptions?: Apollo.MutationHookOptions) { +export function useCreateCommentMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(AddActivityTargetsOnActivityDocument, options); + return Apollo.useMutation(CreateCommentDocument, options); } -export type AddActivityTargetsOnActivityMutationHookResult = ReturnType; -export type AddActivityTargetsOnActivityMutationResult = Apollo.MutationResult; -export type AddActivityTargetsOnActivityMutationOptions = Apollo.BaseMutationOptions; +export type CreateCommentMutationHookResult = ReturnType; +export type CreateCommentMutationResult = Apollo.MutationResult; +export type CreateCommentMutationOptions = Apollo.BaseMutationOptions; +export const DeleteActivityDocument = gql` + mutation DeleteActivity($activityId: String!) { + deleteManyActivities(where: {id: {equals: $activityId}}) { + count + } +} + `; +export type DeleteActivityMutationFn = Apollo.MutationFunction; + +/** + * __useDeleteActivityMutation__ + * + * To run a mutation, you first call `useDeleteActivityMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useDeleteActivityMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [deleteActivityMutation, { data, loading, error }] = useDeleteActivityMutation({ + * variables: { + * activityId: // value for 'activityId' + * }, + * }); + */ +export function useDeleteActivityMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(DeleteActivityDocument, options); + } +export type DeleteActivityMutationHookResult = ReturnType; +export type DeleteActivityMutationResult = Apollo.MutationResult; +export type DeleteActivityMutationOptions = Apollo.BaseMutationOptions; export const RemoveActivityTargetsOnActivityDocument = gql` mutation RemoveActivityTargetsOnActivity($activityId: String!, $activityTargetIds: [String!]!) { updateOneActivity( @@ -3583,39 +3530,6 @@ export function useRemoveActivityTargetsOnActivityMutation(baseOptions?: Apollo. export type RemoveActivityTargetsOnActivityMutationHookResult = ReturnType; export type RemoveActivityTargetsOnActivityMutationResult = Apollo.MutationResult; export type RemoveActivityTargetsOnActivityMutationOptions = Apollo.BaseMutationOptions; -export const DeleteActivityDocument = gql` - mutation DeleteActivity($activityId: String!) { - deleteManyActivities(where: {id: {equals: $activityId}}) { - count - } -} - `; -export type DeleteActivityMutationFn = Apollo.MutationFunction; - -/** - * __useDeleteActivityMutation__ - * - * To run a mutation, you first call `useDeleteActivityMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteActivityMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [deleteActivityMutation, { data, loading, error }] = useDeleteActivityMutation({ - * variables: { - * activityId: // value for 'activityId' - * }, - * }); - */ -export function useDeleteActivityMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(DeleteActivityDocument, options); - } -export type DeleteActivityMutationHookResult = ReturnType; -export type DeleteActivityMutationResult = Apollo.MutationResult; -export type DeleteActivityMutationOptions = Apollo.BaseMutationOptions; export const UpdateActivityDocument = gql` mutation UpdateActivity($where: ActivityWhereUniqueInput!, $data: ActivityUpdateInput!) { updateOneActivity(where: $where, data: $data) { @@ -3682,6 +3596,116 @@ export function useUploadAttachmentMutation(baseOptions?: Apollo.MutationHookOpt export type UploadAttachmentMutationHookResult = ReturnType; export type UploadAttachmentMutationResult = Apollo.MutationResult; export type UploadAttachmentMutationOptions = Apollo.BaseMutationOptions; +export const GetActivitiesDocument = gql` + query GetActivities($where: ActivityWhereInput!, $orderBy: [ActivityOrderByWithRelationInput!]) { + findManyActivities(orderBy: $orderBy, where: $where) { + ...ActivityQueryFragment + } +} + ${ActivityQueryFragmentFragmentDoc}`; + +/** + * __useGetActivitiesQuery__ + * + * To run a query within a React component, call `useGetActivitiesQuery` and pass it any options that fit your needs. + * When your component renders, `useGetActivitiesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetActivitiesQuery({ + * variables: { + * where: // value for 'where' + * orderBy: // value for 'orderBy' + * }, + * }); + */ +export function useGetActivitiesQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetActivitiesDocument, options); + } +export function useGetActivitiesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetActivitiesDocument, options); + } +export type GetActivitiesQueryHookResult = ReturnType; +export type GetActivitiesLazyQueryHookResult = ReturnType; +export type GetActivitiesQueryResult = Apollo.QueryResult; +export const GetActivitiesByTargetsDocument = gql` + query GetActivitiesByTargets($activityTargetIds: [String!]!, $orderBy: [ActivityOrderByWithRelationInput!]) { + findManyActivities( + orderBy: $orderBy + where: {activityTargets: {some: {OR: [{personId: {in: $activityTargetIds}}, {companyId: {in: $activityTargetIds}}]}}} + ) { + ...ActivityQueryFragment + } +} + ${ActivityQueryFragmentFragmentDoc}`; + +/** + * __useGetActivitiesByTargetsQuery__ + * + * To run a query within a React component, call `useGetActivitiesByTargetsQuery` and pass it any options that fit your needs. + * When your component renders, `useGetActivitiesByTargetsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetActivitiesByTargetsQuery({ + * variables: { + * activityTargetIds: // value for 'activityTargetIds' + * orderBy: // value for 'orderBy' + * }, + * }); + */ +export function useGetActivitiesByTargetsQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetActivitiesByTargetsDocument, options); + } +export function useGetActivitiesByTargetsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetActivitiesByTargetsDocument, options); + } +export type GetActivitiesByTargetsQueryHookResult = ReturnType; +export type GetActivitiesByTargetsLazyQueryHookResult = ReturnType; +export type GetActivitiesByTargetsQueryResult = Apollo.QueryResult; +export const GetActivityDocument = gql` + query GetActivity($activityId: String!) { + findManyActivities(where: {id: {equals: $activityId}}) { + ...ActivityQueryFragment + } +} + ${ActivityQueryFragmentFragmentDoc}`; + +/** + * __useGetActivityQuery__ + * + * To run a query within a React component, call `useGetActivityQuery` and pass it any options that fit your needs. + * When your component renders, `useGetActivityQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetActivityQuery({ + * variables: { + * activityId: // value for 'activityId' + * }, + * }); + */ +export function useGetActivityQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetActivityDocument, options); + } +export function useGetActivityLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetActivityDocument, options); + } +export type GetActivityQueryHookResult = ReturnType; +export type GetActivityLazyQueryHookResult = ReturnType; +export type GetActivityQueryResult = Apollo.QueryResult; export const CreateEventDocument = gql` mutation CreateEvent($type: String!, $data: JSON!) { createEvent(type: $type, data: $data) { @@ -3716,41 +3740,6 @@ export function useCreateEventMutation(baseOptions?: Apollo.MutationHookOptions< export type CreateEventMutationHookResult = ReturnType; export type CreateEventMutationResult = Apollo.MutationResult; export type CreateEventMutationOptions = Apollo.BaseMutationOptions; -export const CheckUserExistsDocument = gql` - query CheckUserExists($email: String!) { - checkUserExists(email: $email) { - exists - } -} - `; - -/** - * __useCheckUserExistsQuery__ - * - * To run a query within a React component, call `useCheckUserExistsQuery` and pass it any options that fit your needs. - * When your component renders, `useCheckUserExistsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useCheckUserExistsQuery({ - * variables: { - * email: // value for 'email' - * }, - * }); - */ -export function useCheckUserExistsQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(CheckUserExistsDocument, options); - } -export function useCheckUserExistsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(CheckUserExistsDocument, options); - } -export type CheckUserExistsQueryHookResult = ReturnType; -export type CheckUserExistsLazyQueryHookResult = ReturnType; -export type CheckUserExistsQueryResult = Apollo.QueryResult; export const ChallengeDocument = gql` mutation Challenge($email: String!, $password: String!) { challenge(email: $email, password: $password) { @@ -3788,6 +3777,93 @@ export function useChallengeMutation(baseOptions?: Apollo.MutationHookOptions; export type ChallengeMutationResult = Apollo.MutationResult; export type ChallengeMutationOptions = Apollo.BaseMutationOptions; +export const ImpersonateDocument = gql` + mutation Impersonate($userId: String!) { + impersonate(userId: $userId) { + user { + ...UserQueryFragment + } + tokens { + accessToken { + token + expiresAt + } + refreshToken { + token + expiresAt + } + } + } +} + ${UserQueryFragmentFragmentDoc}`; +export type ImpersonateMutationFn = Apollo.MutationFunction; + +/** + * __useImpersonateMutation__ + * + * To run a mutation, you first call `useImpersonateMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useImpersonateMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [impersonateMutation, { data, loading, error }] = useImpersonateMutation({ + * variables: { + * userId: // value for 'userId' + * }, + * }); + */ +export function useImpersonateMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(ImpersonateDocument, options); + } +export type ImpersonateMutationHookResult = ReturnType; +export type ImpersonateMutationResult = Apollo.MutationResult; +export type ImpersonateMutationOptions = Apollo.BaseMutationOptions; +export const RenewTokenDocument = gql` + mutation RenewToken($refreshToken: String!) { + renewToken(refreshToken: $refreshToken) { + tokens { + accessToken { + expiresAt + token + } + refreshToken { + token + expiresAt + } + } + } +} + `; +export type RenewTokenMutationFn = Apollo.MutationFunction; + +/** + * __useRenewTokenMutation__ + * + * To run a mutation, you first call `useRenewTokenMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useRenewTokenMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [renewTokenMutation, { data, loading, error }] = useRenewTokenMutation({ + * variables: { + * refreshToken: // value for 'refreshToken' + * }, + * }); + */ +export function useRenewTokenMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(RenewTokenDocument, options); + } +export type RenewTokenMutationHookResult = ReturnType; +export type RenewTokenMutationResult = Apollo.MutationResult; +export type RenewTokenMutationOptions = Apollo.BaseMutationOptions; export const SignUpDocument = gql` mutation SignUp($email: String!, $password: String!, $workspaceInviteHash: String) { signUp( @@ -3834,29 +3910,7 @@ export const VerifyDocument = gql` mutation Verify($loginToken: String!) { verify(loginToken: $loginToken) { user { - id - email - displayName - firstName - lastName - canImpersonate - supportUserHash - workspaceMember { - id - allowImpersonation - workspace { - id - domainName - displayName - logo - inviteHash - } - } - settings { - id - colorScheme - locale - } + ...UserQueryFragment } tokens { accessToken { @@ -3870,7 +3924,7 @@ export const VerifyDocument = gql` } } } - `; + ${UserQueryFragmentFragmentDoc}`; export type VerifyMutationFn = Apollo.MutationFunction; /** @@ -3897,115 +3951,41 @@ export function useVerifyMutation(baseOptions?: Apollo.MutationHookOptions; export type VerifyMutationResult = Apollo.MutationResult; export type VerifyMutationOptions = Apollo.BaseMutationOptions; -export const RenewTokenDocument = gql` - mutation RenewToken($refreshToken: String!) { - renewToken(refreshToken: $refreshToken) { - tokens { - accessToken { - expiresAt - token - } - refreshToken { - token - expiresAt - } - } +export const CheckUserExistsDocument = gql` + query CheckUserExists($email: String!) { + checkUserExists(email: $email) { + exists } } `; -export type RenewTokenMutationFn = Apollo.MutationFunction; /** - * __useRenewTokenMutation__ + * __useCheckUserExistsQuery__ * - * To run a mutation, you first call `useRenewTokenMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useRenewTokenMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution + * To run a query within a React component, call `useCheckUserExistsQuery` and pass it any options that fit your needs. + * When your component renders, `useCheckUserExistsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example - * const [renewTokenMutation, { data, loading, error }] = useRenewTokenMutation({ + * const { data, loading, error } = useCheckUserExistsQuery({ * variables: { - * refreshToken: // value for 'refreshToken' + * email: // value for 'email' * }, * }); */ -export function useRenewTokenMutation(baseOptions?: Apollo.MutationHookOptions) { +export function useCheckUserExistsQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(RenewTokenDocument, options); + return Apollo.useQuery(CheckUserExistsDocument, options); } -export type RenewTokenMutationHookResult = ReturnType; -export type RenewTokenMutationResult = Apollo.MutationResult; -export type RenewTokenMutationOptions = Apollo.BaseMutationOptions; -export const ImpersonateDocument = gql` - mutation Impersonate($userId: String!) { - impersonate(userId: $userId) { - user { - id - email - displayName - firstName - lastName - canImpersonate - supportUserHash - workspaceMember { - id - allowImpersonation - workspace { - id - domainName - displayName - logo - inviteHash +export function useCheckUserExistsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(CheckUserExistsDocument, options); } - } - settings { - id - colorScheme - locale - } - } - tokens { - accessToken { - token - expiresAt - } - refreshToken { - token - expiresAt - } - } - } -} - `; -export type ImpersonateMutationFn = Apollo.MutationFunction; - -/** - * __useImpersonateMutation__ - * - * To run a mutation, you first call `useImpersonateMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useImpersonateMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [impersonateMutation, { data, loading, error }] = useImpersonateMutation({ - * variables: { - * userId: // value for 'userId' - * }, - * }); - */ -export function useImpersonateMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(ImpersonateDocument, options); - } -export type ImpersonateMutationHookResult = ReturnType; -export type ImpersonateMutationResult = Apollo.MutationResult; -export type ImpersonateMutationOptions = Apollo.BaseMutationOptions; +export type CheckUserExistsQueryHookResult = ReturnType; +export type CheckUserExistsLazyQueryHookResult = ReturnType; +export type CheckUserExistsQueryResult = Apollo.QueryResult; export const GetClientConfigDocument = gql` query GetClientConfig { clientConfig { @@ -4053,6 +4033,106 @@ export function useGetClientConfigLazyQuery(baseOptions?: Apollo.LazyQueryHookOp export type GetClientConfigQueryHookResult = ReturnType; export type GetClientConfigLazyQueryHookResult = ReturnType; export type GetClientConfigQueryResult = Apollo.QueryResult; +export const DeleteManyCompaniesDocument = gql` + mutation DeleteManyCompanies($ids: [String!]) { + deleteManyCompany(where: {id: {in: $ids}}) { + count + } +} + `; +export type DeleteManyCompaniesMutationFn = Apollo.MutationFunction; + +/** + * __useDeleteManyCompaniesMutation__ + * + * To run a mutation, you first call `useDeleteManyCompaniesMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useDeleteManyCompaniesMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [deleteManyCompaniesMutation, { data, loading, error }] = useDeleteManyCompaniesMutation({ + * variables: { + * ids: // value for 'ids' + * }, + * }); + */ +export function useDeleteManyCompaniesMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(DeleteManyCompaniesDocument, options); + } +export type DeleteManyCompaniesMutationHookResult = ReturnType; +export type DeleteManyCompaniesMutationResult = Apollo.MutationResult; +export type DeleteManyCompaniesMutationOptions = Apollo.BaseMutationOptions; +export const InsertOneCompanyDocument = gql` + mutation InsertOneCompany($data: CompanyCreateInput!) { + createOneCompany(data: $data) { + ...CompanyFieldsFragment + } +} + ${CompanyFieldsFragmentFragmentDoc}`; +export type InsertOneCompanyMutationFn = Apollo.MutationFunction; + +/** + * __useInsertOneCompanyMutation__ + * + * To run a mutation, you first call `useInsertOneCompanyMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useInsertOneCompanyMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [insertOneCompanyMutation, { data, loading, error }] = useInsertOneCompanyMutation({ + * variables: { + * data: // value for 'data' + * }, + * }); + */ +export function useInsertOneCompanyMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(InsertOneCompanyDocument, options); + } +export type InsertOneCompanyMutationHookResult = ReturnType; +export type InsertOneCompanyMutationResult = Apollo.MutationResult; +export type InsertOneCompanyMutationOptions = Apollo.BaseMutationOptions; +export const UpdateOneCompanyDocument = gql` + mutation UpdateOneCompany($where: CompanyWhereUniqueInput!, $data: CompanyUpdateInput!) { + updateOneCompany(data: $data, where: $where) { + ...CompanyFieldsFragment + } +} + ${CompanyFieldsFragmentFragmentDoc}`; +export type UpdateOneCompanyMutationFn = Apollo.MutationFunction; + +/** + * __useUpdateOneCompanyMutation__ + * + * To run a mutation, you first call `useUpdateOneCompanyMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useUpdateOneCompanyMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [updateOneCompanyMutation, { data, loading, error }] = useUpdateOneCompanyMutation({ + * variables: { + * where: // value for 'where' + * data: // value for 'data' + * }, + * }); + */ +export function useUpdateOneCompanyMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(UpdateOneCompanyDocument, options); + } +export type UpdateOneCompanyMutationHookResult = ReturnType; +export type UpdateOneCompanyMutationResult = Apollo.MutationResult; +export type UpdateOneCompanyMutationOptions = Apollo.BaseMutationOptions; export const GetCompaniesDocument = gql` query GetCompanies($orderBy: [CompanyOrderByWithRelationInput!], $where: CompanyWhereInput) { companies: findManyCompany(orderBy: $orderBy, where: $where) { @@ -4161,106 +4241,116 @@ export function useGetCompanyLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type GetCompanyQueryHookResult = ReturnType; export type GetCompanyLazyQueryHookResult = ReturnType; export type GetCompanyQueryResult = Apollo.QueryResult; -export const UpdateOneCompanyDocument = gql` - mutation UpdateOneCompany($where: CompanyWhereUniqueInput!, $data: CompanyUpdateInput!) { - updateOneCompany(data: $data, where: $where) { - ...CompanyFieldsFragment - } -} - ${CompanyFieldsFragmentFragmentDoc}`; -export type UpdateOneCompanyMutationFn = Apollo.MutationFunction; - -/** - * __useUpdateOneCompanyMutation__ - * - * To run a mutation, you first call `useUpdateOneCompanyMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateOneCompanyMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [updateOneCompanyMutation, { data, loading, error }] = useUpdateOneCompanyMutation({ - * variables: { - * where: // value for 'where' - * data: // value for 'data' - * }, - * }); - */ -export function useUpdateOneCompanyMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UpdateOneCompanyDocument, options); - } -export type UpdateOneCompanyMutationHookResult = ReturnType; -export type UpdateOneCompanyMutationResult = Apollo.MutationResult; -export type UpdateOneCompanyMutationOptions = Apollo.BaseMutationOptions; -export const InsertOneCompanyDocument = gql` - mutation InsertOneCompany($data: CompanyCreateInput!) { - createOneCompany(data: $data) { - ...CompanyFieldsFragment - } -} - ${CompanyFieldsFragmentFragmentDoc}`; -export type InsertOneCompanyMutationFn = Apollo.MutationFunction; - -/** - * __useInsertOneCompanyMutation__ - * - * To run a mutation, you first call `useInsertOneCompanyMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useInsertOneCompanyMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [insertOneCompanyMutation, { data, loading, error }] = useInsertOneCompanyMutation({ - * variables: { - * data: // value for 'data' - * }, - * }); - */ -export function useInsertOneCompanyMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(InsertOneCompanyDocument, options); - } -export type InsertOneCompanyMutationHookResult = ReturnType; -export type InsertOneCompanyMutationResult = Apollo.MutationResult; -export type InsertOneCompanyMutationOptions = Apollo.BaseMutationOptions; -export const DeleteManyCompaniesDocument = gql` - mutation DeleteManyCompanies($ids: [String!]) { - deleteManyCompany(where: {id: {in: $ids}}) { - count +export const DeleteFavoriteDocument = gql` + mutation DeleteFavorite($where: FavoriteWhereInput!) { + deleteFavorite(where: $where) { + id } } `; -export type DeleteManyCompaniesMutationFn = Apollo.MutationFunction; +export type DeleteFavoriteMutationFn = Apollo.MutationFunction; /** - * __useDeleteManyCompaniesMutation__ + * __useDeleteFavoriteMutation__ * - * To run a mutation, you first call `useDeleteManyCompaniesMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteManyCompaniesMutation` returns a tuple that includes: + * To run a mutation, you first call `useDeleteFavoriteMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useDeleteFavoriteMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [deleteManyCompaniesMutation, { data, loading, error }] = useDeleteManyCompaniesMutation({ + * const [deleteFavoriteMutation, { data, loading, error }] = useDeleteFavoriteMutation({ * variables: { - * ids: // value for 'ids' + * where: // value for 'where' * }, * }); */ -export function useDeleteManyCompaniesMutation(baseOptions?: Apollo.MutationHookOptions) { +export function useDeleteFavoriteMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(DeleteManyCompaniesDocument, options); + return Apollo.useMutation(DeleteFavoriteDocument, options); } -export type DeleteManyCompaniesMutationHookResult = ReturnType; -export type DeleteManyCompaniesMutationResult = Apollo.MutationResult; -export type DeleteManyCompaniesMutationOptions = Apollo.BaseMutationOptions; +export type DeleteFavoriteMutationHookResult = ReturnType; +export type DeleteFavoriteMutationResult = Apollo.MutationResult; +export type DeleteFavoriteMutationOptions = Apollo.BaseMutationOptions; +export const InsertCompanyFavoriteDocument = gql` + mutation InsertCompanyFavorite($data: FavoriteMutationForCompanyArgs!) { + createFavoriteForCompany(data: $data) { + id + company { + id + name + domainName + } + } +} + `; +export type InsertCompanyFavoriteMutationFn = Apollo.MutationFunction; + +/** + * __useInsertCompanyFavoriteMutation__ + * + * To run a mutation, you first call `useInsertCompanyFavoriteMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useInsertCompanyFavoriteMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [insertCompanyFavoriteMutation, { data, loading, error }] = useInsertCompanyFavoriteMutation({ + * variables: { + * data: // value for 'data' + * }, + * }); + */ +export function useInsertCompanyFavoriteMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(InsertCompanyFavoriteDocument, options); + } +export type InsertCompanyFavoriteMutationHookResult = ReturnType; +export type InsertCompanyFavoriteMutationResult = Apollo.MutationResult; +export type InsertCompanyFavoriteMutationOptions = Apollo.BaseMutationOptions; +export const InsertPersonFavoriteDocument = gql` + mutation InsertPersonFavorite($data: FavoriteMutationForPersonArgs!) { + createFavoriteForPerson(data: $data) { + id + person { + id + firstName + lastName + displayName + } + } +} + `; +export type InsertPersonFavoriteMutationFn = Apollo.MutationFunction; + +/** + * __useInsertPersonFavoriteMutation__ + * + * To run a mutation, you first call `useInsertPersonFavoriteMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useInsertPersonFavoriteMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [insertPersonFavoriteMutation, { data, loading, error }] = useInsertPersonFavoriteMutation({ + * variables: { + * data: // value for 'data' + * }, + * }); + */ +export function useInsertPersonFavoriteMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(InsertPersonFavoriteDocument, options); + } +export type InsertPersonFavoriteMutationHookResult = ReturnType; +export type InsertPersonFavoriteMutationResult = Apollo.MutationResult; +export type InsertPersonFavoriteMutationOptions = Apollo.BaseMutationOptions; export const GetFavoritesDocument = gql` query GetFavorites { findFavorites { @@ -4311,116 +4401,187 @@ export function useGetFavoritesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptio export type GetFavoritesQueryHookResult = ReturnType; export type GetFavoritesLazyQueryHookResult = ReturnType; export type GetFavoritesQueryResult = Apollo.QueryResult; -export const InsertPersonFavoriteDocument = gql` - mutation InsertPersonFavorite($data: FavoriteMutationForPersonArgs!) { - createFavoriteForPerson(data: $data) { - id - person { - id - firstName - lastName - displayName - } +export const DeleteManyPersonDocument = gql` + mutation DeleteManyPerson($ids: [String!]) { + deleteManyPerson(where: {id: {in: $ids}}) { + count } } `; -export type InsertPersonFavoriteMutationFn = Apollo.MutationFunction; +export type DeleteManyPersonMutationFn = Apollo.MutationFunction; /** - * __useInsertPersonFavoriteMutation__ + * __useDeleteManyPersonMutation__ * - * To run a mutation, you first call `useInsertPersonFavoriteMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useInsertPersonFavoriteMutation` returns a tuple that includes: + * To run a mutation, you first call `useDeleteManyPersonMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useDeleteManyPersonMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [insertPersonFavoriteMutation, { data, loading, error }] = useInsertPersonFavoriteMutation({ + * const [deleteManyPersonMutation, { data, loading, error }] = useDeleteManyPersonMutation({ + * variables: { + * ids: // value for 'ids' + * }, + * }); + */ +export function useDeleteManyPersonMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(DeleteManyPersonDocument, options); + } +export type DeleteManyPersonMutationHookResult = ReturnType; +export type DeleteManyPersonMutationResult = Apollo.MutationResult; +export type DeleteManyPersonMutationOptions = Apollo.BaseMutationOptions; +export const InsertOnePersonDocument = gql` + mutation InsertOnePerson($data: PersonCreateInput!) { + createOnePerson(data: $data) { + ...InsertPersonFragment + } +} + ${InsertPersonFragmentFragmentDoc}`; +export type InsertOnePersonMutationFn = Apollo.MutationFunction; + +/** + * __useInsertOnePersonMutation__ + * + * To run a mutation, you first call `useInsertOnePersonMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useInsertOnePersonMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [insertOnePersonMutation, { data, loading, error }] = useInsertOnePersonMutation({ * variables: { * data: // value for 'data' * }, * }); */ -export function useInsertPersonFavoriteMutation(baseOptions?: Apollo.MutationHookOptions) { +export function useInsertOnePersonMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(InsertPersonFavoriteDocument, options); + return Apollo.useMutation(InsertOnePersonDocument, options); } -export type InsertPersonFavoriteMutationHookResult = ReturnType; -export type InsertPersonFavoriteMutationResult = Apollo.MutationResult; -export type InsertPersonFavoriteMutationOptions = Apollo.BaseMutationOptions; -export const InsertCompanyFavoriteDocument = gql` - mutation InsertCompanyFavorite($data: FavoriteMutationForCompanyArgs!) { - createFavoriteForCompany(data: $data) { +export type InsertOnePersonMutationHookResult = ReturnType; +export type InsertOnePersonMutationResult = Apollo.MutationResult; +export type InsertOnePersonMutationOptions = Apollo.BaseMutationOptions; +export const RemovePersonPictureDocument = gql` + mutation RemovePersonPicture($where: PersonWhereUniqueInput!) { + updateOnePerson(data: {avatarUrl: null}, where: $where) { id - company { - id - name - domainName - } + avatarUrl } } `; -export type InsertCompanyFavoriteMutationFn = Apollo.MutationFunction; +export type RemovePersonPictureMutationFn = Apollo.MutationFunction; /** - * __useInsertCompanyFavoriteMutation__ + * __useRemovePersonPictureMutation__ * - * To run a mutation, you first call `useInsertCompanyFavoriteMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useInsertCompanyFavoriteMutation` returns a tuple that includes: + * To run a mutation, you first call `useRemovePersonPictureMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useRemovePersonPictureMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [insertCompanyFavoriteMutation, { data, loading, error }] = useInsertCompanyFavoriteMutation({ - * variables: { - * data: // value for 'data' - * }, - * }); - */ -export function useInsertCompanyFavoriteMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(InsertCompanyFavoriteDocument, options); - } -export type InsertCompanyFavoriteMutationHookResult = ReturnType; -export type InsertCompanyFavoriteMutationResult = Apollo.MutationResult; -export type InsertCompanyFavoriteMutationOptions = Apollo.BaseMutationOptions; -export const DeleteFavoriteDocument = gql` - mutation DeleteFavorite($where: FavoriteWhereInput!) { - deleteFavorite(where: $where) { - id - } -} - `; -export type DeleteFavoriteMutationFn = Apollo.MutationFunction; - -/** - * __useDeleteFavoriteMutation__ - * - * To run a mutation, you first call `useDeleteFavoriteMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteFavoriteMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [deleteFavoriteMutation, { data, loading, error }] = useDeleteFavoriteMutation({ + * const [removePersonPictureMutation, { data, loading, error }] = useRemovePersonPictureMutation({ * variables: { * where: // value for 'where' * }, * }); */ -export function useDeleteFavoriteMutation(baseOptions?: Apollo.MutationHookOptions) { +export function useRemovePersonPictureMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(DeleteFavoriteDocument, options); + return Apollo.useMutation(RemovePersonPictureDocument, options); } -export type DeleteFavoriteMutationHookResult = ReturnType; -export type DeleteFavoriteMutationResult = Apollo.MutationResult; -export type DeleteFavoriteMutationOptions = Apollo.BaseMutationOptions; +export type RemovePersonPictureMutationHookResult = ReturnType; +export type RemovePersonPictureMutationResult = Apollo.MutationResult; +export type RemovePersonPictureMutationOptions = Apollo.BaseMutationOptions; +export const UpdateOnePersonDocument = gql` + mutation UpdateOnePerson($where: PersonWhereUniqueInput!, $data: PersonUpdateInput!) { + updateOnePerson(data: $data, where: $where) { + id + city + company { + domainName + name + id + } + email + jobTitle + linkedinUrl + xUrl + firstName + lastName + displayName + phone + createdAt + } +} + `; +export type UpdateOnePersonMutationFn = Apollo.MutationFunction; + +/** + * __useUpdateOnePersonMutation__ + * + * To run a mutation, you first call `useUpdateOnePersonMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useUpdateOnePersonMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [updateOnePersonMutation, { data, loading, error }] = useUpdateOnePersonMutation({ + * variables: { + * where: // value for 'where' + * data: // value for 'data' + * }, + * }); + */ +export function useUpdateOnePersonMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(UpdateOnePersonDocument, options); + } +export type UpdateOnePersonMutationHookResult = ReturnType; +export type UpdateOnePersonMutationResult = Apollo.MutationResult; +export type UpdateOnePersonMutationOptions = Apollo.BaseMutationOptions; +export const UploadPersonPictureDocument = gql` + mutation UploadPersonPicture($id: String!, $file: Upload!) { + uploadPersonPicture(id: $id, file: $file) +} + `; +export type UploadPersonPictureMutationFn = Apollo.MutationFunction; + +/** + * __useUploadPersonPictureMutation__ + * + * To run a mutation, you first call `useUploadPersonPictureMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useUploadPersonPictureMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [uploadPersonPictureMutation, { data, loading, error }] = useUploadPersonPictureMutation({ + * variables: { + * id: // value for 'id' + * file: // value for 'file' + * }, + * }); + */ +export function useUploadPersonPictureMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(UploadPersonPictureDocument, options); + } +export type UploadPersonPictureMutationHookResult = ReturnType; +export type UploadPersonPictureMutationResult = Apollo.MutationResult; +export type UploadPersonPictureMutationOptions = Apollo.BaseMutationOptions; export const GetPeopleDocument = gql` query GetPeople($orderBy: [PersonOrderByWithRelationInput!], $where: PersonWhereInput, $limit: Int) { people: findManyPerson(orderBy: $orderBy, where: $where, take: $limit) { @@ -4475,42 +4636,215 @@ export function useGetPeopleLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions< export type GetPeopleQueryHookResult = ReturnType; export type GetPeopleLazyQueryHookResult = ReturnType; export type GetPeopleQueryResult = Apollo.QueryResult; -export const GetPersonPhoneByIdDocument = gql` - query GetPersonPhoneById($id: String!) { - person: findUniquePerson(id: $id) { +export const GetPersonDocument = gql` + query GetPerson($id: String!) { + findUniquePerson(id: $id) { id + firstName + lastName + displayName + email + createdAt + city + jobTitle + linkedinUrl + xUrl + avatarUrl phone + _activityCount + company { + id + name + domainName + } + Favorite { + id + person { + id + } + company { + id + } + } } } `; /** - * __useGetPersonPhoneByIdQuery__ + * __useGetPersonQuery__ * - * To run a query within a React component, call `useGetPersonPhoneByIdQuery` and pass it any options that fit your needs. - * When your component renders, `useGetPersonPhoneByIdQuery` returns an object from Apollo Client that contains loading, error, and data properties + * To run a query within a React component, call `useGetPersonQuery` and pass it any options that fit your needs. + * When your component renders, `useGetPersonQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example - * const { data, loading, error } = useGetPersonPhoneByIdQuery({ + * const { data, loading, error } = useGetPersonQuery({ * variables: { * id: // value for 'id' * }, * }); */ -export function useGetPersonPhoneByIdQuery(baseOptions: Apollo.QueryHookOptions) { +export function useGetPersonQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetPersonPhoneByIdDocument, options); + return Apollo.useQuery(GetPersonDocument, options); } -export function useGetPersonPhoneByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useGetPersonLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetPersonPhoneByIdDocument, options); + return Apollo.useLazyQuery(GetPersonDocument, options); } -export type GetPersonPhoneByIdQueryHookResult = ReturnType; -export type GetPersonPhoneByIdLazyQueryHookResult = ReturnType; -export type GetPersonPhoneByIdQueryResult = Apollo.QueryResult; +export type GetPersonQueryHookResult = ReturnType; +export type GetPersonLazyQueryHookResult = ReturnType; +export type GetPersonQueryResult = Apollo.QueryResult; +export const GetPersonCityByIdDocument = gql` + query GetPersonCityById($id: String!) { + person: findUniquePerson(id: $id) { + id + city + } +} + `; + +/** + * __useGetPersonCityByIdQuery__ + * + * To run a query within a React component, call `useGetPersonCityByIdQuery` and pass it any options that fit your needs. + * When your component renders, `useGetPersonCityByIdQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetPersonCityByIdQuery({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useGetPersonCityByIdQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetPersonCityByIdDocument, options); + } +export function useGetPersonCityByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetPersonCityByIdDocument, options); + } +export type GetPersonCityByIdQueryHookResult = ReturnType; +export type GetPersonCityByIdLazyQueryHookResult = ReturnType; +export type GetPersonCityByIdQueryResult = Apollo.QueryResult; +export const GetPersonCommentCountByIdDocument = gql` + query GetPersonCommentCountById($id: String!) { + person: findUniquePerson(id: $id) { + id + _activityCount + } +} + `; + +/** + * __useGetPersonCommentCountByIdQuery__ + * + * To run a query within a React component, call `useGetPersonCommentCountByIdQuery` and pass it any options that fit your needs. + * When your component renders, `useGetPersonCommentCountByIdQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetPersonCommentCountByIdQuery({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useGetPersonCommentCountByIdQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetPersonCommentCountByIdDocument, options); + } +export function useGetPersonCommentCountByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetPersonCommentCountByIdDocument, options); + } +export type GetPersonCommentCountByIdQueryHookResult = ReturnType; +export type GetPersonCommentCountByIdLazyQueryHookResult = ReturnType; +export type GetPersonCommentCountByIdQueryResult = Apollo.QueryResult; +export const GetPersonCompanyByIdDocument = gql` + query GetPersonCompanyById($id: String!) { + person: findUniquePerson(id: $id) { + id + company { + id + name + domainName + } + } +} + `; + +/** + * __useGetPersonCompanyByIdQuery__ + * + * To run a query within a React component, call `useGetPersonCompanyByIdQuery` and pass it any options that fit your needs. + * When your component renders, `useGetPersonCompanyByIdQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetPersonCompanyByIdQuery({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useGetPersonCompanyByIdQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetPersonCompanyByIdDocument, options); + } +export function useGetPersonCompanyByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetPersonCompanyByIdDocument, options); + } +export type GetPersonCompanyByIdQueryHookResult = ReturnType; +export type GetPersonCompanyByIdLazyQueryHookResult = ReturnType; +export type GetPersonCompanyByIdQueryResult = Apollo.QueryResult; +export const GetPersonCreatedAtByIdDocument = gql` + query GetPersonCreatedAtById($id: String!) { + person: findUniquePerson(id: $id) { + id + createdAt + } +} + `; + +/** + * __useGetPersonCreatedAtByIdQuery__ + * + * To run a query within a React component, call `useGetPersonCreatedAtByIdQuery` and pass it any options that fit your needs. + * When your component renders, `useGetPersonCreatedAtByIdQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetPersonCreatedAtByIdQuery({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useGetPersonCreatedAtByIdQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetPersonCreatedAtByIdDocument, options); + } +export function useGetPersonCreatedAtByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetPersonCreatedAtByIdDocument, options); + } +export type GetPersonCreatedAtByIdQueryHookResult = ReturnType; +export type GetPersonCreatedAtByIdLazyQueryHookResult = ReturnType; +export type GetPersonCreatedAtByIdQueryResult = Apollo.QueryResult; export const GetPersonEmailByIdDocument = gql` query GetPersonEmailById($id: String!) { person: findUniquePerson(id: $id) { @@ -4586,489 +4920,80 @@ export function useGetPersonNamesAndCommentCountByIdLazyQuery(baseOptions?: Apol export type GetPersonNamesAndCommentCountByIdQueryHookResult = ReturnType; export type GetPersonNamesAndCommentCountByIdLazyQueryHookResult = ReturnType; export type GetPersonNamesAndCommentCountByIdQueryResult = Apollo.QueryResult; -export const GetPersonCompanyByIdDocument = gql` - query GetPersonCompanyById($id: String!) { +export const GetPersonPhoneByIdDocument = gql` + query GetPersonPhoneById($id: String!) { person: findUniquePerson(id: $id) { id - company { - id - name - domainName - } - } -} - `; - -/** - * __useGetPersonCompanyByIdQuery__ - * - * To run a query within a React component, call `useGetPersonCompanyByIdQuery` and pass it any options that fit your needs. - * When your component renders, `useGetPersonCompanyByIdQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetPersonCompanyByIdQuery({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useGetPersonCompanyByIdQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetPersonCompanyByIdDocument, options); - } -export function useGetPersonCompanyByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetPersonCompanyByIdDocument, options); - } -export type GetPersonCompanyByIdQueryHookResult = ReturnType; -export type GetPersonCompanyByIdLazyQueryHookResult = ReturnType; -export type GetPersonCompanyByIdQueryResult = Apollo.QueryResult; -export const GetPersonCommentCountByIdDocument = gql` - query GetPersonCommentCountById($id: String!) { - person: findUniquePerson(id: $id) { - id - _activityCount - } -} - `; - -/** - * __useGetPersonCommentCountByIdQuery__ - * - * To run a query within a React component, call `useGetPersonCommentCountByIdQuery` and pass it any options that fit your needs. - * When your component renders, `useGetPersonCommentCountByIdQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetPersonCommentCountByIdQuery({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useGetPersonCommentCountByIdQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetPersonCommentCountByIdDocument, options); - } -export function useGetPersonCommentCountByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetPersonCommentCountByIdDocument, options); - } -export type GetPersonCommentCountByIdQueryHookResult = ReturnType; -export type GetPersonCommentCountByIdLazyQueryHookResult = ReturnType; -export type GetPersonCommentCountByIdQueryResult = Apollo.QueryResult; -export const GetPersonCreatedAtByIdDocument = gql` - query GetPersonCreatedAtById($id: String!) { - person: findUniquePerson(id: $id) { - id - createdAt - } -} - `; - -/** - * __useGetPersonCreatedAtByIdQuery__ - * - * To run a query within a React component, call `useGetPersonCreatedAtByIdQuery` and pass it any options that fit your needs. - * When your component renders, `useGetPersonCreatedAtByIdQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetPersonCreatedAtByIdQuery({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useGetPersonCreatedAtByIdQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetPersonCreatedAtByIdDocument, options); - } -export function useGetPersonCreatedAtByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetPersonCreatedAtByIdDocument, options); - } -export type GetPersonCreatedAtByIdQueryHookResult = ReturnType; -export type GetPersonCreatedAtByIdLazyQueryHookResult = ReturnType; -export type GetPersonCreatedAtByIdQueryResult = Apollo.QueryResult; -export const GetPersonCityByIdDocument = gql` - query GetPersonCityById($id: String!) { - person: findUniquePerson(id: $id) { - id - city - } -} - `; - -/** - * __useGetPersonCityByIdQuery__ - * - * To run a query within a React component, call `useGetPersonCityByIdQuery` and pass it any options that fit your needs. - * When your component renders, `useGetPersonCityByIdQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetPersonCityByIdQuery({ - * variables: { - * id: // value for 'id' - * }, - * }); - */ -export function useGetPersonCityByIdQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetPersonCityByIdDocument, options); - } -export function useGetPersonCityByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetPersonCityByIdDocument, options); - } -export type GetPersonCityByIdQueryHookResult = ReturnType; -export type GetPersonCityByIdLazyQueryHookResult = ReturnType; -export type GetPersonCityByIdQueryResult = Apollo.QueryResult; -export const GetPersonDocument = gql` - query GetPerson($id: String!) { - findUniquePerson(id: $id) { - id - firstName - lastName - displayName - email - createdAt - city - jobTitle - linkedinUrl - xUrl - avatarUrl phone - _activityCount - company { - id - name - domainName - } - Favorite { - id - person { - id - } - company { - id - } - } } } `; /** - * __useGetPersonQuery__ + * __useGetPersonPhoneByIdQuery__ * - * To run a query within a React component, call `useGetPersonQuery` and pass it any options that fit your needs. - * When your component renders, `useGetPersonQuery` returns an object from Apollo Client that contains loading, error, and data properties + * To run a query within a React component, call `useGetPersonPhoneByIdQuery` and pass it any options that fit your needs. + * When your component renders, `useGetPersonPhoneByIdQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example - * const { data, loading, error } = useGetPersonQuery({ + * const { data, loading, error } = useGetPersonPhoneByIdQuery({ * variables: { * id: // value for 'id' * }, * }); */ -export function useGetPersonQuery(baseOptions: Apollo.QueryHookOptions) { +export function useGetPersonPhoneByIdQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetPersonDocument, options); + return Apollo.useQuery(GetPersonPhoneByIdDocument, options); } -export function useGetPersonLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useGetPersonPhoneByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetPersonDocument, options); + return Apollo.useLazyQuery(GetPersonPhoneByIdDocument, options); } -export type GetPersonQueryHookResult = ReturnType; -export type GetPersonLazyQueryHookResult = ReturnType; -export type GetPersonQueryResult = Apollo.QueryResult; -export const UpdateOnePersonDocument = gql` - mutation UpdateOnePerson($where: PersonWhereUniqueInput!, $data: PersonUpdateInput!) { - updateOnePerson(data: $data, where: $where) { +export type GetPersonPhoneByIdQueryHookResult = ReturnType; +export type GetPersonPhoneByIdLazyQueryHookResult = ReturnType; +export type GetPersonPhoneByIdQueryResult = Apollo.QueryResult; +export const CreateOneCompanyPipelineProgressDocument = gql` + mutation CreateOneCompanyPipelineProgress($uuid: String!, $companyId: String!, $pipelineId: String!, $pipelineStageId: String!) { + createOnePipelineProgress( + data: {id: $uuid, company: {connect: {id: $companyId}}, pipeline: {connect: {id: $pipelineId}}, pipelineStage: {connect: {id: $pipelineStageId}}} + ) { id - city - company { - domainName - name - id - } - email - jobTitle - linkedinUrl - xUrl - firstName - lastName - displayName - phone - createdAt } } `; -export type UpdateOnePersonMutationFn = Apollo.MutationFunction; +export type CreateOneCompanyPipelineProgressMutationFn = Apollo.MutationFunction; /** - * __useUpdateOnePersonMutation__ + * __useCreateOneCompanyPipelineProgressMutation__ * - * To run a mutation, you first call `useUpdateOnePersonMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateOnePersonMutation` returns a tuple that includes: + * To run a mutation, you first call `useCreateOneCompanyPipelineProgressMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useCreateOneCompanyPipelineProgressMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [updateOnePersonMutation, { data, loading, error }] = useUpdateOnePersonMutation({ + * const [createOneCompanyPipelineProgressMutation, { data, loading, error }] = useCreateOneCompanyPipelineProgressMutation({ * variables: { - * where: // value for 'where' - * data: // value for 'data' + * uuid: // value for 'uuid' + * companyId: // value for 'companyId' + * pipelineId: // value for 'pipelineId' + * pipelineStageId: // value for 'pipelineStageId' * }, * }); */ -export function useUpdateOnePersonMutation(baseOptions?: Apollo.MutationHookOptions) { +export function useCreateOneCompanyPipelineProgressMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UpdateOnePersonDocument, options); + return Apollo.useMutation(CreateOneCompanyPipelineProgressDocument, options); } -export type UpdateOnePersonMutationHookResult = ReturnType; -export type UpdateOnePersonMutationResult = Apollo.MutationResult; -export type UpdateOnePersonMutationOptions = Apollo.BaseMutationOptions; -export const InsertOnePersonDocument = gql` - mutation InsertOnePerson($data: PersonCreateInput!) { - createOnePerson(data: $data) { - ...InsertPersonFragment - } -} - ${InsertPersonFragmentFragmentDoc}`; -export type InsertOnePersonMutationFn = Apollo.MutationFunction; - -/** - * __useInsertOnePersonMutation__ - * - * To run a mutation, you first call `useInsertOnePersonMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useInsertOnePersonMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [insertOnePersonMutation, { data, loading, error }] = useInsertOnePersonMutation({ - * variables: { - * data: // value for 'data' - * }, - * }); - */ -export function useInsertOnePersonMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(InsertOnePersonDocument, options); - } -export type InsertOnePersonMutationHookResult = ReturnType; -export type InsertOnePersonMutationResult = Apollo.MutationResult; -export type InsertOnePersonMutationOptions = Apollo.BaseMutationOptions; -export const DeleteManyPersonDocument = gql` - mutation DeleteManyPerson($ids: [String!]) { - deleteManyPerson(where: {id: {in: $ids}}) { - count - } -} - `; -export type DeleteManyPersonMutationFn = Apollo.MutationFunction; - -/** - * __useDeleteManyPersonMutation__ - * - * To run a mutation, you first call `useDeleteManyPersonMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteManyPersonMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [deleteManyPersonMutation, { data, loading, error }] = useDeleteManyPersonMutation({ - * variables: { - * ids: // value for 'ids' - * }, - * }); - */ -export function useDeleteManyPersonMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(DeleteManyPersonDocument, options); - } -export type DeleteManyPersonMutationHookResult = ReturnType; -export type DeleteManyPersonMutationResult = Apollo.MutationResult; -export type DeleteManyPersonMutationOptions = Apollo.BaseMutationOptions; -export const UploadPersonPictureDocument = gql` - mutation UploadPersonPicture($id: String!, $file: Upload!) { - uploadPersonPicture(id: $id, file: $file) -} - `; -export type UploadPersonPictureMutationFn = Apollo.MutationFunction; - -/** - * __useUploadPersonPictureMutation__ - * - * To run a mutation, you first call `useUploadPersonPictureMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUploadPersonPictureMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [uploadPersonPictureMutation, { data, loading, error }] = useUploadPersonPictureMutation({ - * variables: { - * id: // value for 'id' - * file: // value for 'file' - * }, - * }); - */ -export function useUploadPersonPictureMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UploadPersonPictureDocument, options); - } -export type UploadPersonPictureMutationHookResult = ReturnType; -export type UploadPersonPictureMutationResult = Apollo.MutationResult; -export type UploadPersonPictureMutationOptions = Apollo.BaseMutationOptions; -export const RemovePersonPictureDocument = gql` - mutation RemovePersonPicture($where: PersonWhereUniqueInput!) { - updateOnePerson(data: {avatarUrl: null}, where: $where) { - id - avatarUrl - } -} - `; -export type RemovePersonPictureMutationFn = Apollo.MutationFunction; - -/** - * __useRemovePersonPictureMutation__ - * - * To run a mutation, you first call `useRemovePersonPictureMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useRemovePersonPictureMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [removePersonPictureMutation, { data, loading, error }] = useRemovePersonPictureMutation({ - * variables: { - * where: // value for 'where' - * }, - * }); - */ -export function useRemovePersonPictureMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(RemovePersonPictureDocument, options); - } -export type RemovePersonPictureMutationHookResult = ReturnType; -export type RemovePersonPictureMutationResult = Apollo.MutationResult; -export type RemovePersonPictureMutationOptions = Apollo.BaseMutationOptions; -export const GetPipelinesDocument = gql` - query GetPipelines($where: PipelineWhereInput) { - findManyPipeline(where: $where) { - id - name - pipelineProgressableType - pipelineStages { - id - name - color - index - } - } -} - `; - -/** - * __useGetPipelinesQuery__ - * - * To run a query within a React component, call `useGetPipelinesQuery` and pass it any options that fit your needs. - * When your component renders, `useGetPipelinesQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetPipelinesQuery({ - * variables: { - * where: // value for 'where' - * }, - * }); - */ -export function useGetPipelinesQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetPipelinesDocument, options); - } -export function useGetPipelinesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetPipelinesDocument, options); - } -export type GetPipelinesQueryHookResult = ReturnType; -export type GetPipelinesLazyQueryHookResult = ReturnType; -export type GetPipelinesQueryResult = Apollo.QueryResult; -export const GetPipelineProgressDocument = gql` - query GetPipelineProgress($where: PipelineProgressWhereInput, $orderBy: [PipelineProgressOrderByWithRelationInput!]) { - findManyPipelineProgress(where: $where, orderBy: $orderBy) { - id - pipelineStageId - companyId - personId - amount - closeDate - pointOfContactId - pointOfContact { - id - firstName - lastName - displayName - avatarUrl - } - probability - } -} - `; - -/** - * __useGetPipelineProgressQuery__ - * - * To run a query within a React component, call `useGetPipelineProgressQuery` and pass it any options that fit your needs. - * When your component renders, `useGetPipelineProgressQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetPipelineProgressQuery({ - * variables: { - * where: // value for 'where' - * orderBy: // value for 'orderBy' - * }, - * }); - */ -export function useGetPipelineProgressQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetPipelineProgressDocument, options); - } -export function useGetPipelineProgressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetPipelineProgressDocument, options); - } -export type GetPipelineProgressQueryHookResult = ReturnType; -export type GetPipelineProgressLazyQueryHookResult = ReturnType; -export type GetPipelineProgressQueryResult = Apollo.QueryResult; +export type CreateOneCompanyPipelineProgressMutationHookResult = ReturnType; +export type CreateOneCompanyPipelineProgressMutationResult = Apollo.MutationResult; +export type CreateOneCompanyPipelineProgressMutationOptions = Apollo.BaseMutationOptions; export const DeleteManyPipelineProgressDocument = gql` mutation DeleteManyPipelineProgress($ids: [String!]) { deleteManyPipelineProgress(where: {id: {in: $ids}}) { @@ -5102,42 +5027,6 @@ export function useDeleteManyPipelineProgressMutation(baseOptions?: Apollo.Mutat export type DeleteManyPipelineProgressMutationHookResult = ReturnType; export type DeleteManyPipelineProgressMutationResult = Apollo.MutationResult; export type DeleteManyPipelineProgressMutationOptions = Apollo.BaseMutationOptions; -export const UpdatePipelineStageDocument = gql` - mutation UpdatePipelineStage($id: String, $data: PipelineStageUpdateInput!) { - updateOnePipelineStage(where: {id: $id}, data: $data) { - id - name - color - } -} - `; -export type UpdatePipelineStageMutationFn = Apollo.MutationFunction; - -/** - * __useUpdatePipelineStageMutation__ - * - * To run a mutation, you first call `useUpdatePipelineStageMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdatePipelineStageMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [updatePipelineStageMutation, { data, loading, error }] = useUpdatePipelineStageMutation({ - * variables: { - * id: // value for 'id' - * data: // value for 'data' - * }, - * }); - */ -export function useUpdatePipelineStageMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UpdatePipelineStageDocument, options); - } -export type UpdatePipelineStageMutationHookResult = ReturnType; -export type UpdatePipelineStageMutationResult = Apollo.MutationResult; -export type UpdatePipelineStageMutationOptions = Apollo.BaseMutationOptions; export const UpdateOnePipelineProgressDocument = gql` mutation UpdateOnePipelineProgress($data: PipelineProgressUpdateInput!, $where: PipelineProgressWhereUniqueInput!) { updateOnePipelineProgress(where: $where, data: $data) { @@ -5215,44 +5104,215 @@ export function useUpdateOnePipelineProgressStageMutation(baseOptions?: Apollo.M export type UpdateOnePipelineProgressStageMutationHookResult = ReturnType; export type UpdateOnePipelineProgressStageMutationResult = Apollo.MutationResult; export type UpdateOnePipelineProgressStageMutationOptions = Apollo.BaseMutationOptions; -export const CreateOneCompanyPipelineProgressDocument = gql` - mutation CreateOneCompanyPipelineProgress($uuid: String!, $companyId: String!, $pipelineId: String!, $pipelineStageId: String!) { - createOnePipelineProgress( - data: {id: $uuid, company: {connect: {id: $companyId}}, pipeline: {connect: {id: $pipelineId}}, pipelineStage: {connect: {id: $pipelineStageId}}} - ) { +export const UpdatePipelineStageDocument = gql` + mutation UpdatePipelineStage($id: String, $data: PipelineStageUpdateInput!) { + updateOnePipelineStage(where: {id: $id}, data: $data) { id + name + color } } `; -export type CreateOneCompanyPipelineProgressMutationFn = Apollo.MutationFunction; +export type UpdatePipelineStageMutationFn = Apollo.MutationFunction; /** - * __useCreateOneCompanyPipelineProgressMutation__ + * __useUpdatePipelineStageMutation__ * - * To run a mutation, you first call `useCreateOneCompanyPipelineProgressMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useCreateOneCompanyPipelineProgressMutation` returns a tuple that includes: + * To run a mutation, you first call `useUpdatePipelineStageMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useUpdatePipelineStageMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [createOneCompanyPipelineProgressMutation, { data, loading, error }] = useCreateOneCompanyPipelineProgressMutation({ + * const [updatePipelineStageMutation, { data, loading, error }] = useUpdatePipelineStageMutation({ * variables: { - * uuid: // value for 'uuid' - * companyId: // value for 'companyId' - * pipelineId: // value for 'pipelineId' - * pipelineStageId: // value for 'pipelineStageId' + * id: // value for 'id' + * data: // value for 'data' * }, * }); */ -export function useCreateOneCompanyPipelineProgressMutation(baseOptions?: Apollo.MutationHookOptions) { +export function useUpdatePipelineStageMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(CreateOneCompanyPipelineProgressDocument, options); + return Apollo.useMutation(UpdatePipelineStageDocument, options); } -export type CreateOneCompanyPipelineProgressMutationHookResult = ReturnType; -export type CreateOneCompanyPipelineProgressMutationResult = Apollo.MutationResult; -export type CreateOneCompanyPipelineProgressMutationOptions = Apollo.BaseMutationOptions; +export type UpdatePipelineStageMutationHookResult = ReturnType; +export type UpdatePipelineStageMutationResult = Apollo.MutationResult; +export type UpdatePipelineStageMutationOptions = Apollo.BaseMutationOptions; +export const GetPipelineProgressDocument = gql` + query GetPipelineProgress($where: PipelineProgressWhereInput, $orderBy: [PipelineProgressOrderByWithRelationInput!]) { + findManyPipelineProgress(where: $where, orderBy: $orderBy) { + id + pipelineStageId + companyId + personId + amount + closeDate + pointOfContactId + pointOfContact { + id + firstName + lastName + displayName + avatarUrl + } + probability + } +} + `; + +/** + * __useGetPipelineProgressQuery__ + * + * To run a query within a React component, call `useGetPipelineProgressQuery` and pass it any options that fit your needs. + * When your component renders, `useGetPipelineProgressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetPipelineProgressQuery({ + * variables: { + * where: // value for 'where' + * orderBy: // value for 'orderBy' + * }, + * }); + */ +export function useGetPipelineProgressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetPipelineProgressDocument, options); + } +export function useGetPipelineProgressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetPipelineProgressDocument, options); + } +export type GetPipelineProgressQueryHookResult = ReturnType; +export type GetPipelineProgressLazyQueryHookResult = ReturnType; +export type GetPipelineProgressQueryResult = Apollo.QueryResult; +export const GetPipelinesDocument = gql` + query GetPipelines($where: PipelineWhereInput) { + findManyPipeline(where: $where) { + id + name + pipelineProgressableType + pipelineStages { + id + name + color + index + } + } +} + `; + +/** + * __useGetPipelinesQuery__ + * + * To run a query within a React component, call `useGetPipelinesQuery` and pass it any options that fit your needs. + * When your component renders, `useGetPipelinesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetPipelinesQuery({ + * variables: { + * where: // value for 'where' + * }, + * }); + */ +export function useGetPipelinesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetPipelinesDocument, options); + } +export function useGetPipelinesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetPipelinesDocument, options); + } +export type GetPipelinesQueryHookResult = ReturnType; +export type GetPipelinesLazyQueryHookResult = ReturnType; +export type GetPipelinesQueryResult = Apollo.QueryResult; +export const SearchActivityDocument = gql` + query SearchActivity($where: ActivityWhereInput, $limit: Int, $orderBy: [ActivityOrderByWithRelationInput!]) { + searchResults: findManyActivities( + where: $where + take: $limit + orderBy: $orderBy + ) { + id + title + body + } +} + `; + +/** + * __useSearchActivityQuery__ + * + * To run a query within a React component, call `useSearchActivityQuery` and pass it any options that fit your needs. + * When your component renders, `useSearchActivityQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useSearchActivityQuery({ + * variables: { + * where: // value for 'where' + * limit: // value for 'limit' + * orderBy: // value for 'orderBy' + * }, + * }); + */ +export function useSearchActivityQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(SearchActivityDocument, options); + } +export function useSearchActivityLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(SearchActivityDocument, options); + } +export type SearchActivityQueryHookResult = ReturnType; +export type SearchActivityLazyQueryHookResult = ReturnType; +export type SearchActivityQueryResult = Apollo.QueryResult; +export const SearchCompanyDocument = gql` + query SearchCompany($where: CompanyWhereInput, $limit: Int, $orderBy: [CompanyOrderByWithRelationInput!]) { + searchResults: findManyCompany(where: $where, take: $limit, orderBy: $orderBy) { + ...CompanyFieldsFragment + } +} + ${CompanyFieldsFragmentFragmentDoc}`; + +/** + * __useSearchCompanyQuery__ + * + * To run a query within a React component, call `useSearchCompanyQuery` and pass it any options that fit your needs. + * When your component renders, `useSearchCompanyQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useSearchCompanyQuery({ + * variables: { + * where: // value for 'where' + * limit: // value for 'limit' + * orderBy: // value for 'orderBy' + * }, + * }); + */ +export function useSearchCompanyQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(SearchCompanyDocument, options); + } +export function useSearchCompanyLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(SearchCompanyDocument, options); + } +export type SearchCompanyQueryHookResult = ReturnType; +export type SearchCompanyLazyQueryHookResult = ReturnType; +export type SearchCompanyQueryResult = Apollo.QueryResult; export const SearchPeopleDocument = gql` query SearchPeople($where: PersonWhereInput, $limit: Int, $orderBy: [PersonOrderByWithRelationInput!]) { searchResults: findManyPerson(where: $where, take: $limit, orderBy: $orderBy) { @@ -5340,120 +5400,191 @@ export function useSearchUserLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type SearchUserQueryHookResult = ReturnType; export type SearchUserLazyQueryHookResult = ReturnType; export type SearchUserQueryResult = Apollo.QueryResult; -export const EmptyQueryDocument = gql` - query EmptyQuery { - searchResults: findManyUser { +export const DeleteUserAccountDocument = gql` + mutation DeleteUserAccount { + deleteUserAccount { id } } `; +export type DeleteUserAccountMutationFn = Apollo.MutationFunction; /** - * __useEmptyQueryQuery__ + * __useDeleteUserAccountMutation__ * - * To run a query within a React component, call `useEmptyQueryQuery` and pass it any options that fit your needs. - * When your component renders, `useEmptyQueryQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. + * To run a mutation, you first call `useDeleteUserAccountMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useDeleteUserAccountMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const { data, loading, error } = useEmptyQueryQuery({ + * const [deleteUserAccountMutation, { data, loading, error }] = useDeleteUserAccountMutation({ * variables: { * }, * }); */ -export function useEmptyQueryQuery(baseOptions?: Apollo.QueryHookOptions) { +export function useDeleteUserAccountMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(EmptyQueryDocument, options); + return Apollo.useMutation(DeleteUserAccountDocument, options); } -export function useEmptyQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(EmptyQueryDocument, options); - } -export type EmptyQueryQueryHookResult = ReturnType; -export type EmptyQueryLazyQueryHookResult = ReturnType; -export type EmptyQueryQueryResult = Apollo.QueryResult; -export const SearchCompanyDocument = gql` - query SearchCompany($where: CompanyWhereInput, $limit: Int, $orderBy: [CompanyOrderByWithRelationInput!]) { - searchResults: findManyCompany(where: $where, take: $limit, orderBy: $orderBy) { - ...CompanyFieldsFragment - } -} - ${CompanyFieldsFragmentFragmentDoc}`; - -/** - * __useSearchCompanyQuery__ - * - * To run a query within a React component, call `useSearchCompanyQuery` and pass it any options that fit your needs. - * When your component renders, `useSearchCompanyQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useSearchCompanyQuery({ - * variables: { - * where: // value for 'where' - * limit: // value for 'limit' - * orderBy: // value for 'orderBy' - * }, - * }); - */ -export function useSearchCompanyQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(SearchCompanyDocument, options); - } -export function useSearchCompanyLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(SearchCompanyDocument, options); - } -export type SearchCompanyQueryHookResult = ReturnType; -export type SearchCompanyLazyQueryHookResult = ReturnType; -export type SearchCompanyQueryResult = Apollo.QueryResult; -export const SearchActivityDocument = gql` - query SearchActivity($where: ActivityWhereInput, $limit: Int, $orderBy: [ActivityOrderByWithRelationInput!]) { - searchResults: findManyActivities( - where: $where - take: $limit - orderBy: $orderBy - ) { +export type DeleteUserAccountMutationHookResult = ReturnType; +export type DeleteUserAccountMutationResult = Apollo.MutationResult; +export type DeleteUserAccountMutationOptions = Apollo.BaseMutationOptions; +export const RemoveProfilePictureDocument = gql` + mutation RemoveProfilePicture($where: UserWhereUniqueInput!) { + updateUser(data: {avatarUrl: null}, where: $where) { id - title - body + avatarUrl } } `; +export type RemoveProfilePictureMutationFn = Apollo.MutationFunction; /** - * __useSearchActivityQuery__ + * __useRemoveProfilePictureMutation__ * - * To run a query within a React component, call `useSearchActivityQuery` and pass it any options that fit your needs. - * When your component renders, `useSearchActivityQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. + * To run a mutation, you first call `useRemoveProfilePictureMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useRemoveProfilePictureMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const { data, loading, error } = useSearchActivityQuery({ + * const [removeProfilePictureMutation, { data, loading, error }] = useRemoveProfilePictureMutation({ * variables: { * where: // value for 'where' - * limit: // value for 'limit' - * orderBy: // value for 'orderBy' * }, * }); */ -export function useSearchActivityQuery(baseOptions?: Apollo.QueryHookOptions) { +export function useRemoveProfilePictureMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(SearchActivityDocument, options); + return Apollo.useMutation(RemoveProfilePictureDocument, options); } -export function useSearchActivityLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(SearchActivityDocument, options); - } -export type SearchActivityQueryHookResult = ReturnType; -export type SearchActivityLazyQueryHookResult = ReturnType; -export type SearchActivityQueryResult = Apollo.QueryResult; +export type RemoveProfilePictureMutationHookResult = ReturnType; +export type RemoveProfilePictureMutationResult = Apollo.MutationResult; +export type RemoveProfilePictureMutationOptions = Apollo.BaseMutationOptions; +export const UpdateAllowImpersonationDocument = gql` + mutation UpdateAllowImpersonation($allowImpersonation: Boolean!) { + allowImpersonation(allowImpersonation: $allowImpersonation) { + id + allowImpersonation + } +} + `; +export type UpdateAllowImpersonationMutationFn = Apollo.MutationFunction; + +/** + * __useUpdateAllowImpersonationMutation__ + * + * To run a mutation, you first call `useUpdateAllowImpersonationMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useUpdateAllowImpersonationMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [updateAllowImpersonationMutation, { data, loading, error }] = useUpdateAllowImpersonationMutation({ + * variables: { + * allowImpersonation: // value for 'allowImpersonation' + * }, + * }); + */ +export function useUpdateAllowImpersonationMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(UpdateAllowImpersonationDocument, options); + } +export type UpdateAllowImpersonationMutationHookResult = ReturnType; +export type UpdateAllowImpersonationMutationResult = Apollo.MutationResult; +export type UpdateAllowImpersonationMutationOptions = Apollo.BaseMutationOptions; +export const UploadProfilePictureDocument = gql` + mutation UploadProfilePicture($file: Upload!) { + uploadProfilePicture(file: $file) +} + `; +export type UploadProfilePictureMutationFn = Apollo.MutationFunction; + +/** + * __useUploadProfilePictureMutation__ + * + * To run a mutation, you first call `useUploadProfilePictureMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useUploadProfilePictureMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [uploadProfilePictureMutation, { data, loading, error }] = useUploadProfilePictureMutation({ + * variables: { + * file: // value for 'file' + * }, + * }); + */ +export function useUploadProfilePictureMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(UploadProfilePictureDocument, options); + } +export type UploadProfilePictureMutationHookResult = ReturnType; +export type UploadProfilePictureMutationResult = Apollo.MutationResult; +export type UploadProfilePictureMutationOptions = Apollo.BaseMutationOptions; +export const UpdateUserDocument = gql` + mutation UpdateUser($data: UserUpdateInput!, $where: UserWhereUniqueInput!) { + updateUser(data: $data, where: $where) { + id + email + displayName + firstName + lastName + avatarUrl + workspaceMember { + id + workspace { + id + domainName + displayName + logo + inviteHash + } + } + settings { + id + locale + colorScheme + } + } +} + `; +export type UpdateUserMutationFn = Apollo.MutationFunction; + +/** + * __useUpdateUserMutation__ + * + * To run a mutation, you first call `useUpdateUserMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useUpdateUserMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [updateUserMutation, { data, loading, error }] = useUpdateUserMutation({ + * variables: { + * data: // value for 'data' + * where: // value for 'where' + * }, + * }); + */ +export function useUpdateUserMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(UpdateUserDocument, options); + } +export type UpdateUserMutationHookResult = ReturnType; +export type UpdateUserMutationResult = Apollo.MutationResult; +export type UpdateUserMutationOptions = Apollo.BaseMutationOptions; export const GetCurrentUserDocument = gql` query GetCurrentUser { currentUser { @@ -5549,191 +5680,6 @@ export function useGetUsersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions; export type GetUsersLazyQueryHookResult = ReturnType; export type GetUsersQueryResult = Apollo.QueryResult; -export const UpdateUserDocument = gql` - mutation UpdateUser($data: UserUpdateInput!, $where: UserWhereUniqueInput!) { - updateUser(data: $data, where: $where) { - id - email - displayName - firstName - lastName - avatarUrl - workspaceMember { - id - workspace { - id - domainName - displayName - logo - inviteHash - } - } - settings { - id - locale - colorScheme - } - } -} - `; -export type UpdateUserMutationFn = Apollo.MutationFunction; - -/** - * __useUpdateUserMutation__ - * - * To run a mutation, you first call `useUpdateUserMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateUserMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [updateUserMutation, { data, loading, error }] = useUpdateUserMutation({ - * variables: { - * data: // value for 'data' - * where: // value for 'where' - * }, - * }); - */ -export function useUpdateUserMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UpdateUserDocument, options); - } -export type UpdateUserMutationHookResult = ReturnType; -export type UpdateUserMutationResult = Apollo.MutationResult; -export type UpdateUserMutationOptions = Apollo.BaseMutationOptions; -export const UpdateAllowImpersonationDocument = gql` - mutation UpdateAllowImpersonation($allowImpersonation: Boolean!) { - allowImpersonation(allowImpersonation: $allowImpersonation) { - id - allowImpersonation - } -} - `; -export type UpdateAllowImpersonationMutationFn = Apollo.MutationFunction; - -/** - * __useUpdateAllowImpersonationMutation__ - * - * To run a mutation, you first call `useUpdateAllowImpersonationMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateAllowImpersonationMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [updateAllowImpersonationMutation, { data, loading, error }] = useUpdateAllowImpersonationMutation({ - * variables: { - * allowImpersonation: // value for 'allowImpersonation' - * }, - * }); - */ -export function useUpdateAllowImpersonationMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UpdateAllowImpersonationDocument, options); - } -export type UpdateAllowImpersonationMutationHookResult = ReturnType; -export type UpdateAllowImpersonationMutationResult = Apollo.MutationResult; -export type UpdateAllowImpersonationMutationOptions = Apollo.BaseMutationOptions; -export const UploadProfilePictureDocument = gql` - mutation UploadProfilePicture($file: Upload!) { - uploadProfilePicture(file: $file) -} - `; -export type UploadProfilePictureMutationFn = Apollo.MutationFunction; - -/** - * __useUploadProfilePictureMutation__ - * - * To run a mutation, you first call `useUploadProfilePictureMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUploadProfilePictureMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [uploadProfilePictureMutation, { data, loading, error }] = useUploadProfilePictureMutation({ - * variables: { - * file: // value for 'file' - * }, - * }); - */ -export function useUploadProfilePictureMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UploadProfilePictureDocument, options); - } -export type UploadProfilePictureMutationHookResult = ReturnType; -export type UploadProfilePictureMutationResult = Apollo.MutationResult; -export type UploadProfilePictureMutationOptions = Apollo.BaseMutationOptions; -export const RemoveProfilePictureDocument = gql` - mutation RemoveProfilePicture($where: UserWhereUniqueInput!) { - updateUser(data: {avatarUrl: null}, where: $where) { - id - avatarUrl - } -} - `; -export type RemoveProfilePictureMutationFn = Apollo.MutationFunction; - -/** - * __useRemoveProfilePictureMutation__ - * - * To run a mutation, you first call `useRemoveProfilePictureMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useRemoveProfilePictureMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [removeProfilePictureMutation, { data, loading, error }] = useRemoveProfilePictureMutation({ - * variables: { - * where: // value for 'where' - * }, - * }); - */ -export function useRemoveProfilePictureMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(RemoveProfilePictureDocument, options); - } -export type RemoveProfilePictureMutationHookResult = ReturnType; -export type RemoveProfilePictureMutationResult = Apollo.MutationResult; -export type RemoveProfilePictureMutationOptions = Apollo.BaseMutationOptions; -export const DeleteUserAccountDocument = gql` - mutation DeleteUserAccount { - deleteUserAccount { - id - } -} - `; -export type DeleteUserAccountMutationFn = Apollo.MutationFunction; - -/** - * __useDeleteUserAccountMutation__ - * - * To run a mutation, you first call `useDeleteUserAccountMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteUserAccountMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [deleteUserAccountMutation, { data, loading, error }] = useDeleteUserAccountMutation({ - * variables: { - * }, - * }); - */ -export function useDeleteUserAccountMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(DeleteUserAccountDocument, options); - } -export type DeleteUserAccountMutationHookResult = ReturnType; -export type DeleteUserAccountMutationResult = Apollo.MutationResult; -export type DeleteUserAccountMutationOptions = Apollo.BaseMutationOptions; export const CreateViewFieldsDocument = gql` mutation CreateViewFields($data: [ViewFieldCreateManyInput!]!) { createManyViewField(data: $data) { @@ -5833,6 +5779,80 @@ export function useDeleteViewSortsMutation(baseOptions?: Apollo.MutationHookOpti export type DeleteViewSortsMutationHookResult = ReturnType; export type DeleteViewSortsMutationResult = Apollo.MutationResult; export type DeleteViewSortsMutationOptions = Apollo.BaseMutationOptions; +export const UpdateViewFieldDocument = gql` + mutation UpdateViewField($data: ViewFieldUpdateInput!, $where: ViewFieldWhereUniqueInput!) { + updateOneViewField(data: $data, where: $where) { + id + fieldName + isVisible + sizeInPx + index + } +} + `; +export type UpdateViewFieldMutationFn = Apollo.MutationFunction; + +/** + * __useUpdateViewFieldMutation__ + * + * To run a mutation, you first call `useUpdateViewFieldMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useUpdateViewFieldMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [updateViewFieldMutation, { data, loading, error }] = useUpdateViewFieldMutation({ + * variables: { + * data: // value for 'data' + * where: // value for 'where' + * }, + * }); + */ +export function useUpdateViewFieldMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(UpdateViewFieldDocument, options); + } +export type UpdateViewFieldMutationHookResult = ReturnType; +export type UpdateViewFieldMutationResult = Apollo.MutationResult; +export type UpdateViewFieldMutationOptions = Apollo.BaseMutationOptions; +export const UpdateViewSortDocument = gql` + mutation UpdateViewSort($data: ViewSortUpdateInput!, $where: ViewSortWhereUniqueInput!) { + viewSort: updateOneViewSort(data: $data, where: $where) { + direction + key + name + } +} + `; +export type UpdateViewSortMutationFn = Apollo.MutationFunction; + +/** + * __useUpdateViewSortMutation__ + * + * To run a mutation, you first call `useUpdateViewSortMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useUpdateViewSortMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [updateViewSortMutation, { data, loading, error }] = useUpdateViewSortMutation({ + * variables: { + * data: // value for 'data' + * where: // value for 'where' + * }, + * }); + */ +export function useUpdateViewSortMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(UpdateViewSortDocument, options); + } +export type UpdateViewSortMutationHookResult = ReturnType; +export type UpdateViewSortMutationResult = Apollo.MutationResult; +export type UpdateViewSortMutationOptions = Apollo.BaseMutationOptions; export const GetViewFieldsDocument = gql` query GetViewFields($where: ViewFieldWhereInput, $orderBy: [ViewFieldOrderByWithRelationInput!]) { viewFields: findManyViewField(where: $where, orderBy: $orderBy) { @@ -5910,159 +5930,103 @@ export function useGetViewSortsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptio export type GetViewSortsQueryHookResult = ReturnType; export type GetViewSortsLazyQueryHookResult = ReturnType; export type GetViewSortsQueryResult = Apollo.QueryResult; -export const UpdateViewFieldDocument = gql` - mutation UpdateViewField($data: ViewFieldUpdateInput!, $where: ViewFieldWhereUniqueInput!) { - updateOneViewField(data: $data, where: $where) { +export const DeleteCurrentWorkspaceDocument = gql` + mutation DeleteCurrentWorkspace { + deleteCurrentWorkspace { id - fieldName - isVisible - sizeInPx - index } } `; -export type UpdateViewFieldMutationFn = Apollo.MutationFunction; +export type DeleteCurrentWorkspaceMutationFn = Apollo.MutationFunction; /** - * __useUpdateViewFieldMutation__ + * __useDeleteCurrentWorkspaceMutation__ * - * To run a mutation, you first call `useUpdateViewFieldMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateViewFieldMutation` returns a tuple that includes: + * To run a mutation, you first call `useDeleteCurrentWorkspaceMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useDeleteCurrentWorkspaceMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [updateViewFieldMutation, { data, loading, error }] = useUpdateViewFieldMutation({ + * const [deleteCurrentWorkspaceMutation, { data, loading, error }] = useDeleteCurrentWorkspaceMutation({ * variables: { - * data: // value for 'data' - * where: // value for 'where' * }, * }); */ -export function useUpdateViewFieldMutation(baseOptions?: Apollo.MutationHookOptions) { +export function useDeleteCurrentWorkspaceMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UpdateViewFieldDocument, options); + return Apollo.useMutation(DeleteCurrentWorkspaceDocument, options); } -export type UpdateViewFieldMutationHookResult = ReturnType; -export type UpdateViewFieldMutationResult = Apollo.MutationResult; -export type UpdateViewFieldMutationOptions = Apollo.BaseMutationOptions; -export const UpdateViewSortDocument = gql` - mutation UpdateViewSort($data: ViewSortUpdateInput!, $where: ViewSortWhereUniqueInput!) { - viewSort: updateOneViewSort(data: $data, where: $where) { - direction - key - name +export type DeleteCurrentWorkspaceMutationHookResult = ReturnType; +export type DeleteCurrentWorkspaceMutationResult = Apollo.MutationResult; +export type DeleteCurrentWorkspaceMutationOptions = Apollo.BaseMutationOptions; +export const RemoveWorkspaceLogoDocument = gql` + mutation RemoveWorkspaceLogo { + updateWorkspace(data: {logo: null}) { + id } } `; -export type UpdateViewSortMutationFn = Apollo.MutationFunction; +export type RemoveWorkspaceLogoMutationFn = Apollo.MutationFunction; /** - * __useUpdateViewSortMutation__ + * __useRemoveWorkspaceLogoMutation__ * - * To run a mutation, you first call `useUpdateViewSortMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useUpdateViewSortMutation` returns a tuple that includes: + * To run a mutation, you first call `useRemoveWorkspaceLogoMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useRemoveWorkspaceLogoMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [updateViewSortMutation, { data, loading, error }] = useUpdateViewSortMutation({ + * const [removeWorkspaceLogoMutation, { data, loading, error }] = useRemoveWorkspaceLogoMutation({ + * variables: { + * }, + * }); + */ +export function useRemoveWorkspaceLogoMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(RemoveWorkspaceLogoDocument, options); + } +export type RemoveWorkspaceLogoMutationHookResult = ReturnType; +export type RemoveWorkspaceLogoMutationResult = Apollo.MutationResult; +export type RemoveWorkspaceLogoMutationOptions = Apollo.BaseMutationOptions; +export const RemoveWorkspaceMemberDocument = gql` + mutation RemoveWorkspaceMember($where: WorkspaceMemberWhereUniqueInput!) { + deleteWorkspaceMember(where: $where) { + id + } +} + `; +export type RemoveWorkspaceMemberMutationFn = Apollo.MutationFunction; + +/** + * __useRemoveWorkspaceMemberMutation__ + * + * To run a mutation, you first call `useRemoveWorkspaceMemberMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useRemoveWorkspaceMemberMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [removeWorkspaceMemberMutation, { data, loading, error }] = useRemoveWorkspaceMemberMutation({ * variables: { - * data: // value for 'data' * where: // value for 'where' * }, * }); */ -export function useUpdateViewSortMutation(baseOptions?: Apollo.MutationHookOptions) { +export function useRemoveWorkspaceMemberMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(UpdateViewSortDocument, options); + return Apollo.useMutation(RemoveWorkspaceMemberDocument, options); } -export type UpdateViewSortMutationHookResult = ReturnType; -export type UpdateViewSortMutationResult = Apollo.MutationResult; -export type UpdateViewSortMutationOptions = Apollo.BaseMutationOptions; -export const GetWorkspaceMembersDocument = gql` - query GetWorkspaceMembers { - workspaceMembers: findManyWorkspaceMember { - id - user { - id - email - avatarUrl - firstName - lastName - displayName - } - } -} - `; - -/** - * __useGetWorkspaceMembersQuery__ - * - * To run a query within a React component, call `useGetWorkspaceMembersQuery` and pass it any options that fit your needs. - * When your component renders, `useGetWorkspaceMembersQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetWorkspaceMembersQuery({ - * variables: { - * }, - * }); - */ -export function useGetWorkspaceMembersQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetWorkspaceMembersDocument, options); - } -export function useGetWorkspaceMembersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetWorkspaceMembersDocument, options); - } -export type GetWorkspaceMembersQueryHookResult = ReturnType; -export type GetWorkspaceMembersLazyQueryHookResult = ReturnType; -export type GetWorkspaceMembersQueryResult = Apollo.QueryResult; -export const GetWorkspaceFromInviteHashDocument = gql` - query GetWorkspaceFromInviteHash($inviteHash: String!) { - findWorkspaceFromInviteHash(inviteHash: $inviteHash) { - id - displayName - logo - } -} - `; - -/** - * __useGetWorkspaceFromInviteHashQuery__ - * - * To run a query within a React component, call `useGetWorkspaceFromInviteHashQuery` and pass it any options that fit your needs. - * When your component renders, `useGetWorkspaceFromInviteHashQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetWorkspaceFromInviteHashQuery({ - * variables: { - * inviteHash: // value for 'inviteHash' - * }, - * }); - */ -export function useGetWorkspaceFromInviteHashQuery(baseOptions: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetWorkspaceFromInviteHashDocument, options); - } -export function useGetWorkspaceFromInviteHashLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetWorkspaceFromInviteHashDocument, options); - } -export type GetWorkspaceFromInviteHashQueryHookResult = ReturnType; -export type GetWorkspaceFromInviteHashLazyQueryHookResult = ReturnType; -export type GetWorkspaceFromInviteHashQueryResult = Apollo.QueryResult; +export type RemoveWorkspaceMemberMutationHookResult = ReturnType; +export type RemoveWorkspaceMemberMutationResult = Apollo.MutationResult; +export type RemoveWorkspaceMemberMutationOptions = Apollo.BaseMutationOptions; export const UpdateWorkspaceDocument = gql` mutation UpdateWorkspace($data: WorkspaceUpdateInput!) { updateWorkspace(data: $data) { @@ -6130,100 +6094,82 @@ export function useUploadWorkspaceLogoMutation(baseOptions?: Apollo.MutationHook export type UploadWorkspaceLogoMutationHookResult = ReturnType; export type UploadWorkspaceLogoMutationResult = Apollo.MutationResult; export type UploadWorkspaceLogoMutationOptions = Apollo.BaseMutationOptions; -export const RemoveWorkspaceLogoDocument = gql` - mutation RemoveWorkspaceLogo { - updateWorkspace(data: {logo: null}) { +export const GetWorkspaceFromInviteHashDocument = gql` + query GetWorkspaceFromInviteHash($inviteHash: String!) { + findWorkspaceFromInviteHash(inviteHash: $inviteHash) { id + displayName + logo } } `; -export type RemoveWorkspaceLogoMutationFn = Apollo.MutationFunction; /** - * __useRemoveWorkspaceLogoMutation__ + * __useGetWorkspaceFromInviteHashQuery__ * - * To run a mutation, you first call `useRemoveWorkspaceLogoMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useRemoveWorkspaceLogoMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution + * To run a query within a React component, call `useGetWorkspaceFromInviteHashQuery` and pass it any options that fit your needs. + * When your component renders, `useGetWorkspaceFromInviteHashQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example - * const [removeWorkspaceLogoMutation, { data, loading, error }] = useRemoveWorkspaceLogoMutation({ + * const { data, loading, error } = useGetWorkspaceFromInviteHashQuery({ + * variables: { + * inviteHash: // value for 'inviteHash' + * }, + * }); + */ +export function useGetWorkspaceFromInviteHashQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetWorkspaceFromInviteHashDocument, options); + } +export function useGetWorkspaceFromInviteHashLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetWorkspaceFromInviteHashDocument, options); + } +export type GetWorkspaceFromInviteHashQueryHookResult = ReturnType; +export type GetWorkspaceFromInviteHashLazyQueryHookResult = ReturnType; +export type GetWorkspaceFromInviteHashQueryResult = Apollo.QueryResult; +export const GetWorkspaceMembersDocument = gql` + query GetWorkspaceMembers { + workspaceMembers: findManyWorkspaceMember { + id + user { + id + email + avatarUrl + firstName + lastName + displayName + } + } +} + `; + +/** + * __useGetWorkspaceMembersQuery__ + * + * To run a query within a React component, call `useGetWorkspaceMembersQuery` and pass it any options that fit your needs. + * When your component renders, `useGetWorkspaceMembersQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetWorkspaceMembersQuery({ * variables: { * }, * }); */ -export function useRemoveWorkspaceLogoMutation(baseOptions?: Apollo.MutationHookOptions) { +export function useGetWorkspaceMembersQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(RemoveWorkspaceLogoDocument, options); + return Apollo.useQuery(GetWorkspaceMembersDocument, options); } -export type RemoveWorkspaceLogoMutationHookResult = ReturnType; -export type RemoveWorkspaceLogoMutationResult = Apollo.MutationResult; -export type RemoveWorkspaceLogoMutationOptions = Apollo.BaseMutationOptions; -export const RemoveWorkspaceMemberDocument = gql` - mutation RemoveWorkspaceMember($where: WorkspaceMemberWhereUniqueInput!) { - deleteWorkspaceMember(where: $where) { - id - } -} - `; -export type RemoveWorkspaceMemberMutationFn = Apollo.MutationFunction; - -/** - * __useRemoveWorkspaceMemberMutation__ - * - * To run a mutation, you first call `useRemoveWorkspaceMemberMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useRemoveWorkspaceMemberMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [removeWorkspaceMemberMutation, { data, loading, error }] = useRemoveWorkspaceMemberMutation({ - * variables: { - * where: // value for 'where' - * }, - * }); - */ -export function useRemoveWorkspaceMemberMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(RemoveWorkspaceMemberDocument, options); - } -export type RemoveWorkspaceMemberMutationHookResult = ReturnType; -export type RemoveWorkspaceMemberMutationResult = Apollo.MutationResult; -export type RemoveWorkspaceMemberMutationOptions = Apollo.BaseMutationOptions; -export const DeleteCurrentWorkspaceDocument = gql` - mutation DeleteCurrentWorkspace { - deleteCurrentWorkspace { - id - } -} - `; -export type DeleteCurrentWorkspaceMutationFn = Apollo.MutationFunction; - -/** - * __useDeleteCurrentWorkspaceMutation__ - * - * To run a mutation, you first call `useDeleteCurrentWorkspaceMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useDeleteCurrentWorkspaceMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [deleteCurrentWorkspaceMutation, { data, loading, error }] = useDeleteCurrentWorkspaceMutation({ - * variables: { - * }, - * }); - */ -export function useDeleteCurrentWorkspaceMutation(baseOptions?: Apollo.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(DeleteCurrentWorkspaceDocument, options); - } -export type DeleteCurrentWorkspaceMutationHookResult = ReturnType; -export type DeleteCurrentWorkspaceMutationResult = Apollo.MutationResult; -export type DeleteCurrentWorkspaceMutationOptions = Apollo.BaseMutationOptions; \ No newline at end of file +export function useGetWorkspaceMembersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetWorkspaceMembersDocument, options); + } +export type GetWorkspaceMembersQueryHookResult = ReturnType; +export type GetWorkspaceMembersLazyQueryHookResult = ReturnType; +export type GetWorkspaceMembersQueryResult = Apollo.QueryResult; \ No newline at end of file diff --git a/front/src/modules/activities/components/ActivityAssigneePicker.tsx b/front/src/modules/activities/components/ActivityAssigneePicker.tsx index 5580cb1dd..96428a77e 100644 --- a/front/src/modules/activities/components/ActivityAssigneePicker.tsx +++ b/front/src/modules/activities/components/ActivityAssigneePicker.tsx @@ -13,7 +13,7 @@ import { useUpdateActivityMutation, } from '~/generated/graphql'; -import { ACTIVITY_UPDATE_FRAGMENT } from '../queries/update'; +import { ACTIVITY_UPDATE_FRAGMENT } from '../graphql/fragments/activityUpdateFragment'; export type OwnProps = { activity: Pick & { diff --git a/front/src/modules/activities/components/ActivityBodyEditor.tsx b/front/src/modules/activities/components/ActivityBodyEditor.tsx index ea9c0c483..c574c7be8 100644 --- a/front/src/modules/activities/components/ActivityBodyEditor.tsx +++ b/front/src/modules/activities/components/ActivityBodyEditor.tsx @@ -8,7 +8,7 @@ import debounce from 'lodash.debounce'; import { BlockEditor } from '@/ui/editor/components/BlockEditor'; import { Activity, useUpdateActivityMutation } from '~/generated/graphql'; -import { ACTIVITY_UPDATE_FRAGMENT } from '../queries/update'; +import { ACTIVITY_UPDATE_FRAGMENT } from '../graphql/fragments/activityUpdateFragment'; const BlockNoteStyledContainer = styled.div` width: 100%; diff --git a/front/src/modules/activities/components/ActivityComments.tsx b/front/src/modules/activities/components/ActivityComments.tsx index c88c5a1be..9687f6639 100644 --- a/front/src/modules/activities/components/ActivityComments.tsx +++ b/front/src/modules/activities/components/ActivityComments.tsx @@ -13,7 +13,7 @@ import { Activity, useCreateCommentMutation } from '~/generated/graphql'; import { isNonEmptyString } from '~/utils/isNonEmptyString'; import { Comment } from '../comment/Comment'; -import { GET_ACTIVITY } from '../queries'; +import { GET_ACTIVITY } from '../graphql/queries/getActivity'; import { CommentForDrawer } from '../types/CommentForDrawer'; type OwnProps = { diff --git a/front/src/modules/activities/components/ActivityEditor.tsx b/front/src/modules/activities/components/ActivityEditor.tsx index 52ee861d2..5d01a6265 100644 --- a/front/src/modules/activities/components/ActivityEditor.tsx +++ b/front/src/modules/activities/components/ActivityEditor.tsx @@ -6,7 +6,7 @@ import styled from '@emotion/styled'; import { ActivityBodyEditor } from '@/activities/components/ActivityBodyEditor'; import { ActivityComments } from '@/activities/components/ActivityComments'; import { ActivityTypeDropdown } from '@/activities/components/ActivityTypeDropdown'; -import { GET_ACTIVITIES } from '@/activities/queries'; +import { GET_ACTIVITIES } from '@/activities/graphql/queries/getActivities'; import { PropertyBox } from '@/ui/editable-field/property-box/components/PropertyBox'; import { DateEditableField } from '@/ui/editable-field/variants/components/DateEditableField'; import { IconCalendar } from '@/ui/icon/index'; @@ -22,7 +22,7 @@ import { debounce } from '~/utils/debounce'; import { ActivityAssigneeEditableField } from '../editable-fields/components/ActivityAssigneeEditableField'; import { ActivityRelationEditableField } from '../editable-fields/components/ActivityRelationEditableField'; -import { ACTIVITY_UPDATE_FRAGMENT } from '../queries/update'; +import { ACTIVITY_UPDATE_FRAGMENT } from '../graphql/fragments/activityUpdateFragment'; import { CommentForDrawer } from '../types/CommentForDrawer'; import { ActivityTitle } from './ActivityTitle'; diff --git a/front/src/modules/activities/components/__stories__/TaskGroupsWithoutTasks.stories.tsx b/front/src/modules/activities/components/__stories__/TaskGroupsWithoutTasks.stories.tsx index 59d7caaf7..e4b314df4 100644 --- a/front/src/modules/activities/components/__stories__/TaskGroupsWithoutTasks.stories.tsx +++ b/front/src/modules/activities/components/__stories__/TaskGroupsWithoutTasks.stories.tsx @@ -2,7 +2,7 @@ import { getOperationName } from '@apollo/client/utilities'; import type { Meta, StoryObj } from '@storybook/react'; import { graphql } from 'msw'; -import { GET_ACTIVITIES } from '@/activities/queries'; +import { GET_ACTIVITIES } from '@/activities/graphql/queries/getActivities'; import { TasksRecoilScopeContext } from '@/activities/states/recoil-scope-contexts/TasksRecoilScopeContext'; import { ComponentWithRecoilScopeDecorator } from '~/testing/decorators/ComponentWithRecoilScopeDecorator'; import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator'; diff --git a/front/src/modules/activities/editable-fields/components/ActivityRelationEditableFieldEditMode.tsx b/front/src/modules/activities/editable-fields/components/ActivityRelationEditableFieldEditMode.tsx index 26e80677c..27546a8d2 100644 --- a/front/src/modules/activities/editable-fields/components/ActivityRelationEditableFieldEditMode.tsx +++ b/front/src/modules/activities/editable-fields/components/ActivityRelationEditableFieldEditMode.tsx @@ -3,8 +3,8 @@ import styled from '@emotion/styled'; import { useHandleCheckableActivityTargetChange } from '@/activities/hooks/useHandleCheckableActivityTargetChange'; import { flatMapAndSortEntityForSelectArrayOfArrayByName } from '@/activities/utils/flatMapAndSortEntityForSelectArrayByName'; -import { useFilteredSearchCompanyQuery } from '@/companies/queries'; -import { useFilteredSearchPeopleQuery } from '@/people/queries'; +import { useFilteredSearchCompanyQuery } from '@/companies/hooks/useFilteredSearchCompanyQuery'; +import { useFilteredSearchPeopleQuery } from '@/people/hooks/useFilteredSearchPeopleQuery'; import { useEditableField } from '@/ui/editable-field/hooks/useEditableField'; import { MultipleEntitySelect } from '@/ui/input/relation-picker/components/MultipleEntitySelect'; import { Activity, ActivityTarget } from '~/generated/graphql'; diff --git a/front/src/modules/activities/graphql/fragments/activityQueryFragment.ts b/front/src/modules/activities/graphql/fragments/activityQueryFragment.ts new file mode 100644 index 000000000..8a07fa9ab --- /dev/null +++ b/front/src/modules/activities/graphql/fragments/activityQueryFragment.ts @@ -0,0 +1,54 @@ +import { gql } from '@apollo/client'; + +export const ACTIVITY_QUERY_FRAGMENT = gql` + fragment ActivityQueryFragment on Activity { + id + createdAt + title + body + type + completedAt + dueAt + assignee { + id + firstName + lastName + displayName + avatarUrl + } + author { + id + firstName + lastName + displayName + } + comments { + id + body + createdAt + updatedAt + author { + id + displayName + firstName + lastName + avatarUrl + } + } + activityTargets { + id + companyId + personId + company { + id + name + domainName + } + person { + id + displayName + avatarUrl + } + } + } +`; diff --git a/front/src/modules/activities/graphql/fragments/activityUpdateFragment.ts b/front/src/modules/activities/graphql/fragments/activityUpdateFragment.ts new file mode 100644 index 000000000..7ab2490ca --- /dev/null +++ b/front/src/modules/activities/graphql/fragments/activityUpdateFragment.ts @@ -0,0 +1,18 @@ +import { gql } from '@apollo/client'; + +export const ACTIVITY_UPDATE_FRAGMENT = gql` + fragment ActivityUpdateParts on Activity { + id + body + title + type + completedAt + dueAt + assignee { + id + firstName + lastName + displayName + } + } +`; diff --git a/front/src/modules/activities/graphql/mutations/addActivityTargets.ts b/front/src/modules/activities/graphql/mutations/addActivityTargets.ts new file mode 100644 index 000000000..7c6f034a9 --- /dev/null +++ b/front/src/modules/activities/graphql/mutations/addActivityTargets.ts @@ -0,0 +1,24 @@ +import { gql } from '@apollo/client'; + +export const ADD_ACTIVITY_TARGETS = gql` + mutation AddActivityTargetsOnActivity( + $activityId: String! + $activityTargetInputs: [ActivityTargetCreateManyActivityInput!]! + ) { + updateOneActivity( + where: { id: $activityId } + data: { activityTargets: { createMany: { data: $activityTargetInputs } } } + ) { + id + createdAt + updatedAt + activityTargets { + id + createdAt + updatedAt + companyId + personId + } + } + } +`; diff --git a/front/src/modules/activities/graphql/mutations/createActivityWithComment.ts b/front/src/modules/activities/graphql/mutations/createActivityWithComment.ts new file mode 100644 index 000000000..c6c9b4e2c --- /dev/null +++ b/front/src/modules/activities/graphql/mutations/createActivityWithComment.ts @@ -0,0 +1,30 @@ +import { gql } from '@apollo/client'; + +export const CREATE_ACTIVITY_WITH_COMMENT = gql` + mutation CreateActivity($data: ActivityCreateInput!) { + createOneActivity(data: $data) { + id + createdAt + updatedAt + authorId + type + activityTargets { + id + createdAt + updatedAt + activityId + companyId + personId + } + comments { + id + createdAt + updatedAt + body + author { + id + } + } + } + } +`; diff --git a/front/src/modules/activities/queries/create.ts b/front/src/modules/activities/graphql/mutations/createComment.ts similarity index 56% rename from front/src/modules/activities/queries/create.ts rename to front/src/modules/activities/graphql/mutations/createComment.ts index 1fb75bac5..ad11d8dc0 100644 --- a/front/src/modules/activities/queries/create.ts +++ b/front/src/modules/activities/graphql/mutations/createComment.ts @@ -31,32 +31,3 @@ export const CREATE_COMMENT = gql` } } `; - -export const CREATE_ACTIVITY_WITH_COMMENT = gql` - mutation CreateActivity($data: ActivityCreateInput!) { - createOneActivity(data: $data) { - id - createdAt - updatedAt - authorId - type - activityTargets { - id - createdAt - updatedAt - activityId - companyId - personId - } - comments { - id - createdAt - updatedAt - body - author { - id - } - } - } - } -`; diff --git a/front/src/modules/activities/graphql/mutations/deleteActivity.ts b/front/src/modules/activities/graphql/mutations/deleteActivity.ts new file mode 100644 index 000000000..5deeae7b1 --- /dev/null +++ b/front/src/modules/activities/graphql/mutations/deleteActivity.ts @@ -0,0 +1,9 @@ +import { gql } from '@apollo/client'; + +export const DELETE_ACTIVITY = gql` + mutation DeleteActivity($activityId: String!) { + deleteManyActivities(where: { id: { equals: $activityId } }) { + count + } + } +`; diff --git a/front/src/modules/activities/graphql/mutations/removeActivityTargets.ts b/front/src/modules/activities/graphql/mutations/removeActivityTargets.ts new file mode 100644 index 000000000..c3f57febe --- /dev/null +++ b/front/src/modules/activities/graphql/mutations/removeActivityTargets.ts @@ -0,0 +1,27 @@ +import { gql } from '@apollo/client'; + +export const REMOVE_ACTIVITY_TARGETS = gql` + mutation RemoveActivityTargetsOnActivity( + $activityId: String! + $activityTargetIds: [String!]! + ) { + updateOneActivity( + where: { id: $activityId } + data: { + activityTargets: { deleteMany: { id: { in: $activityTargetIds } } } + } + ) { + id + createdAt + updatedAt + activityTargets { + id + createdAt + updatedAt + companyId + personId + } + } + } +`; +// diff --git a/front/src/modules/activities/graphql/mutations/updateActivity.ts b/front/src/modules/activities/graphql/mutations/updateActivity.ts new file mode 100644 index 000000000..7576e78e8 --- /dev/null +++ b/front/src/modules/activities/graphql/mutations/updateActivity.ts @@ -0,0 +1,12 @@ +import { gql } from '@apollo/client'; + +export const UPDATE_ACTIVITY = gql` + mutation UpdateActivity( + $where: ActivityWhereUniqueInput! + $data: ActivityUpdateInput! + ) { + updateOneActivity(where: $where, data: $data) { + ...ActivityUpdateParts + } + } +`; diff --git a/front/src/modules/activities/graphql/mutations/uploadAttachment.ts b/front/src/modules/activities/graphql/mutations/uploadAttachment.ts new file mode 100644 index 000000000..42f7baaaa --- /dev/null +++ b/front/src/modules/activities/graphql/mutations/uploadAttachment.ts @@ -0,0 +1,7 @@ +import { gql } from '@apollo/client'; + +export const UPLOAD_ATTACHMENT = gql` + mutation UploadAttachment($file: Upload!, $activityId: String!) { + uploadAttachment(file: $file, activityId: $activityId) + } +`; diff --git a/front/src/modules/activities/graphql/queries/getActivities.ts b/front/src/modules/activities/graphql/queries/getActivities.ts new file mode 100644 index 000000000..6f31a61bb --- /dev/null +++ b/front/src/modules/activities/graphql/queries/getActivities.ts @@ -0,0 +1,12 @@ +import { gql } from '@apollo/client'; + +export const GET_ACTIVITIES = gql` + query GetActivities( + $where: ActivityWhereInput! + $orderBy: [ActivityOrderByWithRelationInput!] + ) { + findManyActivities(orderBy: $orderBy, where: $where) { + ...ActivityQueryFragment + } + } +`; diff --git a/front/src/modules/activities/graphql/queries/getActivitiesByTarget.ts b/front/src/modules/activities/graphql/queries/getActivitiesByTarget.ts new file mode 100644 index 000000000..9e98e8af9 --- /dev/null +++ b/front/src/modules/activities/graphql/queries/getActivitiesByTarget.ts @@ -0,0 +1,24 @@ +import { gql } from '@apollo/client'; + +export const GET_ACTIVITIES_BY_TARGETS = gql` + query GetActivitiesByTargets( + $activityTargetIds: [String!]! + $orderBy: [ActivityOrderByWithRelationInput!] + ) { + findManyActivities( + orderBy: $orderBy + where: { + activityTargets: { + some: { + OR: [ + { personId: { in: $activityTargetIds } } + { companyId: { in: $activityTargetIds } } + ] + } + } + } + ) { + ...ActivityQueryFragment + } + } +`; diff --git a/front/src/modules/activities/graphql/queries/getActivity.ts b/front/src/modules/activities/graphql/queries/getActivity.ts new file mode 100644 index 000000000..2f0b029c5 --- /dev/null +++ b/front/src/modules/activities/graphql/queries/getActivity.ts @@ -0,0 +1,9 @@ +import { gql } from '@apollo/client'; + +export const GET_ACTIVITY = gql` + query GetActivity($activityId: String!) { + findManyActivities(where: { id: { equals: $activityId } }) { + ...ActivityQueryFragment + } + } +`; diff --git a/front/src/modules/activities/hooks/useCompleteTask.ts b/front/src/modules/activities/hooks/useCompleteTask.ts index ecf6973e2..e50d00f60 100644 --- a/front/src/modules/activities/hooks/useCompleteTask.ts +++ b/front/src/modules/activities/hooks/useCompleteTask.ts @@ -3,7 +3,7 @@ import { useApolloClient } from '@apollo/client'; import { Activity, useUpdateActivityMutation } from '~/generated/graphql'; -import { ACTIVITY_UPDATE_FRAGMENT } from '../queries/update'; +import { ACTIVITY_UPDATE_FRAGMENT } from '../graphql/fragments/activityUpdateFragment'; type Task = Pick; diff --git a/front/src/modules/activities/hooks/useHandleCheckableActivityTargetChange.ts b/front/src/modules/activities/hooks/useHandleCheckableActivityTargetChange.ts index 4352e4b3b..845afdd32 100644 --- a/front/src/modules/activities/hooks/useHandleCheckableActivityTargetChange.ts +++ b/front/src/modules/activities/hooks/useHandleCheckableActivityTargetChange.ts @@ -1,8 +1,8 @@ import { getOperationName } from '@apollo/client/utilities'; import { v4 } from 'uuid'; -import { GET_COMPANIES } from '@/companies/queries'; -import { GET_PEOPLE } from '@/people/queries'; +import { GET_COMPANIES } from '@/companies/graphql/queries/getCompanies'; +import { GET_PEOPLE } from '@/people/graphql/queries/getPeople'; import { Activity, ActivityTarget, @@ -10,7 +10,7 @@ import { useRemoveActivityTargetsOnActivityMutation, } from '~/generated/graphql'; -import { GET_ACTIVITY } from '../queries'; +import { GET_ACTIVITY } from '../graphql/queries/getActivity'; import { ActivityTargetableEntityType } from '../types/ActivityTargetableEntity'; import { ActivityTargetableEntityForSelect } from '../types/ActivityTargetableEntityForSelect'; diff --git a/front/src/modules/activities/hooks/useOpenCreateActivityDrawer.ts b/front/src/modules/activities/hooks/useOpenCreateActivityDrawer.ts index a0d695f3c..5ea0d4128 100644 --- a/front/src/modules/activities/hooks/useOpenCreateActivityDrawer.ts +++ b/front/src/modules/activities/hooks/useOpenCreateActivityDrawer.ts @@ -3,19 +3,17 @@ import { useRecoilState, useRecoilValue } from 'recoil'; import { v4 } from 'uuid'; import { currentUserState } from '@/auth/states/currentUserState'; -import { GET_COMPANIES } from '@/companies/queries'; -import { GET_PEOPLE } from '@/people/queries'; +import { GET_COMPANIES } from '@/companies/graphql/queries/getCompanies'; +import { GET_PEOPLE } from '@/people/graphql/queries/getPeople'; import { useRightDrawer } from '@/ui/right-drawer/hooks/useRightDrawer'; import { RightDrawerHotkeyScope } from '@/ui/right-drawer/types/RightDrawerHotkeyScope'; import { RightDrawerPages } from '@/ui/right-drawer/types/RightDrawerPages'; import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope'; import { ActivityType, useCreateActivityMutation } from '~/generated/graphql'; -import { - GET_ACTIVITIES, - GET_ACTIVITIES_BY_TARGETS, - GET_ACTIVITY, -} from '../queries'; +import { GET_ACTIVITIES } from '../graphql/queries/getActivities'; +import { GET_ACTIVITIES_BY_TARGETS } from '../graphql/queries/getActivitiesByTarget'; +import { GET_ACTIVITY } from '../graphql/queries/getActivity'; import { activityTargetableEntityArrayState } from '../states/activityTargetableEntityArrayState'; import { viewableActivityIdState } from '../states/viewableActivityIdState'; import { diff --git a/front/src/modules/activities/queries/index.ts b/front/src/modules/activities/queries/index.ts deleted file mode 100644 index c7396734d..000000000 --- a/front/src/modules/activities/queries/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './select'; diff --git a/front/src/modules/activities/queries/select.ts b/front/src/modules/activities/queries/select.ts deleted file mode 100644 index eee362d94..000000000 --- a/front/src/modules/activities/queries/select.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { gql } from '@apollo/client'; - -export const ACTIVITY_QUERY_FRAGMENT = gql` - fragment ActivityQueryFragment on Activity { - id - createdAt - title - body - type - completedAt - dueAt - assignee { - id - firstName - lastName - displayName - avatarUrl - } - author { - id - firstName - lastName - displayName - } - comments { - id - body - createdAt - updatedAt - author { - id - displayName - firstName - lastName - avatarUrl - } - } - activityTargets { - id - companyId - personId - company { - id - name - domainName - } - person { - id - displayName - avatarUrl - } - } - } -`; - -export const GET_ACTIVITIES_BY_TARGETS = gql` - query GetActivitiesByTargets( - $activityTargetIds: [String!]! - $orderBy: [ActivityOrderByWithRelationInput!] - ) { - findManyActivities( - orderBy: $orderBy - where: { - activityTargets: { - some: { - OR: [ - { personId: { in: $activityTargetIds } } - { companyId: { in: $activityTargetIds } } - ] - } - } - } - ) { - ...ActivityQueryFragment - } - } -`; - -export const GET_ACTIVITIES = gql` - query GetActivities( - $where: ActivityWhereInput! - $orderBy: [ActivityOrderByWithRelationInput!] - ) { - findManyActivities(orderBy: $orderBy, where: $where) { - ...ActivityQueryFragment - } - } -`; - -export const GET_ACTIVITY = gql` - query GetActivity($activityId: String!) { - findManyActivities(where: { id: { equals: $activityId } }) { - ...ActivityQueryFragment - } - } -`; diff --git a/front/src/modules/activities/queries/update.ts b/front/src/modules/activities/queries/update.ts deleted file mode 100644 index 02aa5d782..000000000 --- a/front/src/modules/activities/queries/update.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { gql } from '@apollo/client'; - -export const ADD_ACTIVITY_TARGETS = gql` - mutation AddActivityTargetsOnActivity( - $activityId: String! - $activityTargetInputs: [ActivityTargetCreateManyActivityInput!]! - ) { - updateOneActivity( - where: { id: $activityId } - data: { activityTargets: { createMany: { data: $activityTargetInputs } } } - ) { - id - createdAt - updatedAt - activityTargets { - id - createdAt - updatedAt - companyId - personId - } - } - } -`; - -export const REMOVE_ACTIVITY_TARGETS = gql` - mutation RemoveActivityTargetsOnActivity( - $activityId: String! - $activityTargetIds: [String!]! - ) { - updateOneActivity( - where: { id: $activityId } - data: { - activityTargets: { deleteMany: { id: { in: $activityTargetIds } } } - } - ) { - id - createdAt - updatedAt - activityTargets { - id - createdAt - updatedAt - companyId - personId - } - } - } -`; - -export const DELETE_ACTIVITY = gql` - mutation DeleteActivity($activityId: String!) { - deleteManyActivities(where: { id: { equals: $activityId } }) { - count - } - } -`; - -export const ACTIVITY_UPDATE_FRAGMENT = gql` - fragment ActivityUpdateParts on Activity { - id - body - title - type - completedAt - dueAt - assignee { - id - firstName - lastName - displayName - } - } -`; - -export const UPDATE_ACTIVITY = gql` - mutation UpdateActivity( - $where: ActivityWhereUniqueInput! - $data: ActivityUpdateInput! - ) { - updateOneActivity(where: $where, data: $data) { - ...ActivityUpdateParts - } - } -`; - -export const UPLOAD_ATTACHMENT = gql` - mutation UploadAttachment($file: Upload!, $activityId: String!) { - uploadAttachment(file: $file, activityId: $activityId) - } -`; diff --git a/front/src/modules/activities/right-drawer/components/ActivityActionBar.tsx b/front/src/modules/activities/right-drawer/components/ActivityActionBar.tsx index c96289ae6..5d0431b10 100644 --- a/front/src/modules/activities/right-drawer/components/ActivityActionBar.tsx +++ b/front/src/modules/activities/right-drawer/components/ActivityActionBar.tsx @@ -3,12 +3,10 @@ import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { useRecoilState } from 'recoil'; -import { - GET_ACTIVITIES, - GET_ACTIVITIES_BY_TARGETS, -} from '@/activities/queries'; -import { GET_COMPANIES } from '@/companies/queries'; -import { GET_PEOPLE } from '@/people/queries'; +import { GET_ACTIVITIES } from '@/activities/graphql/queries/getActivities'; +import { GET_ACTIVITIES_BY_TARGETS } from '@/activities/graphql/queries/getActivitiesByTarget'; +import { GET_COMPANIES } from '@/companies/graphql/queries/getCompanies'; +import { GET_PEOPLE } from '@/people/graphql/queries/getPeople'; import { IconButton } from '@/ui/button/components/IconButton'; import { IconTrash } from '@/ui/icon'; import { isRightDrawerOpenState } from '@/ui/right-drawer/states/isRightDrawerOpenState'; diff --git a/front/src/modules/analytics/queries/index.ts b/front/src/modules/analytics/graphql/queries/createEvent.ts similarity index 100% rename from front/src/modules/analytics/queries/index.ts rename to front/src/modules/analytics/graphql/queries/createEvent.ts diff --git a/front/src/modules/auth/graphql/fragments/userQueryFragment.ts b/front/src/modules/auth/graphql/fragments/userQueryFragment.ts new file mode 100644 index 000000000..9945bf170 --- /dev/null +++ b/front/src/modules/auth/graphql/fragments/userQueryFragment.ts @@ -0,0 +1,29 @@ +import { gql } from '@apollo/client'; + +export const USER_QUERY_FRAGMENT = gql` + fragment UserQueryFragment on User { + id + email + displayName + firstName + lastName + canImpersonate + supportUserHash + workspaceMember { + id + allowImpersonation + workspace { + id + domainName + displayName + logo + inviteHash + } + } + settings { + id + colorScheme + locale + } + } +`; diff --git a/front/src/modules/auth/graphql/mutations/challenge.ts b/front/src/modules/auth/graphql/mutations/challenge.ts new file mode 100644 index 000000000..65362e382 --- /dev/null +++ b/front/src/modules/auth/graphql/mutations/challenge.ts @@ -0,0 +1,12 @@ +import { gql } from '@apollo/client'; + +export const CHALLENGE = gql` + mutation Challenge($email: String!, $password: String!) { + challenge(email: $email, password: $password) { + loginToken { + expiresAt + token + } + } + } +`; diff --git a/front/src/modules/auth/graphql/mutations/impersonate.ts b/front/src/modules/auth/graphql/mutations/impersonate.ts new file mode 100644 index 000000000..f68edcf95 --- /dev/null +++ b/front/src/modules/auth/graphql/mutations/impersonate.ts @@ -0,0 +1,22 @@ +import { gql } from '@apollo/client'; + +// TODO: Fragments should be used instead of duplicating the user fields ! +export const IMPERSONATE = gql` + mutation Impersonate($userId: String!) { + impersonate(userId: $userId) { + user { + ...UserQueryFragment + } + tokens { + accessToken { + token + expiresAt + } + refreshToken { + token + expiresAt + } + } + } + } +`; diff --git a/front/src/modules/auth/graphql/mutations/renewToken.ts b/front/src/modules/auth/graphql/mutations/renewToken.ts new file mode 100644 index 000000000..ea43ba83d --- /dev/null +++ b/front/src/modules/auth/graphql/mutations/renewToken.ts @@ -0,0 +1,18 @@ +import { gql } from '@apollo/client'; + +export const RENEW_TOKEN = gql` + mutation RenewToken($refreshToken: String!) { + renewToken(refreshToken: $refreshToken) { + tokens { + accessToken { + expiresAt + token + } + refreshToken { + token + expiresAt + } + } + } + } +`; diff --git a/front/src/modules/auth/graphql/mutations/signUp.ts b/front/src/modules/auth/graphql/mutations/signUp.ts new file mode 100644 index 000000000..05732a594 --- /dev/null +++ b/front/src/modules/auth/graphql/mutations/signUp.ts @@ -0,0 +1,20 @@ +import { gql } from '@apollo/client'; + +export const SIGN_UP = gql` + mutation SignUp( + $email: String! + $password: String! + $workspaceInviteHash: String + ) { + signUp( + email: $email + password: $password + workspaceInviteHash: $workspaceInviteHash + ) { + loginToken { + expiresAt + token + } + } + } +`; diff --git a/front/src/modules/auth/graphql/mutations/verify.ts b/front/src/modules/auth/graphql/mutations/verify.ts new file mode 100644 index 000000000..fef9b10b8 --- /dev/null +++ b/front/src/modules/auth/graphql/mutations/verify.ts @@ -0,0 +1,21 @@ +import { gql } from '@apollo/client'; + +export const VERIFY = gql` + mutation Verify($loginToken: String!) { + verify(loginToken: $loginToken) { + user { + ...UserQueryFragment + } + tokens { + accessToken { + token + expiresAt + } + refreshToken { + token + expiresAt + } + } + } + } +`; diff --git a/front/src/modules/auth/queries/select.ts b/front/src/modules/auth/graphql/queries/checkUserExists.ts similarity index 100% rename from front/src/modules/auth/queries/select.ts rename to front/src/modules/auth/graphql/queries/checkUserExists.ts diff --git a/front/src/modules/auth/queries/index.ts b/front/src/modules/auth/queries/index.ts deleted file mode 100644 index 18c6c2f7d..000000000 --- a/front/src/modules/auth/queries/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './select'; -export * from './update'; diff --git a/front/src/modules/auth/queries/update.ts b/front/src/modules/auth/queries/update.ts deleted file mode 100644 index 9ad644bf7..000000000 --- a/front/src/modules/auth/queries/update.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { gql } from '@apollo/client'; - -export const CHALLENGE = gql` - mutation Challenge($email: String!, $password: String!) { - challenge(email: $email, password: $password) { - loginToken { - expiresAt - token - } - } - } -`; - -export const SIGN_UP = gql` - mutation SignUp( - $email: String! - $password: String! - $workspaceInviteHash: String - ) { - signUp( - email: $email - password: $password - workspaceInviteHash: $workspaceInviteHash - ) { - loginToken { - expiresAt - token - } - } - } -`; - -export const VERIFY = gql` - mutation Verify($loginToken: String!) { - verify(loginToken: $loginToken) { - user { - id - email - displayName - firstName - lastName - canImpersonate - supportUserHash - workspaceMember { - id - allowImpersonation - workspace { - id - domainName - displayName - logo - inviteHash - } - } - settings { - id - colorScheme - locale - } - } - tokens { - accessToken { - token - expiresAt - } - refreshToken { - token - expiresAt - } - } - } - } -`; - -export const RENEW_TOKEN = gql` - mutation RenewToken($refreshToken: String!) { - renewToken(refreshToken: $refreshToken) { - tokens { - accessToken { - expiresAt - token - } - refreshToken { - token - expiresAt - } - } - } - } -`; - -// TODO: Fragments should be used instead of duplicating the user fields ! -export const IMPERSONATE = gql` - mutation Impersonate($userId: String!) { - impersonate(userId: $userId) { - user { - id - email - displayName - firstName - lastName - canImpersonate - supportUserHash - workspaceMember { - id - allowImpersonation - workspace { - id - domainName - displayName - logo - inviteHash - } - } - settings { - id - colorScheme - locale - } - } - tokens { - accessToken { - token - expiresAt - } - refreshToken { - token - expiresAt - } - } - } - } -`; diff --git a/front/src/modules/client-config/queries/index.tsx b/front/src/modules/client-config/graphql/queries/getClientConfig.ts similarity index 100% rename from front/src/modules/client-config/queries/index.tsx rename to front/src/modules/client-config/graphql/queries/getClientConfig.ts diff --git a/front/src/modules/companies/__stories__/Board.stories.tsx b/front/src/modules/companies/__stories__/Board.stories.tsx index 83351a73c..c35d9b02f 100644 --- a/front/src/modules/companies/__stories__/Board.stories.tsx +++ b/front/src/modules/companies/__stories__/Board.stories.tsx @@ -3,11 +3,11 @@ import { Meta, StoryObj } from '@storybook/react'; import { EntityBoard } from '@/ui/board/components/EntityBoard'; import { RecoilScope } from '@/ui/utilities/recoil-scope/components/RecoilScope'; +import { SortOrder } from '~/generated/graphql'; import { opportunitiesBoardOptions } from '~/pages/opportunities/opportunitiesBoardOptions'; import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; -import { defaultPipelineProgressOrderBy } from '../../pipeline/queries'; import { HooksCompanyBoard } from '../components/HooksCompanyBoard'; import { CompanyBoardRecoilScopeContext } from '../states/recoil-scope-contexts/CompanyBoardRecoilScopeContext'; @@ -17,7 +17,13 @@ const meta: Meta = { decorators: [ (Story) => ( - + diff --git a/front/src/modules/companies/__stories__/CompanyBoardCard.stories.tsx b/front/src/modules/companies/__stories__/CompanyBoardCard.stories.tsx index 3aabf1e81..254758da6 100644 --- a/front/src/modules/companies/__stories__/CompanyBoardCard.stories.tsx +++ b/front/src/modules/companies/__stories__/CompanyBoardCard.stories.tsx @@ -5,11 +5,11 @@ import { CompanyBoardCard } from '@/companies/components/CompanyBoardCard'; import { BoardCardIdContext } from '@/ui/board/contexts/BoardCardIdContext'; import { BoardColumnRecoilScopeContext } from '@/ui/board/states/recoil-scope-contexts/BoardColumnRecoilScopeContext'; import { RecoilScope } from '@/ui/utilities/recoil-scope/components/RecoilScope'; +import { SortOrder } from '~/generated/graphql'; import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator'; import { graphqlMocks } from '~/testing/graphqlMocks'; import { mockedPipelineProgressData } from '~/testing/mock-data/pipeline-progress'; -import { defaultPipelineProgressOrderBy } from '../../pipeline/queries'; import { HooksCompanyBoard } from '../components/HooksCompanyBoard'; import { CompanyBoardRecoilScopeContext } from '../states/recoil-scope-contexts/CompanyBoardRecoilScopeContext'; @@ -19,7 +19,13 @@ const meta: Meta = { decorators: [ (Story) => ( - + diff --git a/front/src/modules/companies/components/CompanyAccountOwnerPicker.tsx b/front/src/modules/companies/components/CompanyAccountOwnerPicker.tsx deleted file mode 100644 index 73c6ae189..000000000 --- a/front/src/modules/companies/components/CompanyAccountOwnerPicker.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import { useFilteredSearchEntityQuery } from '@/search/hooks/useFilteredSearchEntityQuery'; -import { SingleEntitySelect } from '@/ui/input/relation-picker/components/SingleEntitySelect'; -import { relationPickerSearchFilterScopedState } from '@/ui/input/relation-picker/states/relationPickerSearchFilterScopedState'; -import { EntityForSelect } from '@/ui/input/relation-picker/types/EntityForSelect'; -import { Entity } from '@/ui/input/relation-picker/types/EntityTypeForSelect'; -import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState'; -import { - Company, - User, - useSearchUserQuery, - useUpdateOneCompanyMutation, -} from '~/generated/graphql'; - -export type OwnProps = { - company: Pick & { - accountOwner?: Pick | null; - }; - onSubmit?: () => void; - onCancel?: () => void; -}; - -type UserForSelect = EntityForSelect & { - entityType: Entity.User; -}; - -export function CompanyAccountOwnerPicker({ - company, - onSubmit, - onCancel, -}: OwnProps) { - const [searchFilter] = useRecoilScopedState( - relationPickerSearchFilterScopedState, - ); - const [updateCompany] = useUpdateOneCompanyMutation(); - - const companies = useFilteredSearchEntityQuery({ - queryHook: useSearchUserQuery, - selectedIds: [company?.accountOwner?.id ?? ''], - searchFilter: searchFilter, - mappingFunction: (user) => ({ - entityType: Entity.User, - id: user.id, - name: user.displayName, - avatarType: 'rounded', - avatarUrl: user.avatarUrl ?? '', - }), - orderByField: 'firstName', - searchOnFields: ['firstName', 'lastName'], - }); - - async function handleEntitySelected( - selectedUser: UserForSelect | null | undefined, - ) { - if (selectedUser) { - await updateCompany({ - variables: { - where: { id: company.id }, - data: { - accountOwner: { connect: { id: selectedUser.id } }, - }, - }, - }); - } - - onSubmit?.(); - } - - return ( - - ); -} diff --git a/front/src/modules/companies/components/CompanyPicker.tsx b/front/src/modules/companies/components/CompanyPicker.tsx index 102e71f9b..a52f0e16f 100644 --- a/front/src/modules/companies/components/CompanyPicker.tsx +++ b/front/src/modules/companies/components/CompanyPicker.tsx @@ -3,7 +3,7 @@ import { relationPickerSearchFilterScopedState } from '@/ui/input/relation-picke import { EntityForSelect } from '@/ui/input/relation-picker/types/EntityForSelect'; import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState'; -import { useFilteredSearchCompanyQuery } from '../queries'; +import { useFilteredSearchCompanyQuery } from '../hooks/useFilteredSearchCompanyQuery'; export type OwnProps = { companyId: string | null; diff --git a/front/src/modules/companies/components/CompanyPickerCell.tsx b/front/src/modules/companies/components/CompanyPickerCell.tsx index d587c4eef..28b6550b1 100644 --- a/front/src/modules/companies/components/CompanyPickerCell.tsx +++ b/front/src/modules/companies/components/CompanyPickerCell.tsx @@ -1,4 +1,4 @@ -import { useFilteredSearchCompanyQuery } from '@/companies/queries'; +import { useFilteredSearchCompanyQuery } from '@/companies/hooks/useFilteredSearchCompanyQuery'; import { SingleEntitySelect } from '@/ui/input/relation-picker/components/SingleEntitySelect'; import { relationPickerSearchFilterScopedState } from '@/ui/input/relation-picker/states/relationPickerSearchFilterScopedState'; import { EntityForSelect } from '@/ui/input/relation-picker/types/EntityForSelect'; diff --git a/front/src/modules/companies/components/FilterDropdownCompanySearchSelect.tsx b/front/src/modules/companies/components/FilterDropdownCompanySearchSelect.tsx index 4783f70a6..044d4fa74 100644 --- a/front/src/modules/companies/components/FilterDropdownCompanySearchSelect.tsx +++ b/front/src/modules/companies/components/FilterDropdownCompanySearchSelect.tsx @@ -6,7 +6,7 @@ import { filterDropdownSelectedEntityIdScopedState } from '@/ui/filter-n-sort/st import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState'; import { useRecoilScopedValue } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedValue'; -import { useFilteredSearchCompanyQuery } from '../queries'; +import { useFilteredSearchCompanyQuery } from '../hooks/useFilteredSearchCompanyQuery'; export function FilterDropdownCompanySearchSelect({ context, diff --git a/front/src/modules/companies/components/NewCompanyProgressButton.tsx b/front/src/modules/companies/components/NewCompanyProgressButton.tsx index de4d6af38..09b75293e 100644 --- a/front/src/modules/companies/components/NewCompanyProgressButton.tsx +++ b/front/src/modules/companies/components/NewCompanyProgressButton.tsx @@ -3,7 +3,8 @@ import { getOperationName } from '@apollo/client/utilities'; import { useRecoilCallback, useRecoilState } from 'recoil'; import { v4 as uuidv4 } from 'uuid'; -import { GET_PIPELINE_PROGRESS, GET_PIPELINES } from '@/pipeline/queries'; +import { GET_PIPELINE_PROGRESS } from '@/pipeline/graphql/queries/getPipelineProgress'; +import { GET_PIPELINES } from '@/pipeline/graphql/queries/getPipelines'; import { currentPipelineState } from '@/pipeline/states/currentPipelineState'; import { NewButton } from '@/ui/board/components/NewButton'; import { BoardColumnIdContext } from '@/ui/board/contexts/BoardColumnIdContext'; @@ -15,7 +16,7 @@ import { usePreviousHotkeyScope } from '@/ui/utilities/hotkey/hooks/usePreviousH import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState'; import { useCreateOneCompanyPipelineProgressMutation } from '~/generated/graphql'; -import { useFilteredSearchCompanyQuery } from '../queries'; +import { useFilteredSearchCompanyQuery } from '../hooks/useFilteredSearchCompanyQuery'; export function NewCompanyProgressButton() { const [isCreatingCard, setIsCreatingCard] = useState(false); diff --git a/front/src/modules/companies/graphql/fragments/companyFieldsFragment.ts b/front/src/modules/companies/graphql/fragments/companyFieldsFragment.ts new file mode 100644 index 000000000..064b91927 --- /dev/null +++ b/front/src/modules/companies/graphql/fragments/companyFieldsFragment.ts @@ -0,0 +1,19 @@ +import { gql } from '@apollo/client'; + +export const COMPANY_FIELDS_FRAGMENT = gql` + fragment CompanyFieldsFragment on Company { + accountOwner { + id + email + displayName + avatarUrl + } + address + createdAt + domainName + employees + linkedinUrl + id + name + } +`; diff --git a/front/src/modules/companies/graphql/mutations/deleteManyCompanies.ts b/front/src/modules/companies/graphql/mutations/deleteManyCompanies.ts new file mode 100644 index 000000000..975f2bd56 --- /dev/null +++ b/front/src/modules/companies/graphql/mutations/deleteManyCompanies.ts @@ -0,0 +1,9 @@ +import { gql } from '@apollo/client'; + +export const DELETE_MANY_COMPANIES = gql` + mutation DeleteManyCompanies($ids: [String!]) { + deleteManyCompany(where: { id: { in: $ids } }) { + count + } + } +`; diff --git a/front/src/modules/companies/graphql/mutations/insertOneCompany.ts b/front/src/modules/companies/graphql/mutations/insertOneCompany.ts new file mode 100644 index 000000000..6b63c03b9 --- /dev/null +++ b/front/src/modules/companies/graphql/mutations/insertOneCompany.ts @@ -0,0 +1,9 @@ +import { gql } from '@apollo/client'; + +export const INSERT_ONE_COMPANY = gql` + mutation InsertOneCompany($data: CompanyCreateInput!) { + createOneCompany(data: $data) { + ...CompanyFieldsFragment + } + } +`; diff --git a/front/src/modules/companies/graphql/mutations/updateOneCompany.ts b/front/src/modules/companies/graphql/mutations/updateOneCompany.ts new file mode 100644 index 000000000..88e4e1e21 --- /dev/null +++ b/front/src/modules/companies/graphql/mutations/updateOneCompany.ts @@ -0,0 +1,12 @@ +import { gql } from '@apollo/client'; + +export const UPDATE_ONE_COMPANY = gql` + mutation UpdateOneCompany( + $where: CompanyWhereUniqueInput! + $data: CompanyUpdateInput! + ) { + updateOneCompany(data: $data, where: $where) { + ...CompanyFieldsFragment + } + } +`; diff --git a/front/src/modules/companies/graphql/queries/getCompanies.ts b/front/src/modules/companies/graphql/queries/getCompanies.ts new file mode 100644 index 000000000..a8a7c5a17 --- /dev/null +++ b/front/src/modules/companies/graphql/queries/getCompanies.ts @@ -0,0 +1,27 @@ +import { gql } from '@apollo/client'; + +export const GET_COMPANIES = gql` + query GetCompanies( + $orderBy: [CompanyOrderByWithRelationInput!] + $where: CompanyWhereInput + ) { + companies: findManyCompany(orderBy: $orderBy, where: $where) { + id + domainName + name + createdAt + address + linkedinUrl + employees + _activityCount + accountOwner { + id + email + displayName + firstName + lastName + avatarUrl + } + } + } +`; diff --git a/front/src/modules/companies/queries/show.ts b/front/src/modules/companies/graphql/queries/getCompany.ts similarity index 50% rename from front/src/modules/companies/queries/show.ts rename to front/src/modules/companies/graphql/queries/getCompany.ts index a372632a5..6d979eab3 100644 --- a/front/src/modules/companies/queries/show.ts +++ b/front/src/modules/companies/graphql/queries/getCompany.ts @@ -1,8 +1,4 @@ import { gql } from '@apollo/client'; -import { useSetRecoilState } from 'recoil'; - -import { genericEntitiesFamilyState } from '@/ui/editable-field/states/genericEntitiesFamilyState'; -import { useGetCompanyQuery } from '~/generated/graphql'; export const GET_COMPANY = gql` query GetCompany($where: CompanyWhereUniqueInput!) { @@ -33,15 +29,3 @@ export const GET_COMPANY = gql` } } `; - -export function useCompanyQuery(id: string) { - const updateCompanyShowPage = useSetRecoilState( - genericEntitiesFamilyState(id), - ); - return useGetCompanyQuery({ - variables: { where: { id } }, - onCompleted: (data) => { - updateCompanyShowPage(data?.findUniqueCompany); - }, - }); -} diff --git a/front/src/modules/companies/hooks/useCompanyQuery.ts b/front/src/modules/companies/hooks/useCompanyQuery.ts new file mode 100644 index 000000000..7deb5b08f --- /dev/null +++ b/front/src/modules/companies/hooks/useCompanyQuery.ts @@ -0,0 +1,16 @@ +import { useSetRecoilState } from 'recoil'; + +import { genericEntitiesFamilyState } from '@/ui/editable-field/states/genericEntitiesFamilyState'; +import { useGetCompanyQuery } from '~/generated/graphql'; + +export function useCompanyQuery(id: string) { + const updateCompanyShowPage = useSetRecoilState( + genericEntitiesFamilyState(id), + ); + return useGetCompanyQuery({ + variables: { where: { id } }, + onCompleted: (data) => { + updateCompanyShowPage(data?.findUniqueCompany); + }, + }); +} diff --git a/front/src/modules/companies/hooks/useDeleteCompanies.ts b/front/src/modules/companies/hooks/useDeleteCompanies.ts index c5625168e..67b21b220 100644 --- a/front/src/modules/companies/hooks/useDeleteCompanies.ts +++ b/front/src/modules/companies/hooks/useDeleteCompanies.ts @@ -1,7 +1,7 @@ import { getOperationName } from '@apollo/client/utilities'; import { useRecoilState, useRecoilValue } from 'recoil'; -import { GET_PIPELINES } from '@/pipeline/queries'; +import { GET_PIPELINES } from '@/pipeline/graphql/queries/getPipelines'; import { useResetTableRowSelection } from '@/ui/table/hooks/useResetTableRowSelection'; import { selectedRowIdsSelector } from '@/ui/table/states/selectors/selectedRowIdsSelector'; import { tableRowIdsState } from '@/ui/table/states/tableRowIdsState'; diff --git a/front/src/modules/companies/hooks/useFilteredSearchCompanyQuery.ts b/front/src/modules/companies/hooks/useFilteredSearchCompanyQuery.ts new file mode 100644 index 000000000..5d5e63637 --- /dev/null +++ b/front/src/modules/companies/hooks/useFilteredSearchCompanyQuery.ts @@ -0,0 +1,32 @@ +import { ActivityTargetableEntityType } from '@/activities/types/ActivityTargetableEntity'; +import { ActivityTargetableEntityForSelect } from '@/activities/types/ActivityTargetableEntityForSelect'; +import { useFilteredSearchEntityQuery } from '@/search/hooks/useFilteredSearchEntityQuery'; +import { useSearchCompanyQuery } from '~/generated/graphql'; +import { getLogoUrlFromDomainName } from '~/utils'; + +export function useFilteredSearchCompanyQuery({ + searchFilter, + selectedIds = [], + limit, +}: { + searchFilter: string; + selectedIds?: string[]; + limit?: number; +}) { + return useFilteredSearchEntityQuery({ + queryHook: useSearchCompanyQuery, + searchOnFields: ['name'], + orderByField: 'name', + selectedIds: selectedIds, + mappingFunction: (company) => + ({ + id: company.id, + entityType: ActivityTargetableEntityType.Company, + name: company.name, + avatarUrl: getLogoUrlFromDomainName(company.domainName), + avatarType: 'squared', + } as ActivityTargetableEntityForSelect), + searchFilter, + limit, + }); +} diff --git a/front/src/modules/companies/queries/__tests__/select.test.ts b/front/src/modules/companies/queries/__tests__/select.test.ts deleted file mode 100644 index bb0ddb0ba..000000000 --- a/front/src/modules/companies/queries/__tests__/select.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { reduceSortsToOrderBy } from '@/ui/filter-n-sort/helpers'; - -import { CompaniesSelectedSortType } from '../select'; - -describe('reduceSortsToOrderBy', () => { - it('should return an array of objects with the id as key and the order as value', () => { - const sorts = [ - { key: 'name', label: 'name', order: 'asc' }, - { - key: 'domainName', - label: 'domainName', - order: 'desc', - }, - ] satisfies CompaniesSelectedSortType[]; - const result = reduceSortsToOrderBy(sorts); - expect(result).toEqual([{ name: 'asc' }, { domainName: 'desc' }]); - }); -}); diff --git a/front/src/modules/companies/queries/index.ts b/front/src/modules/companies/queries/index.ts deleted file mode 100644 index 41161a6b1..000000000 --- a/front/src/modules/companies/queries/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './select'; -export * from './show'; -export * from './update'; diff --git a/front/src/modules/companies/queries/select.ts b/front/src/modules/companies/queries/select.ts deleted file mode 100644 index 9929f7d4f..000000000 --- a/front/src/modules/companies/queries/select.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { gql } from '@apollo/client'; - -import { ActivityTargetableEntityType } from '@/activities/types/ActivityTargetableEntity'; -import { ActivityTargetableEntityForSelect } from '@/activities/types/ActivityTargetableEntityForSelect'; -import { useFilteredSearchEntityQuery } from '@/search/hooks/useFilteredSearchEntityQuery'; -import { SelectedSortType } from '@/ui/filter-n-sort/types/interface'; -import { - CompanyOrderByWithRelationInput as Companies_Order_By, - CompanyWhereInput as Companies_Bool_Exp, - SortOrder as Order_By, - useGetCompaniesQuery, - useSearchCompanyQuery, -} from '~/generated/graphql'; -import { getLogoUrlFromDomainName } from '~/utils'; - -export type CompaniesSelectedSortType = SelectedSortType; - -export const GET_COMPANIES = gql` - query GetCompanies( - $orderBy: [CompanyOrderByWithRelationInput!] - $where: CompanyWhereInput - ) { - companies: findManyCompany(orderBy: $orderBy, where: $where) { - id - domainName - name - createdAt - address - linkedinUrl - employees - _activityCount - accountOwner { - id - email - displayName - firstName - lastName - avatarUrl - } - } - } -`; - -export function useCompaniesQuery( - orderBy: Companies_Order_By[], - where: Companies_Bool_Exp, -) { - return useGetCompaniesQuery({ variables: { orderBy, where } }); -} - -export function useFilteredSearchCompanyQuery({ - searchFilter, - selectedIds = [], - limit, -}: { - searchFilter: string; - selectedIds?: string[]; - limit?: number; -}) { - return useFilteredSearchEntityQuery({ - queryHook: useSearchCompanyQuery, - searchOnFields: ['name'], - orderByField: 'name', - selectedIds: selectedIds, - mappingFunction: (company) => - ({ - id: company.id, - entityType: ActivityTargetableEntityType.Company, - name: company.name, - avatarUrl: getLogoUrlFromDomainName(company.domainName), - avatarType: 'squared', - } as ActivityTargetableEntityForSelect), - searchFilter, - limit, - }); -} - -export const defaultOrderBy: Companies_Order_By[] = [ - { - createdAt: Order_By.Desc, - }, -]; diff --git a/front/src/modules/companies/queries/update.ts b/front/src/modules/companies/queries/update.ts deleted file mode 100644 index b8f31cf73..000000000 --- a/front/src/modules/companies/queries/update.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { gql } from '@apollo/client'; - -export const COMPANY_FIELDS_FRAGMENT = gql` - fragment CompanyFieldsFragment on Company { - accountOwner { - id - email - displayName - avatarUrl - } - address - createdAt - domainName - employees - linkedinUrl - id - name - } -`; - -export const UPDATE_ONE_COMPANY = gql` - mutation UpdateOneCompany( - $where: CompanyWhereUniqueInput! - $data: CompanyUpdateInput! - ) { - updateOneCompany(data: $data, where: $where) { - ...CompanyFieldsFragment - } - } -`; - -export const INSERT_ONE_COMPANY = gql` - mutation InsertOneCompany($data: CompanyCreateInput!) { - createOneCompany(data: $data) { - ...CompanyFieldsFragment - } - } -`; - -export const DELETE_MANY_COMPANIES = gql` - mutation DeleteManyCompanies($ids: [String!]) { - deleteManyCompany(where: { id: { in: $ids } }) { - count - } - } -`; diff --git a/front/src/modules/companies/table/components/CompanyTable.tsx b/front/src/modules/companies/table/components/CompanyTable.tsx index c5a5835e8..00a02e433 100644 --- a/front/src/modules/companies/table/components/CompanyTable.tsx +++ b/front/src/modules/companies/table/components/CompanyTable.tsx @@ -17,6 +17,7 @@ import { useTableViewFields } from '@/views/hooks/useTableViewFields'; import { useViewSorts } from '@/views/hooks/useViewSorts'; import { currentViewIdState } from '@/views/states/currentViewIdState'; import { + SortOrder, UpdateOneCompanyMutationVariables, useGetCompaniesQuery, useUpdateOneCompanyMutation, @@ -24,8 +25,6 @@ import { import { companiesFilters } from '~/pages/companies/companies-filters'; import { availableSorts } from '~/pages/companies/companies-sorts'; -import { defaultOrderBy } from '../../queries'; - export function CompanyTable() { const currentViewId = useRecoilValue(currentViewIdState); const orderBy = useRecoilScopedValue( @@ -61,7 +60,15 @@ export function CompanyTable() { { - updatePersonShowPage(data?.findUniquePerson); - }, - }); -} diff --git a/front/src/modules/people/graphql/queries/getPersonCity.ts b/front/src/modules/people/graphql/queries/getPersonCity.ts new file mode 100644 index 000000000..c24af2a24 --- /dev/null +++ b/front/src/modules/people/graphql/queries/getPersonCity.ts @@ -0,0 +1,10 @@ +import { gql } from '@apollo/client'; + +export const GET_PERSON_CITY = gql` + query GetPersonCityById($id: String!) { + person: findUniquePerson(id: $id) { + id + city + } + } +`; diff --git a/front/src/modules/people/graphql/queries/getPersonCommentCount.ts b/front/src/modules/people/graphql/queries/getPersonCommentCount.ts new file mode 100644 index 000000000..da0014805 --- /dev/null +++ b/front/src/modules/people/graphql/queries/getPersonCommentCount.ts @@ -0,0 +1,10 @@ +import { gql } from '@apollo/client'; + +export const GET_PERSON_COMMENT_COUNT = gql` + query GetPersonCommentCountById($id: String!) { + person: findUniquePerson(id: $id) { + id + _activityCount + } + } +`; diff --git a/front/src/modules/people/graphql/queries/getPersonCompany.ts b/front/src/modules/people/graphql/queries/getPersonCompany.ts new file mode 100644 index 000000000..b613607cd --- /dev/null +++ b/front/src/modules/people/graphql/queries/getPersonCompany.ts @@ -0,0 +1,14 @@ +import { gql } from '@apollo/client'; + +export const GET_PERSON_COMPANY = gql` + query GetPersonCompanyById($id: String!) { + person: findUniquePerson(id: $id) { + id + company { + id + name + domainName + } + } + } +`; diff --git a/front/src/modules/people/graphql/queries/getPersonCreatedAt.ts b/front/src/modules/people/graphql/queries/getPersonCreatedAt.ts new file mode 100644 index 000000000..04cd49822 --- /dev/null +++ b/front/src/modules/people/graphql/queries/getPersonCreatedAt.ts @@ -0,0 +1,10 @@ +import { gql } from '@apollo/client'; + +export const GET_PERSON_CREATED_AT = gql` + query GetPersonCreatedAtById($id: String!) { + person: findUniquePerson(id: $id) { + id + createdAt + } + } +`; diff --git a/front/src/modules/people/graphql/queries/getPersonEmail.ts b/front/src/modules/people/graphql/queries/getPersonEmail.ts new file mode 100644 index 000000000..ece37e1b9 --- /dev/null +++ b/front/src/modules/people/graphql/queries/getPersonEmail.ts @@ -0,0 +1,10 @@ +import { gql } from '@apollo/client'; + +export const GET_PERSON_EMAIL = gql` + query GetPersonEmailById($id: String!) { + person: findUniquePerson(id: $id) { + id + email + } + } +`; diff --git a/front/src/modules/people/graphql/queries/getPersonNamesAndCommentCount.ts b/front/src/modules/people/graphql/queries/getPersonNamesAndCommentCount.ts new file mode 100644 index 000000000..de9b9203c --- /dev/null +++ b/front/src/modules/people/graphql/queries/getPersonNamesAndCommentCount.ts @@ -0,0 +1,13 @@ +import { gql } from '@apollo/client'; + +export const GET_PERSON_NAMES_AND_COMMENT_COUNT = gql` + query GetPersonNamesAndCommentCountById($id: String!) { + person: findUniquePerson(id: $id) { + id + firstName + lastName + displayName + _activityCount + } + } +`; diff --git a/front/src/modules/people/graphql/queries/getPersonPhone.ts b/front/src/modules/people/graphql/queries/getPersonPhone.ts new file mode 100644 index 000000000..bea227947 --- /dev/null +++ b/front/src/modules/people/graphql/queries/getPersonPhone.ts @@ -0,0 +1,10 @@ +import { gql } from '@apollo/client'; + +export const GET_PERSON_PHONE = gql` + query GetPersonPhoneById($id: String!) { + person: findUniquePerson(id: $id) { + id + phone + } + } +`; diff --git a/front/src/modules/people/hooks/useFilteredSearchPeopleQuery.ts b/front/src/modules/people/hooks/useFilteredSearchPeopleQuery.ts new file mode 100644 index 000000000..5dcf041b0 --- /dev/null +++ b/front/src/modules/people/hooks/useFilteredSearchPeopleQuery.ts @@ -0,0 +1,31 @@ +import { ActivityTargetableEntityType } from '@/activities/types/ActivityTargetableEntity'; +import { ActivityTargetableEntityForSelect } from '@/activities/types/ActivityTargetableEntityForSelect'; +import { useFilteredSearchEntityQuery } from '@/search/hooks/useFilteredSearchEntityQuery'; +import { useSearchPeopleQuery } from '~/generated/graphql'; + +export function useFilteredSearchPeopleQuery({ + searchFilter, + selectedIds = [], + limit, +}: { + searchFilter: string; + selectedIds?: string[]; + limit?: number; +}) { + return useFilteredSearchEntityQuery({ + queryHook: useSearchPeopleQuery, + searchOnFields: ['firstName', 'lastName'], + orderByField: 'lastName', + selectedIds: selectedIds, + mappingFunction: (entity) => + ({ + id: entity.id, + entityType: ActivityTargetableEntityType.Person, + name: `${entity.firstName} ${entity.lastName}`, + avatarUrl: entity.avatarUrl, + avatarType: 'rounded', + } as ActivityTargetableEntityForSelect), + searchFilter, + limit, + }); +} diff --git a/front/src/modules/people/hooks/usePeopleTableContextMenuEntries.tsx b/front/src/modules/people/hooks/usePeopleTableContextMenuEntries.tsx index cb026cda4..7c02682ee 100644 --- a/front/src/modules/people/hooks/usePeopleTableContextMenuEntries.tsx +++ b/front/src/modules/people/hooks/usePeopleTableContextMenuEntries.tsx @@ -11,7 +11,7 @@ import { selectedRowIdsSelector } from '@/ui/table/states/selectors/selectedRowI import { tableRowIdsState } from '@/ui/table/states/tableRowIdsState'; import { ActivityType, useDeleteManyPersonMutation } from '~/generated/graphql'; -import { GET_PEOPLE } from '../queries'; +import { GET_PEOPLE } from '../graphql/queries/getPeople'; export function usePersonTableContextMenuEntries() { const setContextMenuEntries = useSetRecoilState(contextMenuEntriesState); diff --git a/front/src/modules/people/hooks/usePersonQuery.ts b/front/src/modules/people/hooks/usePersonQuery.ts new file mode 100644 index 000000000..928ec3a6f --- /dev/null +++ b/front/src/modules/people/hooks/usePersonQuery.ts @@ -0,0 +1,16 @@ +import { useSetRecoilState } from 'recoil'; + +import { genericEntitiesFamilyState } from '@/ui/editable-field/states/genericEntitiesFamilyState'; +import { useGetPersonQuery } from '~/generated/graphql'; + +export function usePersonQuery(id: string) { + const updatePersonShowPage = useSetRecoilState( + genericEntitiesFamilyState(id), + ); + return useGetPersonQuery({ + variables: { id }, + onCompleted: (data) => { + updatePersonShowPage(data?.findUniquePerson); + }, + }); +} diff --git a/front/src/modules/people/hooks/usePersonTableActionBarEntries.tsx b/front/src/modules/people/hooks/usePersonTableActionBarEntries.tsx index 74bfe98d7..0e3068e1d 100644 --- a/front/src/modules/people/hooks/usePersonTableActionBarEntries.tsx +++ b/front/src/modules/people/hooks/usePersonTableActionBarEntries.tsx @@ -11,7 +11,7 @@ import { selectedRowIdsSelector } from '@/ui/table/states/selectors/selectedRowI import { tableRowIdsState } from '@/ui/table/states/tableRowIdsState'; import { ActivityType, useDeleteManyPersonMutation } from '~/generated/graphql'; -import { GET_PEOPLE } from '../queries'; +import { GET_PEOPLE } from '../graphql/queries/getPeople'; export function usePersonTableActionBarEntries() { const setActionBarEntries = useSetRecoilState(actionBarEntriesState); diff --git a/front/src/modules/people/queries/__tests__/select.test.ts b/front/src/modules/people/queries/__tests__/select.test.ts deleted file mode 100644 index ab4885bac..000000000 --- a/front/src/modules/people/queries/__tests__/select.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { reduceSortsToOrderBy } from '@/ui/filter-n-sort/helpers'; - -import { PeopleSelectedSortType } from '../select'; - -describe('reduceSortsToOrderBy', () => { - it('should return an array of objects with the id as key and the order as value', () => { - const sorts = [ - { - key: 'firstName', - label: 'firstName', - order: 'asc', - }, - { - key: 'lastName', - label: 'lastName', - order: 'desc', - }, - ] satisfies PeopleSelectedSortType[]; - const result = reduceSortsToOrderBy(sorts); - expect(result).toEqual([{ firstName: 'asc' }, { lastName: 'desc' }]); - }); -}); diff --git a/front/src/modules/people/queries/index.ts b/front/src/modules/people/queries/index.ts deleted file mode 100644 index 41161a6b1..000000000 --- a/front/src/modules/people/queries/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './select'; -export * from './show'; -export * from './update'; diff --git a/front/src/modules/people/queries/select.ts b/front/src/modules/people/queries/select.ts deleted file mode 100644 index 0ef7b3774..000000000 --- a/front/src/modules/people/queries/select.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { gql } from '@apollo/client'; - -import { ActivityTargetableEntityType } from '@/activities/types/ActivityTargetableEntity'; -import { ActivityTargetableEntityForSelect } from '@/activities/types/ActivityTargetableEntityForSelect'; -import { useFilteredSearchEntityQuery } from '@/search/hooks/useFilteredSearchEntityQuery'; -import { SelectedSortType } from '@/ui/filter-n-sort/types/interface'; -import { - PersonOrderByWithRelationInput as People_Order_By, - PersonWhereInput as People_Bool_Exp, - SortOrder, - useGetPeopleQuery, - useSearchPeopleQuery, -} from '~/generated/graphql'; - -export type PeopleSelectedSortType = SelectedSortType; - -export const GET_PEOPLE = gql` - query GetPeople( - $orderBy: [PersonOrderByWithRelationInput!] - $where: PersonWhereInput - $limit: Int - ) { - people: findManyPerson(orderBy: $orderBy, where: $where, take: $limit) { - id - phone - email - city - firstName - lastName - displayName - jobTitle - linkedinUrl - xUrl - avatarUrl - createdAt - _activityCount - company { - id - name - domainName - } - } - } -`; - -export function usePeopleQuery( - orderBy: People_Order_By[], - where: People_Bool_Exp, -) { - return useGetPeopleQuery({ - variables: { orderBy, where }, - }); -} - -export function useFilteredSearchPeopleQuery({ - searchFilter, - selectedIds = [], - limit, -}: { - searchFilter: string; - selectedIds?: string[]; - limit?: number; -}) { - return useFilteredSearchEntityQuery({ - queryHook: useSearchPeopleQuery, - searchOnFields: ['firstName', 'lastName'], - orderByField: 'lastName', - selectedIds: selectedIds, - mappingFunction: (entity) => - ({ - id: entity.id, - entityType: ActivityTargetableEntityType.Person, - name: `${entity.firstName} ${entity.lastName}`, - avatarUrl: entity.avatarUrl, - avatarType: 'rounded', - } as ActivityTargetableEntityForSelect), - searchFilter, - limit, - }); -} - -export const defaultOrderBy: People_Order_By[] = [ - { - createdAt: SortOrder.Desc, - }, -]; - -export const GET_PERSON_PHONE = gql` - query GetPersonPhoneById($id: String!) { - person: findUniquePerson(id: $id) { - id - phone - } - } -`; - -export const GET_PERSON_EMAIL = gql` - query GetPersonEmailById($id: String!) { - person: findUniquePerson(id: $id) { - id - email - } - } -`; - -export const GET_PERSON_NAMES_AND_COMMENT_COUNT = gql` - query GetPersonNamesAndCommentCountById($id: String!) { - person: findUniquePerson(id: $id) { - id - firstName - lastName - displayName - _activityCount - } - } -`; - -export const GET_PERSON_COMPANY = gql` - query GetPersonCompanyById($id: String!) { - person: findUniquePerson(id: $id) { - id - company { - id - name - domainName - } - } - } -`; - -export const GET_PERSON_COMMENT_COUNT = gql` - query GetPersonCommentCountById($id: String!) { - person: findUniquePerson(id: $id) { - id - _activityCount - } - } -`; - -export const GET_PERSON_CREATED_AT = gql` - query GetPersonCreatedAtById($id: String!) { - person: findUniquePerson(id: $id) { - id - createdAt - } - } -`; - -export const GET_PERSON_CITY = gql` - query GetPersonCityById($id: String!) { - person: findUniquePerson(id: $id) { - id - city - } - } -`; diff --git a/front/src/modules/people/queries/update.ts b/front/src/modules/people/queries/update.ts deleted file mode 100644 index 7c3b00ebd..000000000 --- a/front/src/modules/people/queries/update.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { gql } from '@apollo/client'; - -export const UPDATE_ONE_PERSON = gql` - mutation UpdateOnePerson( - $where: PersonWhereUniqueInput! - $data: PersonUpdateInput! - ) { - updateOnePerson(data: $data, where: $where) { - id - city - company { - domainName - name - id - } - email - jobTitle - linkedinUrl - xUrl - firstName - lastName - displayName - phone - createdAt - } - } -`; - -export const INSERT_PERSON_FRAGMENT = gql` - fragment InsertPersonFragment on Person { - id - firstName - lastName - displayName - createdAt - } -`; - -export const INSERT_ONE_PERSON = gql` - mutation InsertOnePerson($data: PersonCreateInput!) { - createOnePerson(data: $data) { - ...InsertPersonFragment - } - } -`; - -export const DELETE_MANY_PERSON = gql` - mutation DeleteManyPerson($ids: [String!]) { - deleteManyPerson(where: { id: { in: $ids } }) { - count - } - } -`; - -export const UPDATE_PERSON_PICTURE = gql` - mutation UploadPersonPicture($id: String!, $file: Upload!) { - uploadPersonPicture(id: $id, file: $file) - } -`; - -export const REMOVE_PERSON_PICTURE = gql` - mutation RemovePersonPicture($where: PersonWhereUniqueInput!) { - updateOnePerson(data: { avatarUrl: null }, where: $where) { - id - avatarUrl - } - } -`; diff --git a/front/src/modules/people/table/components/PeopleTable.tsx b/front/src/modules/people/table/components/PeopleTable.tsx index c468e3f85..d0e8bfbd7 100644 --- a/front/src/modules/people/table/components/PeopleTable.tsx +++ b/front/src/modules/people/table/components/PeopleTable.tsx @@ -17,6 +17,7 @@ import { useTableViewFields } from '@/views/hooks/useTableViewFields'; import { useViewSorts } from '@/views/hooks/useViewSorts'; import { currentViewIdState } from '@/views/states/currentViewIdState'; import { + SortOrder, UpdateOnePersonMutationVariables, useGetPeopleQuery, useUpdateOnePersonMutation, @@ -24,8 +25,6 @@ import { import { peopleFilters } from '~/pages/people/people-filters'; import { availableSorts } from '~/pages/people/people-sorts'; -import { defaultOrderBy } from '../../queries'; - export function PeopleTable() { const currentViewId = useRecoilValue(currentViewIdState); const orderBy = useRecoilScopedValue( @@ -61,7 +60,15 @@ export function PeopleTable() { ; - -export const GET_PIPELINES = gql` - query GetPipelines($where: PipelineWhereInput) { - findManyPipeline(where: $where) { - id - name - pipelineProgressableType - pipelineStages { - id - name - color - index - } - } - } -`; - -export const GET_PIPELINE_PROGRESS = gql` - query GetPipelineProgress( - $where: PipelineProgressWhereInput - $orderBy: [PipelineProgressOrderByWithRelationInput!] - ) { - findManyPipelineProgress(where: $where, orderBy: $orderBy) { - id - pipelineStageId - companyId - personId - amount - closeDate - pointOfContactId - pointOfContact { - id - firstName - lastName - displayName - avatarUrl - } - probability - } - } -`; - -export const defaultPipelineProgressOrderBy: PipelineProgresses_Order_By[] = [ - { - createdAt: Order_By.Asc, - }, -]; diff --git a/front/src/modules/pipeline/queries/update.ts b/front/src/modules/pipeline/queries/update.ts deleted file mode 100644 index d39227426..000000000 --- a/front/src/modules/pipeline/queries/update.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { gql } from '@apollo/client'; - -export const DELETE_PIPELINE_PROGRESS = gql` - mutation DeleteManyPipelineProgress($ids: [String!]) { - deleteManyPipelineProgress(where: { id: { in: $ids } }) { - count - } - } -`; - -export const UPDATE_PIPELINE_STAGE = gql` - mutation UpdatePipelineStage($id: String, $data: PipelineStageUpdateInput!) { - updateOnePipelineStage(where: { id: $id }, data: $data) { - id - name - color - } - } -`; - -export const UPDATE_PIPELINE_PROGRESS = gql` - mutation UpdateOnePipelineProgress( - $data: PipelineProgressUpdateInput! - $where: PipelineProgressWhereUniqueInput! - ) { - updateOnePipelineProgress(where: $where, data: $data) { - id - amount - closeDate - probability - pointOfContact { - id - } - } - } -`; - -export const UPDATE_PIPELINE_PROGRESS_STAGE = gql` - mutation UpdateOnePipelineProgressStage( - $id: String - $pipelineStageId: String - ) { - updateOnePipelineProgress( - where: { id: $id } - data: { pipelineStage: { connect: { id: $pipelineStageId } } } - ) { - id - } - } -`; - -export const CREATE_COMPANY_PIPELINE_PROGRESS = gql` - mutation CreateOneCompanyPipelineProgress( - $uuid: String! - $companyId: String! - $pipelineId: String! - $pipelineStageId: String! - ) { - createOnePipelineProgress( - data: { - id: $uuid - company: { connect: { id: $companyId } } - pipeline: { connect: { id: $pipelineId } } - pipelineStage: { connect: { id: $pipelineStageId } } - } - ) { - id - } - } -`; diff --git a/front/src/modules/search/graphql/queries/searchActivityQuery.ts b/front/src/modules/search/graphql/queries/searchActivityQuery.ts new file mode 100644 index 000000000..48551e624 --- /dev/null +++ b/front/src/modules/search/graphql/queries/searchActivityQuery.ts @@ -0,0 +1,19 @@ +import { gql } from '@apollo/client'; + +export const SEARCH_ACTIVITY_QUERY = gql` + query SearchActivity( + $where: ActivityWhereInput + $limit: Int + $orderBy: [ActivityOrderByWithRelationInput!] + ) { + searchResults: findManyActivities( + where: $where + take: $limit + orderBy: $orderBy + ) { + id + title + body + } + } +`; diff --git a/front/src/modules/search/graphql/queries/searchCompanyQuery.ts b/front/src/modules/search/graphql/queries/searchCompanyQuery.ts new file mode 100644 index 000000000..41b2bbb53 --- /dev/null +++ b/front/src/modules/search/graphql/queries/searchCompanyQuery.ts @@ -0,0 +1,17 @@ +import { gql } from '@apollo/client'; + +export const SEARCH_COMPANY_QUERY = gql` + query SearchCompany( + $where: CompanyWhereInput + $limit: Int + $orderBy: [CompanyOrderByWithRelationInput!] + ) { + searchResults: findManyCompany( + where: $where + take: $limit + orderBy: $orderBy + ) { + ...CompanyFieldsFragment + } + } +`; diff --git a/front/src/modules/search/graphql/queries/searchPeopleQuery.ts b/front/src/modules/search/graphql/queries/searchPeopleQuery.ts new file mode 100644 index 000000000..c11fcd149 --- /dev/null +++ b/front/src/modules/search/graphql/queries/searchPeopleQuery.ts @@ -0,0 +1,25 @@ +import { gql } from '@apollo/client'; + +export const SEARCH_PEOPLE_QUERY = gql` + query SearchPeople( + $where: PersonWhereInput + $limit: Int + $orderBy: [PersonOrderByWithRelationInput!] + ) { + searchResults: findManyPerson( + where: $where + take: $limit + orderBy: $orderBy + ) { + id + phone + email + city + firstName + lastName + displayName + avatarUrl + createdAt + } + } +`; diff --git a/front/src/modules/search/graphql/queries/searchUserQuery.ts b/front/src/modules/search/graphql/queries/searchUserQuery.ts new file mode 100644 index 000000000..a3175765a --- /dev/null +++ b/front/src/modules/search/graphql/queries/searchUserQuery.ts @@ -0,0 +1,22 @@ +import { gql } from '@apollo/client'; + +export const SEARCH_USER_QUERY = gql` + query SearchUser( + $where: UserWhereInput + $limit: Int + $orderBy: [UserOrderByWithRelationInput!] + ) { + searchResults: findManyUser( + where: $where + take: $limit + orderBy: $orderBy + ) { + id + email + displayName + firstName + lastName + avatarUrl + } + } +`; diff --git a/front/src/modules/search/queries/search.ts b/front/src/modules/search/queries/search.ts deleted file mode 100644 index 9eb90ea8e..000000000 --- a/front/src/modules/search/queries/search.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { gql } from '@apollo/client'; - -export const SEARCH_PEOPLE_QUERY = gql` - query SearchPeople( - $where: PersonWhereInput - $limit: Int - $orderBy: [PersonOrderByWithRelationInput!] - ) { - searchResults: findManyPerson( - where: $where - take: $limit - orderBy: $orderBy - ) { - id - phone - email - city - firstName - lastName - displayName - avatarUrl - createdAt - } - } -`; - -export const SEARCH_USER_QUERY = gql` - query SearchUser( - $where: UserWhereInput - $limit: Int - $orderBy: [UserOrderByWithRelationInput!] - ) { - searchResults: findManyUser( - where: $where - take: $limit - orderBy: $orderBy - ) { - id - email - displayName - firstName - lastName - avatarUrl - } - } -`; -// TODO: remove this query -export const EMPTY_QUERY = gql` - query EmptyQuery { - searchResults: findManyUser { - id - } - } -`; - -export const SEARCH_COMPANY_QUERY = gql` - query SearchCompany( - $where: CompanyWhereInput - $limit: Int - $orderBy: [CompanyOrderByWithRelationInput!] - ) { - searchResults: findManyCompany( - where: $where - take: $limit - orderBy: $orderBy - ) { - ...CompanyFieldsFragment - } - } -`; - -export const SEARCH_ACTIVITY_QUERY = gql` - query SearchActivity( - $where: ActivityWhereInput - $limit: Int - $orderBy: [ActivityOrderByWithRelationInput!] - ) { - searchResults: findManyActivities( - where: $where - take: $limit - orderBy: $orderBy - ) { - id - title - body - } - } -`; diff --git a/front/src/modules/settings/profile/components/NameFields.tsx b/front/src/modules/settings/profile/components/NameFields.tsx index 8b3ba31a1..4315e3bcf 100644 --- a/front/src/modules/settings/profile/components/NameFields.tsx +++ b/front/src/modules/settings/profile/components/NameFields.tsx @@ -6,7 +6,7 @@ import { useRecoilValue } from 'recoil'; import { currentUserState } from '@/auth/states/currentUserState'; import { TextInput } from '@/ui/input/text/components/TextInput'; -import { GET_CURRENT_USER } from '@/users/queries'; +import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser'; import { useUpdateUserMutation } from '~/generated/graphql'; const StyledComboInputContainer = styled.div` diff --git a/front/src/modules/settings/profile/components/ProfilePictureUploader.tsx b/front/src/modules/settings/profile/components/ProfilePictureUploader.tsx index 8e107e5a5..5cbe3dfd8 100644 --- a/front/src/modules/settings/profile/components/ProfilePictureUploader.tsx +++ b/front/src/modules/settings/profile/components/ProfilePictureUploader.tsx @@ -3,7 +3,7 @@ import { useRecoilState } from 'recoil'; import { currentUserState } from '@/auth/states/currentUserState'; import { ImageInput } from '@/ui/input/image/components/ImageInput'; -import { GET_CURRENT_USER } from '@/users/queries'; +import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser'; import { getImageAbsoluteURIOrBase64 } from '@/users/utils/getProfilePictureAbsoluteURI'; import { useRemoveProfilePictureMutation, diff --git a/front/src/modules/settings/workspace/components/NameField.tsx b/front/src/modules/settings/workspace/components/NameField.tsx index 9073ef872..303541910 100644 --- a/front/src/modules/settings/workspace/components/NameField.tsx +++ b/front/src/modules/settings/workspace/components/NameField.tsx @@ -6,7 +6,7 @@ import { useRecoilState } from 'recoil'; import { currentUserState } from '@/auth/states/currentUserState'; import { TextInput } from '@/ui/input/text/components/TextInput'; -import { GET_CURRENT_USER } from '@/users/queries'; +import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser'; import { useUpdateWorkspaceMutation } from '~/generated/graphql'; const StyledComboInputContainer = styled.div` diff --git a/front/src/modules/settings/workspace/components/WorkspaceLogoUploader.tsx b/front/src/modules/settings/workspace/components/WorkspaceLogoUploader.tsx index 3b0dad0b7..d26eb839f 100644 --- a/front/src/modules/settings/workspace/components/WorkspaceLogoUploader.tsx +++ b/front/src/modules/settings/workspace/components/WorkspaceLogoUploader.tsx @@ -3,7 +3,7 @@ import { useRecoilState } from 'recoil'; import { currentUserState } from '@/auth/states/currentUserState'; import { ImageInput } from '@/ui/input/image/components/ImageInput'; -import { GET_CURRENT_USER } from '@/users/queries'; +import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser'; import { getImageAbsoluteURIOrBase64 } from '@/users/utils/getProfilePictureAbsoluteURI'; import { useRemoveWorkspaceLogoMutation, diff --git a/front/src/modules/ui/board/components/BoardActionBarButtonDeleteBoardCard.tsx b/front/src/modules/ui/board/components/BoardActionBarButtonDeleteBoardCard.tsx index 1f1f6713c..45e19ac45 100644 --- a/front/src/modules/ui/board/components/BoardActionBarButtonDeleteBoardCard.tsx +++ b/front/src/modules/ui/board/components/BoardActionBarButtonDeleteBoardCard.tsx @@ -1,7 +1,7 @@ import { getOperationName } from '@apollo/client/utilities'; import { useRecoilValue } from 'recoil'; -import { GET_PIPELINES } from '@/pipeline/queries'; +import { GET_PIPELINES } from '@/pipeline/graphql/queries/getPipelines'; import { ActionBarEntry } from '@/ui/action-bar/components/ActionBarEntry'; import { IconTrash } from '@/ui/icon/index'; import { useDeleteManyPipelineProgressMutation } from '~/generated/graphql'; diff --git a/front/src/modules/ui/board/components/EntityBoard.tsx b/front/src/modules/ui/board/components/EntityBoard.tsx index a12ccaea2..876cab423 100644 --- a/front/src/modules/ui/board/components/EntityBoard.tsx +++ b/front/src/modules/ui/board/components/EntityBoard.tsx @@ -7,7 +7,7 @@ import { IconList } from '@tabler/icons-react'; import { useRecoilState } from 'recoil'; import { CompanyBoardRecoilScopeContext } from '@/companies/states/recoil-scope-contexts/CompanyBoardRecoilScopeContext'; -import { GET_PIPELINE_PROGRESS } from '@/pipeline/queries'; +import { GET_PIPELINE_PROGRESS } from '@/pipeline/graphql/queries/getPipelineProgress'; import { BoardHeader } from '@/ui/board/components/BoardHeader'; import { StyledBoard } from '@/ui/board/components/StyledBoard'; import { BoardColumnIdContext } from '@/ui/board/contexts/BoardColumnIdContext'; diff --git a/front/src/modules/ui/table/components/GenericEntityTableData.tsx b/front/src/modules/ui/table/components/GenericEntityTableData.tsx index a9f4d45f6..917c78dd0 100644 --- a/front/src/modules/ui/table/components/GenericEntityTableData.tsx +++ b/front/src/modules/ui/table/components/GenericEntityTableData.tsx @@ -1,13 +1,17 @@ import { useEffect } from 'react'; -import { defaultOrderBy } from '@/people/queries'; import { FilterDefinition } from '@/ui/filter-n-sort/types/FilterDefinition'; import { useSetEntityTableData } from '@/ui/table/hooks/useSetEntityTableData'; +import { SortOrder } from '~/generated/graphql'; export function GenericEntityTableData({ useGetRequest, getRequestResultKey, - orderBy = defaultOrderBy, + orderBy = [ + { + createdAt: SortOrder.Desc, + }, + ], whereFilters, filterDefinitionArray, setActionBarEntries, diff --git a/front/src/modules/users/graphql/mutations/deleteUserAccount.ts b/front/src/modules/users/graphql/mutations/deleteUserAccount.ts new file mode 100644 index 000000000..feb1eedb7 --- /dev/null +++ b/front/src/modules/users/graphql/mutations/deleteUserAccount.ts @@ -0,0 +1,9 @@ +import { gql } from '@apollo/client'; + +export const DELETE_USER_ACCOUNT = gql` + mutation DeleteUserAccount { + deleteUserAccount { + id + } + } +`; diff --git a/front/src/modules/users/graphql/mutations/removeProfilePicture.ts b/front/src/modules/users/graphql/mutations/removeProfilePicture.ts new file mode 100644 index 000000000..906fd1d47 --- /dev/null +++ b/front/src/modules/users/graphql/mutations/removeProfilePicture.ts @@ -0,0 +1,10 @@ +import { gql } from '@apollo/client'; + +export const REMOVE_PROFILE_PICTURE = gql` + mutation RemoveProfilePicture($where: UserWhereUniqueInput!) { + updateUser(data: { avatarUrl: null }, where: $where) { + id + avatarUrl + } + } +`; diff --git a/front/src/modules/users/graphql/mutations/updateAllowImpersonation.ts b/front/src/modules/users/graphql/mutations/updateAllowImpersonation.ts new file mode 100644 index 000000000..62e06e7c8 --- /dev/null +++ b/front/src/modules/users/graphql/mutations/updateAllowImpersonation.ts @@ -0,0 +1,10 @@ +import { gql } from '@apollo/client'; + +export const UPDATE_ALLOW_IMPERSONATION = gql` + mutation UpdateAllowImpersonation($allowImpersonation: Boolean!) { + allowImpersonation(allowImpersonation: $allowImpersonation) { + id + allowImpersonation + } + } +`; diff --git a/front/src/modules/users/graphql/mutations/updateProfilePicture.ts b/front/src/modules/users/graphql/mutations/updateProfilePicture.ts new file mode 100644 index 000000000..573fb878c --- /dev/null +++ b/front/src/modules/users/graphql/mutations/updateProfilePicture.ts @@ -0,0 +1,7 @@ +import { gql } from '@apollo/client'; + +export const UPDATE_PROFILE_PICTURE = gql` + mutation UploadProfilePicture($file: Upload!) { + uploadProfilePicture(file: $file) + } +`; diff --git a/front/src/modules/users/graphql/mutations/updateUser.ts b/front/src/modules/users/graphql/mutations/updateUser.ts new file mode 100644 index 000000000..993b1cef7 --- /dev/null +++ b/front/src/modules/users/graphql/mutations/updateUser.ts @@ -0,0 +1,29 @@ +import { gql } from '@apollo/client'; + +export const UPDATE_USER = gql` + mutation UpdateUser($data: UserUpdateInput!, $where: UserWhereUniqueInput!) { + updateUser(data: $data, where: $where) { + id + email + displayName + firstName + lastName + avatarUrl + workspaceMember { + id + workspace { + id + domainName + displayName + logo + inviteHash + } + } + settings { + id + locale + colorScheme + } + } + } +`; diff --git a/front/src/modules/users/queries/index.ts b/front/src/modules/users/graphql/queries/getCurrentUser.ts similarity index 74% rename from front/src/modules/users/queries/index.ts rename to front/src/modules/users/graphql/queries/getCurrentUser.ts index 69ee88640..6d326fb17 100644 --- a/front/src/modules/users/queries/index.ts +++ b/front/src/modules/users/graphql/queries/getCurrentUser.ts @@ -1,5 +1,4 @@ import { gql } from '@apollo/client'; -export * from './update'; export const GET_CURRENT_USER = gql` query GetCurrentUser { @@ -31,15 +30,3 @@ export const GET_CURRENT_USER = gql` } } `; - -export const GET_USERS = gql` - query GetUsers { - findManyUser { - id - email - displayName - firstName - lastName - } - } -`; diff --git a/front/src/modules/users/graphql/queries/getUsers.ts b/front/src/modules/users/graphql/queries/getUsers.ts new file mode 100644 index 000000000..1df75f751 --- /dev/null +++ b/front/src/modules/users/graphql/queries/getUsers.ts @@ -0,0 +1,13 @@ +import { gql } from '@apollo/client'; + +export const GET_USERS = gql` + query GetUsers { + findManyUser { + id + email + displayName + firstName + lastName + } + } +`; diff --git a/front/src/modules/users/queries/update.ts b/front/src/modules/users/queries/update.ts deleted file mode 100644 index 1069ea103..000000000 --- a/front/src/modules/users/queries/update.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { gql } from '@apollo/client'; - -export const UPDATE_USER = gql` - mutation UpdateUser($data: UserUpdateInput!, $where: UserWhereUniqueInput!) { - updateUser(data: $data, where: $where) { - id - email - displayName - firstName - lastName - avatarUrl - workspaceMember { - id - workspace { - id - domainName - displayName - logo - inviteHash - } - } - settings { - id - locale - colorScheme - } - } - } -`; - -export const UPDATE_ALLOW_IMPERONATION = gql` - mutation UpdateAllowImpersonation($allowImpersonation: Boolean!) { - allowImpersonation(allowImpersonation: $allowImpersonation) { - id - allowImpersonation - } - } -`; - -export const UPDATE_PROFILE_PICTURE = gql` - mutation UploadProfilePicture($file: Upload!) { - uploadProfilePicture(file: $file) - } -`; - -export const REMOVE_PROFILE_PICTURE = gql` - mutation RemoveProfilePicture($where: UserWhereUniqueInput!) { - updateUser(data: { avatarUrl: null }, where: $where) { - id - avatarUrl - } - } -`; - -export const DELETE_USER_ACCOUNT = gql` - mutation DeleteUserAccount { - deleteUserAccount { - id - } - } -`; diff --git a/front/src/modules/views/queries/create.ts b/front/src/modules/views/graphql/mutations/createViewFields.ts similarity index 55% rename from front/src/modules/views/queries/create.ts rename to front/src/modules/views/graphql/mutations/createViewFields.ts index d6c81ed8f..a91b4264d 100644 --- a/front/src/modules/views/queries/create.ts +++ b/front/src/modules/views/graphql/mutations/createViewFields.ts @@ -7,11 +7,3 @@ export const CREATE_VIEW_FIELDS = gql` } } `; - -export const CREATE_VIEW_SORTS = gql` - mutation CreateViewSorts($data: [ViewSortCreateManyInput!]!) { - createManyViewSort(data: $data) { - count - } - } -`; diff --git a/front/src/modules/views/graphql/mutations/createViewSorts.ts b/front/src/modules/views/graphql/mutations/createViewSorts.ts new file mode 100644 index 000000000..2473c6d15 --- /dev/null +++ b/front/src/modules/views/graphql/mutations/createViewSorts.ts @@ -0,0 +1,9 @@ +import { gql } from '@apollo/client'; + +export const CREATE_VIEW_SORTS = gql` + mutation CreateViewSorts($data: [ViewSortCreateManyInput!]!) { + createManyViewSort(data: $data) { + count + } + } +`; diff --git a/front/src/modules/views/queries/delete.ts b/front/src/modules/views/graphql/mutations/deleteViewSorts.ts similarity index 100% rename from front/src/modules/views/queries/delete.ts rename to front/src/modules/views/graphql/mutations/deleteViewSorts.ts diff --git a/front/src/modules/views/queries/update.ts b/front/src/modules/views/graphql/mutations/updateViewField.ts similarity index 55% rename from front/src/modules/views/queries/update.ts rename to front/src/modules/views/graphql/mutations/updateViewField.ts index 3430eac34..c270d7a6b 100644 --- a/front/src/modules/views/queries/update.ts +++ b/front/src/modules/views/graphql/mutations/updateViewField.ts @@ -14,16 +14,3 @@ export const UPDATE_VIEW_FIELD = gql` } } `; - -export const UPDATE_VIEW_SORT = gql` - mutation UpdateViewSort( - $data: ViewSortUpdateInput! - $where: ViewSortWhereUniqueInput! - ) { - viewSort: updateOneViewSort(data: $data, where: $where) { - direction - key - name - } - } -`; diff --git a/front/src/modules/views/graphql/mutations/updateViewSort.ts b/front/src/modules/views/graphql/mutations/updateViewSort.ts new file mode 100644 index 000000000..c46f618e9 --- /dev/null +++ b/front/src/modules/views/graphql/mutations/updateViewSort.ts @@ -0,0 +1,14 @@ +import { gql } from '@apollo/client'; + +export const UPDATE_VIEW_SORT = gql` + mutation UpdateViewSort( + $data: ViewSortUpdateInput! + $where: ViewSortWhereUniqueInput! + ) { + viewSort: updateOneViewSort(data: $data, where: $where) { + direction + key + name + } + } +`; diff --git a/front/src/modules/views/queries/select.ts b/front/src/modules/views/graphql/queries/getViewFields.ts similarity index 64% rename from front/src/modules/views/queries/select.ts rename to front/src/modules/views/graphql/queries/getViewFields.ts index 6cadcde8c..735405c48 100644 --- a/front/src/modules/views/queries/select.ts +++ b/front/src/modules/views/graphql/queries/getViewFields.ts @@ -14,13 +14,3 @@ export const GET_VIEW_FIELDS = gql` } } `; - -export const GET_VIEW_SORTS = gql` - query GetViewSorts($where: ViewSortWhereInput) { - viewSorts: findManyViewSort(where: $where) { - direction - key - name - } - } -`; diff --git a/front/src/modules/views/graphql/queries/getViewSorts.ts b/front/src/modules/views/graphql/queries/getViewSorts.ts new file mode 100644 index 000000000..39d4494b3 --- /dev/null +++ b/front/src/modules/views/graphql/queries/getViewSorts.ts @@ -0,0 +1,11 @@ +import { gql } from '@apollo/client'; + +export const GET_VIEW_SORTS = gql` + query GetViewSorts($where: ViewSortWhereInput) { + viewSorts: findManyViewSort(where: $where) { + direction + key + name + } + } +`; diff --git a/front/src/modules/views/hooks/useTableViewFields.ts b/front/src/modules/views/hooks/useTableViewFields.ts index c911584af..95384f851 100644 --- a/front/src/modules/views/hooks/useTableViewFields.ts +++ b/front/src/modules/views/hooks/useTableViewFields.ts @@ -19,7 +19,7 @@ import { useUpdateViewFieldMutation, } from '~/generated/graphql'; -import { GET_VIEW_FIELDS } from '../queries/select'; +import { GET_VIEW_FIELDS } from '../graphql/queries/getViewFields'; const DEFAULT_VIEW_FIELD_METADATA: ViewFieldTextMetadata = { type: 'text', diff --git a/front/src/modules/views/hooks/useViewSorts.ts b/front/src/modules/views/hooks/useViewSorts.ts index 81ec89b00..866a0d506 100644 --- a/front/src/modules/views/hooks/useViewSorts.ts +++ b/front/src/modules/views/hooks/useViewSorts.ts @@ -21,7 +21,7 @@ import { ViewSortDirection, } from '~/generated/graphql'; -import { GET_VIEW_SORTS } from '../queries/select'; +import { GET_VIEW_SORTS } from '../graphql/queries/getViewSorts'; export const useViewSorts = ({ availableSorts, diff --git a/front/src/modules/workspace/graphql/mutations/deleteCurrentWorkspace.ts b/front/src/modules/workspace/graphql/mutations/deleteCurrentWorkspace.ts new file mode 100644 index 000000000..f38d74347 --- /dev/null +++ b/front/src/modules/workspace/graphql/mutations/deleteCurrentWorkspace.ts @@ -0,0 +1,9 @@ +import { gql } from '@apollo/client'; + +export const DELETE_CURRENT_WORKSPACE = gql` + mutation DeleteCurrentWorkspace { + deleteCurrentWorkspace { + id + } + } +`; diff --git a/front/src/modules/workspace/graphql/mutations/removeWorkspaceLogo.ts b/front/src/modules/workspace/graphql/mutations/removeWorkspaceLogo.ts new file mode 100644 index 000000000..7f1b09623 --- /dev/null +++ b/front/src/modules/workspace/graphql/mutations/removeWorkspaceLogo.ts @@ -0,0 +1,9 @@ +import { gql } from '@apollo/client'; + +export const REMOVE_WORKSPACE_LOGO = gql` + mutation RemoveWorkspaceLogo { + updateWorkspace(data: { logo: null }) { + id + } + } +`; diff --git a/front/src/modules/workspace/graphql/mutations/removeWorkspaceMember.ts b/front/src/modules/workspace/graphql/mutations/removeWorkspaceMember.ts new file mode 100644 index 000000000..4dcad80d3 --- /dev/null +++ b/front/src/modules/workspace/graphql/mutations/removeWorkspaceMember.ts @@ -0,0 +1,9 @@ +import { gql } from '@apollo/client'; + +export const REMOVE_WORKSPACE_MEMBER = gql` + mutation RemoveWorkspaceMember($where: WorkspaceMemberWhereUniqueInput!) { + deleteWorkspaceMember(where: $where) { + id + } + } +`; diff --git a/front/src/modules/workspace/graphql/mutations/updateWorkspace.ts b/front/src/modules/workspace/graphql/mutations/updateWorkspace.ts new file mode 100644 index 000000000..8ed42c7a2 --- /dev/null +++ b/front/src/modules/workspace/graphql/mutations/updateWorkspace.ts @@ -0,0 +1,12 @@ +import { gql } from '@apollo/client'; + +export const UPDATE_WORKSPACE = gql` + mutation UpdateWorkspace($data: WorkspaceUpdateInput!) { + updateWorkspace(data: $data) { + id + domainName + displayName + logo + } + } +`; diff --git a/front/src/modules/workspace/graphql/mutations/updateWorkspaceLogo.ts b/front/src/modules/workspace/graphql/mutations/updateWorkspaceLogo.ts new file mode 100644 index 000000000..f89d18cb2 --- /dev/null +++ b/front/src/modules/workspace/graphql/mutations/updateWorkspaceLogo.ts @@ -0,0 +1,7 @@ +import { gql } from '@apollo/client'; + +export const UPDATE_WORKSPACE_LOGO = gql` + mutation UploadWorkspaceLogo($file: Upload!) { + uploadWorkspaceLogo(file: $file) + } +`; diff --git a/front/src/modules/workspace/graphql/queries/getWorkspaceFromInviteHash.ts b/front/src/modules/workspace/graphql/queries/getWorkspaceFromInviteHash.ts new file mode 100644 index 000000000..eaca90095 --- /dev/null +++ b/front/src/modules/workspace/graphql/queries/getWorkspaceFromInviteHash.ts @@ -0,0 +1,11 @@ +import { gql } from '@apollo/client'; + +export const GET_WORKSPACE_FROM_INVITE_HASH = gql` + query GetWorkspaceFromInviteHash($inviteHash: String!) { + findWorkspaceFromInviteHash(inviteHash: $inviteHash) { + id + displayName + logo + } + } +`; diff --git a/front/src/modules/workspace/queries/select.ts b/front/src/modules/workspace/graphql/queries/getWorkspaceMembers.ts similarity index 57% rename from front/src/modules/workspace/queries/select.ts rename to front/src/modules/workspace/graphql/queries/getWorkspaceMembers.ts index dd248175c..5a670d7c5 100644 --- a/front/src/modules/workspace/queries/select.ts +++ b/front/src/modules/workspace/graphql/queries/getWorkspaceMembers.ts @@ -15,13 +15,3 @@ export const GET_WORKSPACE_MEMBERS = gql` } } `; - -export const GET_WORKSPACE_FROM_INVITE_HASH = gql` - query GetWorkspaceFromInviteHash($inviteHash: String!) { - findWorkspaceFromInviteHash(inviteHash: $inviteHash) { - id - displayName - logo - } - } -`; diff --git a/front/src/modules/workspace/queries/index.ts b/front/src/modules/workspace/queries/index.ts deleted file mode 100644 index 18c6c2f7d..000000000 --- a/front/src/modules/workspace/queries/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './select'; -export * from './update'; diff --git a/front/src/modules/workspace/queries/update.ts b/front/src/modules/workspace/queries/update.ts deleted file mode 100644 index f2c1e4f4b..000000000 --- a/front/src/modules/workspace/queries/update.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { gql } from '@apollo/client'; - -export const UPDATE_WORKSPACE = gql` - mutation UpdateWorkspace($data: WorkspaceUpdateInput!) { - updateWorkspace(data: $data) { - id - domainName - displayName - logo - } - } -`; - -export const UPDATE_WORKSPACE_LOGO = gql` - mutation UploadWorkspaceLogo($file: Upload!) { - uploadWorkspaceLogo(file: $file) - } -`; - -export const REMOVE_WORKSPACE_LOGO = gql` - mutation RemoveWorkspaceLogo { - updateWorkspace(data: { logo: null }) { - id - } - } -`; - -export const REMOVE_WORKSPACE_MEMBER = gql` - mutation RemoveWorkspaceMember($where: WorkspaceMemberWhereUniqueInput!) { - deleteWorkspaceMember(where: $where) { - id - } - } -`; - -export const DELETE_CURRENT_WORKSPACE = gql` - mutation DeleteCurrentWorkspace { - deleteCurrentWorkspace { - id - } - } -`; diff --git a/front/src/pages/auth/CreateProfile.tsx b/front/src/pages/auth/CreateProfile.tsx index e1949ba89..2cf384709 100644 --- a/front/src/pages/auth/CreateProfile.tsx +++ b/front/src/pages/auth/CreateProfile.tsx @@ -18,7 +18,7 @@ import { TextInput } from '@/ui/input/text/components/TextInput'; import { useSnackBar } from '@/ui/snack-bar/hooks/useSnackBar'; import { H2Title } from '@/ui/typography/components/H2Title'; import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys'; -import { GET_CURRENT_USER } from '@/users/queries'; +import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser'; import { useUpdateUserMutation } from '~/generated/graphql'; const StyledContentContainer = styled.div` diff --git a/front/src/pages/auth/CreateWorkspace.tsx b/front/src/pages/auth/CreateWorkspace.tsx index c39087e98..c7f1efe8b 100644 --- a/front/src/pages/auth/CreateWorkspace.tsx +++ b/front/src/pages/auth/CreateWorkspace.tsx @@ -15,7 +15,7 @@ import { TextInput } from '@/ui/input/text/components/TextInput'; import { useSnackBar } from '@/ui/snack-bar/hooks/useSnackBar'; import { H2Title } from '@/ui/typography/components/H2Title'; import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys'; -import { GET_CURRENT_USER } from '@/users/queries'; +import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser'; import { useUpdateWorkspaceMutation } from '~/generated/graphql'; const StyledContentContainer = styled.div` diff --git a/front/src/pages/auth/__stories__/CreateProfile.stories.tsx b/front/src/pages/auth/__stories__/CreateProfile.stories.tsx index ad89c28b2..2f86af09f 100644 --- a/front/src/pages/auth/__stories__/CreateProfile.stories.tsx +++ b/front/src/pages/auth/__stories__/CreateProfile.stories.tsx @@ -10,7 +10,7 @@ import { } from '~/testing/decorators/PageDecorator'; import { mockedOnboardingUsersData } from '~/testing/mock-data/users'; -import { GET_CURRENT_USER } from '../../../modules/users/queries'; +import { GET_CURRENT_USER } from '../../../modules/users/graphql/queries/getCurrentUser'; import { CreateProfile } from '../CreateProfile'; const meta: Meta = { diff --git a/front/src/pages/auth/__stories__/CreateWorkspace.stories.tsx b/front/src/pages/auth/__stories__/CreateWorkspace.stories.tsx index ac8fd4a9b..1b8b7ebea 100644 --- a/front/src/pages/auth/__stories__/CreateWorkspace.stories.tsx +++ b/front/src/pages/auth/__stories__/CreateWorkspace.stories.tsx @@ -10,7 +10,7 @@ import { } from '~/testing/decorators/PageDecorator'; import { mockedOnboardingUsersData } from '~/testing/mock-data/users'; -import { GET_CURRENT_USER } from '../../../modules/users/queries'; +import { GET_CURRENT_USER } from '../../../modules/users/graphql/queries/getCurrentUser'; import { CreateWorkspace } from '../CreateWorkspace'; const meta: Meta = { diff --git a/front/src/pages/companies/Companies.tsx b/front/src/pages/companies/Companies.tsx index 3a0d65c73..3a192cb3c 100644 --- a/front/src/pages/companies/Companies.tsx +++ b/front/src/pages/companies/Companies.tsx @@ -4,7 +4,7 @@ import styled from '@emotion/styled'; import { v4 } from 'uuid'; import { CompanyTable } from '@/companies/table/components/CompanyTable'; -import { SEARCH_COMPANY_QUERY } from '@/search/queries/search'; +import { SEARCH_COMPANY_QUERY } from '@/search/graphql/queries/searchCompanyQuery'; import { IconBuildingSkyscraper } from '@/ui/icon'; import { WithTopBarContainer } from '@/ui/layout/components/WithTopBarContainer'; import { EntityTableActionBar } from '@/ui/table/action-bar/components/EntityTableActionBar'; diff --git a/front/src/pages/companies/CompanyShow.tsx b/front/src/pages/companies/CompanyShow.tsx index f9fb9db0b..d5346f431 100644 --- a/front/src/pages/companies/CompanyShow.tsx +++ b/front/src/pages/companies/CompanyShow.tsx @@ -4,7 +4,7 @@ import { useTheme } from '@emotion/react'; import { Timeline } from '@/activities/timeline/components/Timeline'; import { ActivityTargetableEntityType } from '@/activities/types/ActivityTargetableEntity'; import { CompanyTeam } from '@/companies/components/CompanyTeam'; -import { useCompanyQuery } from '@/companies/queries'; +import { useCompanyQuery } from '@/companies/hooks/useCompanyQuery'; import { useFavorites } from '@/favorites/hooks/useFavorites'; import { GenericEditableField } from '@/ui/editable-field/components/GenericEditableField'; import { EditableFieldDefinitionContext } from '@/ui/editable-field/contexts/EditableFieldDefinitionContext'; diff --git a/front/src/pages/companies/__stories__/Company.stories.tsx b/front/src/pages/companies/__stories__/Company.stories.tsx index 0c6f0267e..497242bb9 100644 --- a/front/src/pages/companies/__stories__/Company.stories.tsx +++ b/front/src/pages/companies/__stories__/Company.stories.tsx @@ -4,9 +4,11 @@ import type { Meta, StoryObj } from '@storybook/react'; import { fireEvent, within } from '@storybook/testing-library'; import { graphql } from 'msw'; -import { GET_ACTIVITIES_BY_TARGETS, GET_ACTIVITY } from '@/activities/queries'; -import { CREATE_ACTIVITY_WITH_COMMENT } from '@/activities/queries/create'; -import { GET_COMPANY, UPDATE_ONE_COMPANY } from '@/companies/queries'; +import { CREATE_ACTIVITY_WITH_COMMENT } from '@/activities/graphql/mutations/createActivityWithComment'; +import { GET_ACTIVITIES_BY_TARGETS } from '@/activities/graphql/queries/getActivitiesByTarget'; +import { GET_ACTIVITY } from '@/activities/graphql/queries/getActivity'; +import { UPDATE_ONE_COMPANY } from '@/companies/graphql/mutations/updateOneCompany'; +import { GET_COMPANY } from '@/companies/graphql/queries/getCompany'; import { AppPath } from '@/types/AppPath'; import { PageDecorator, diff --git a/front/src/pages/opportunities/Opportunities.tsx b/front/src/pages/opportunities/Opportunities.tsx index 92b2d3bd9..f40704b8d 100644 --- a/front/src/pages/opportunities/Opportunities.tsx +++ b/front/src/pages/opportunities/Opportunities.tsx @@ -3,19 +3,17 @@ import { useTheme } from '@emotion/react'; import { HooksCompanyBoard } from '@/companies/components/HooksCompanyBoard'; import { CompanyBoardRecoilScopeContext } from '@/companies/states/recoil-scope-contexts/CompanyBoardRecoilScopeContext'; -import { - defaultPipelineProgressOrderBy, - PipelineProgressesSelectedSortType, -} from '@/pipeline/queries'; import { EntityBoard } from '@/ui/board/components/EntityBoard'; import { EntityBoardActionBar } from '@/ui/board/components/EntityBoardActionBar'; import { BoardOptionsContext } from '@/ui/board/contexts/BoardOptionsContext'; import { reduceSortsToOrderBy } from '@/ui/filter-n-sort/helpers'; +import { SelectedSortType } from '@/ui/filter-n-sort/types/interface'; import { IconTargetArrow } from '@/ui/icon/index'; import { WithTopBarContainer } from '@/ui/layout/components/WithTopBarContainer'; import { RecoilScope } from '@/ui/utilities/recoil-scope/components/RecoilScope'; import { PipelineProgressOrderByWithRelationInput, + SortOrder, useUpdatePipelineStageMutation, } from '~/generated/graphql'; import { opportunitiesBoardOptions } from '~/pages/opportunities/opportunitiesBoardOptions'; @@ -25,14 +23,16 @@ export function Opportunities() { const [orderBy, setOrderBy] = useState< PipelineProgressOrderByWithRelationInput[] - >(defaultPipelineProgressOrderBy); + >([{ createdAt: SortOrder.Asc }]); const updateSorts = useCallback( - (sorts: Array) => { + ( + sorts: Array>, + ) => { setOrderBy( sorts.length ? reduceSortsToOrderBy(sorts) - : defaultPipelineProgressOrderBy, + : [{ createdAt: SortOrder.Asc }], ); }, [], diff --git a/front/src/pages/people/PersonShow.tsx b/front/src/pages/people/PersonShow.tsx index 6f0aeea2e..5babac939 100644 --- a/front/src/pages/people/PersonShow.tsx +++ b/front/src/pages/people/PersonShow.tsx @@ -5,7 +5,8 @@ import { useTheme } from '@emotion/react'; import { Timeline } from '@/activities/timeline/components/Timeline'; import { ActivityTargetableEntityType } from '@/activities/types/ActivityTargetableEntity'; import { useFavorites } from '@/favorites/hooks/useFavorites'; -import { GET_PERSON, usePersonQuery } from '@/people/queries'; +import { GET_PERSON } from '@/people/graphql/queries/getPerson'; +import { usePersonQuery } from '@/people/hooks/usePersonQuery'; import { GenericEditableField } from '@/ui/editable-field/components/GenericEditableField'; import { EditableFieldDefinitionContext } from '@/ui/editable-field/contexts/EditableFieldDefinitionContext'; import { EditableFieldEntityIdContext } from '@/ui/editable-field/contexts/EditableFieldEntityIdContext'; diff --git a/front/src/pages/people/__stories__/People.inputs.stories.tsx b/front/src/pages/people/__stories__/People.inputs.stories.tsx index d879a54a3..e0917fac4 100644 --- a/front/src/pages/people/__stories__/People.inputs.stories.tsx +++ b/front/src/pages/people/__stories__/People.inputs.stories.tsx @@ -4,8 +4,8 @@ import type { Meta } from '@storybook/react'; import { userEvent, within } from '@storybook/testing-library'; import { graphql } from 'msw'; -import { UPDATE_ONE_PERSON } from '@/people/queries'; -import { SEARCH_COMPANY_QUERY } from '@/search/queries/search'; +import { UPDATE_ONE_PERSON } from '@/people/graphql/mutations/updateOnePerson'; +import { SEARCH_COMPANY_QUERY } from '@/search/graphql/queries/searchCompanyQuery'; import { AppPath } from '@/types/AppPath'; import { Company } from '~/generated/graphql'; import { diff --git a/front/src/testing/graphqlMocks.ts b/front/src/testing/graphqlMocks.ts index a531f698c..5adccef1f 100644 --- a/front/src/testing/graphqlMocks.ts +++ b/front/src/testing/graphqlMocks.ts @@ -1,21 +1,22 @@ import { getOperationName } from '@apollo/client/utilities'; import { graphql } from 'msw'; -import { GET_ACTIVITIES } from '@/activities/queries'; -import { CREATE_ACTIVITY_WITH_COMMENT } from '@/activities/queries/create'; -import { CREATE_EVENT } from '@/analytics/queries'; -import { GET_CLIENT_CONFIG } from '@/client-config/queries'; -import { GET_COMPANIES } from '@/companies/queries'; -import { GET_PEOPLE, GET_PERSON, UPDATE_ONE_PERSON } from '@/people/queries'; -import { GET_PIPELINE_PROGRESS, GET_PIPELINES } from '@/pipeline/queries'; -import { - SEARCH_ACTIVITY_QUERY, - SEARCH_COMPANY_QUERY, - SEARCH_PEOPLE_QUERY, - SEARCH_USER_QUERY, -} from '@/search/queries/search'; -import { GET_CURRENT_USER } from '@/users/queries'; -import { GET_VIEW_FIELDS } from '@/views/queries/select'; +import { CREATE_ACTIVITY_WITH_COMMENT } from '@/activities/graphql/mutations/createActivityWithComment'; +import { GET_ACTIVITIES } from '@/activities/graphql/queries/getActivities'; +import { CREATE_EVENT } from '@/analytics/graphql/queries/createEvent'; +import { GET_CLIENT_CONFIG } from '@/client-config/graphql/queries/getClientConfig'; +import { GET_COMPANIES } from '@/companies/graphql/queries/getCompanies'; +import { UPDATE_ONE_PERSON } from '@/people/graphql/mutations/updateOnePerson'; +import { GET_PEOPLE } from '@/people/graphql/queries/getPeople'; +import { GET_PERSON } from '@/people/graphql/queries/getPerson'; +import { GET_PIPELINE_PROGRESS } from '@/pipeline/graphql/queries/getPipelineProgress'; +import { GET_PIPELINES } from '@/pipeline/graphql/queries/getPipelines'; +import { SEARCH_ACTIVITY_QUERY } from '@/search/graphql/queries/searchActivityQuery'; +import { SEARCH_COMPANY_QUERY } from '@/search/graphql/queries/searchCompanyQuery'; +import { SEARCH_PEOPLE_QUERY } from '@/search/graphql/queries/searchPeopleQuery'; +import { SEARCH_USER_QUERY } from '@/search/graphql/queries/searchUserQuery'; +import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser'; +import { GET_VIEW_FIELDS } from '@/views/graphql/queries/getViewFields'; import { GetCompaniesQuery, GetPeopleQuery,