feat: disable atomic operation on nestjs graphql models (#751)

* feat: no atomic

* feat: update front not atomic operations

* feat: optional fields for person model & use proper gql type

* Fix bug display name

* Fix bug update user

* Fixed bug avatar URL

* Fixed display name on people cell

* Fix lint

* Fixed storybook display name

* Fix storybook requests

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Jérémy M
2023-07-20 21:23:35 +02:00
committed by GitHub
parent 663c4d5c3f
commit 872ec9e6bb
58 changed files with 622 additions and 652 deletions

View File

@ -128,10 +128,6 @@ export type AuthTokens = {
tokens: AuthTokenPair; tokens: AuthTokenPair;
}; };
export type BoolFieldUpdateOperationsInput = {
set?: InputMaybe<Scalars['Boolean']>;
};
export type BoolFilter = { export type BoolFilter = {
equals?: InputMaybe<Scalars['Boolean']>; equals?: InputMaybe<Scalars['Boolean']>;
not?: InputMaybe<NestedBoolFilter>; not?: InputMaybe<NestedBoolFilter>;
@ -362,17 +358,17 @@ export type CommentThreadUpdateInput = {
assignee?: InputMaybe<UserUpdateOneWithoutAssignedCommentThreadsNestedInput>; assignee?: InputMaybe<UserUpdateOneWithoutAssignedCommentThreadsNestedInput>;
attachments?: InputMaybe<AttachmentUpdateManyWithoutActivityNestedInput>; attachments?: InputMaybe<AttachmentUpdateManyWithoutActivityNestedInput>;
author?: InputMaybe<UserUpdateOneRequiredWithoutAuthoredCommentThreadsNestedInput>; author?: InputMaybe<UserUpdateOneRequiredWithoutAuthoredCommentThreadsNestedInput>;
body?: InputMaybe<NullableStringFieldUpdateOperationsInput>; body?: InputMaybe<Scalars['String']>;
commentThreadTargets?: InputMaybe<CommentThreadTargetUpdateManyWithoutCommentThreadNestedInput>; commentThreadTargets?: InputMaybe<CommentThreadTargetUpdateManyWithoutCommentThreadNestedInput>;
comments?: InputMaybe<CommentUpdateManyWithoutCommentThreadNestedInput>; comments?: InputMaybe<CommentUpdateManyWithoutCommentThreadNestedInput>;
completedAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>; completedAt?: InputMaybe<Scalars['DateTime']>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; createdAt?: InputMaybe<Scalars['DateTime']>;
dueAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>; dueAt?: InputMaybe<Scalars['DateTime']>;
id?: InputMaybe<StringFieldUpdateOperationsInput>; id?: InputMaybe<Scalars['String']>;
reminderAt?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>; reminderAt?: InputMaybe<Scalars['DateTime']>;
title?: InputMaybe<NullableStringFieldUpdateOperationsInput>; title?: InputMaybe<Scalars['String']>;
type?: InputMaybe<EnumActivityTypeFieldUpdateOperationsInput>; type?: InputMaybe<ActivityType>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; updatedAt?: InputMaybe<Scalars['DateTime']>;
}; };
export type CommentThreadUpdateManyWithoutAssigneeNestedInput = { export type CommentThreadUpdateManyWithoutAssigneeNestedInput = {
@ -536,14 +532,14 @@ export enum CompanyScalarFieldEnum {
export type CompanyUpdateInput = { export type CompanyUpdateInput = {
accountOwner?: InputMaybe<UserUpdateOneWithoutCompaniesNestedInput>; accountOwner?: InputMaybe<UserUpdateOneWithoutCompaniesNestedInput>;
address?: InputMaybe<StringFieldUpdateOperationsInput>; address?: InputMaybe<Scalars['String']>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; createdAt?: InputMaybe<Scalars['DateTime']>;
domainName?: InputMaybe<StringFieldUpdateOperationsInput>; domainName?: InputMaybe<Scalars['String']>;
employees?: InputMaybe<NullableIntFieldUpdateOperationsInput>; employees?: InputMaybe<Scalars['Int']>;
id?: InputMaybe<StringFieldUpdateOperationsInput>; id?: InputMaybe<Scalars['String']>;
name?: InputMaybe<StringFieldUpdateOperationsInput>; name?: InputMaybe<Scalars['String']>;
people?: InputMaybe<PersonUpdateManyWithoutCompanyNestedInput>; people?: InputMaybe<PersonUpdateManyWithoutCompanyNestedInput>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; updatedAt?: InputMaybe<Scalars['DateTime']>;
}; };
export type CompanyUpdateManyWithoutAccountOwnerNestedInput = { export type CompanyUpdateManyWithoutAccountOwnerNestedInput = {
@ -583,10 +579,6 @@ export type CompanyWhereUniqueInput = {
id?: InputMaybe<Scalars['String']>; id?: InputMaybe<Scalars['String']>;
}; };
export type DateTimeFieldUpdateOperationsInput = {
set?: InputMaybe<Scalars['DateTime']>;
};
export type DateTimeFilter = { export type DateTimeFilter = {
equals?: InputMaybe<Scalars['DateTime']>; equals?: InputMaybe<Scalars['DateTime']>;
gt?: InputMaybe<Scalars['DateTime']>; gt?: InputMaybe<Scalars['DateTime']>;
@ -609,10 +601,6 @@ export type DateTimeNullableFilter = {
notIn?: InputMaybe<Array<Scalars['DateTime']>>; notIn?: InputMaybe<Array<Scalars['DateTime']>>;
}; };
export type EnumActivityTypeFieldUpdateOperationsInput = {
set?: InputMaybe<ActivityType>;
};
export type EnumActivityTypeFilter = { export type EnumActivityTypeFilter = {
equals?: InputMaybe<ActivityType>; equals?: InputMaybe<ActivityType>;
in?: InputMaybe<Array<ActivityType>>; in?: InputMaybe<Array<ActivityType>>;
@ -627,10 +615,6 @@ export type EnumAttachmentTypeFilter = {
notIn?: InputMaybe<Array<AttachmentType>>; notIn?: InputMaybe<Array<AttachmentType>>;
}; };
export type EnumColorSchemeFieldUpdateOperationsInput = {
set?: InputMaybe<ColorScheme>;
};
export type EnumColorSchemeFilter = { export type EnumColorSchemeFilter = {
equals?: InputMaybe<ColorScheme>; equals?: InputMaybe<ColorScheme>;
in?: InputMaybe<Array<ColorScheme>>; in?: InputMaybe<Array<ColorScheme>>;
@ -645,10 +629,6 @@ export type EnumCommentableTypeFilter = {
notIn?: InputMaybe<Array<CommentableType>>; notIn?: InputMaybe<Array<CommentableType>>;
}; };
export type EnumPipelineProgressableTypeFieldUpdateOperationsInput = {
set?: InputMaybe<PipelineProgressableType>;
};
export type EnumPipelineProgressableTypeFilter = { export type EnumPipelineProgressableTypeFilter = {
equals?: InputMaybe<PipelineProgressableType>; equals?: InputMaybe<PipelineProgressableType>;
in?: InputMaybe<Array<PipelineProgressableType>>; in?: InputMaybe<Array<PipelineProgressableType>>;
@ -974,51 +954,35 @@ export type NestedStringNullableFilter = {
startsWith?: InputMaybe<Scalars['String']>; startsWith?: InputMaybe<Scalars['String']>;
}; };
export type NullableDateTimeFieldUpdateOperationsInput = {
set?: InputMaybe<Scalars['DateTime']>;
};
export type NullableIntFieldUpdateOperationsInput = {
decrement?: InputMaybe<Scalars['Int']>;
divide?: InputMaybe<Scalars['Int']>;
increment?: InputMaybe<Scalars['Int']>;
multiply?: InputMaybe<Scalars['Int']>;
set?: InputMaybe<Scalars['Int']>;
};
export type NullableStringFieldUpdateOperationsInput = {
set?: InputMaybe<Scalars['String']>;
};
export type Person = { export type Person = {
__typename?: 'Person'; __typename?: 'Person';
PipelineProgress?: Maybe<Array<PipelineProgress>>;
_commentThreadCount: Scalars['Int']; _commentThreadCount: Scalars['Int'];
city: Scalars['String']; city?: Maybe<Scalars['String']>;
commentThreads: Array<CommentThread>; commentThreads: Array<CommentThread>;
comments: Array<Comment>; comments: Array<Comment>;
company?: Maybe<Company>; company?: Maybe<Company>;
companyId?: Maybe<Scalars['String']>; companyId?: Maybe<Scalars['String']>;
createdAt: Scalars['DateTime']; createdAt: Scalars['DateTime'];
displayName: Scalars['String']; displayName: Scalars['String'];
email: Scalars['String']; email?: Maybe<Scalars['String']>;
firstName: Scalars['String']; firstName?: Maybe<Scalars['String']>;
id: Scalars['ID']; id: Scalars['ID'];
lastName: Scalars['String']; lastName?: Maybe<Scalars['String']>;
phone: Scalars['String']; phone?: Maybe<Scalars['String']>;
pipelineProgresses?: Maybe<Array<PipelineProgress>>;
updatedAt: Scalars['DateTime']; updatedAt: Scalars['DateTime'];
}; };
export type PersonCreateInput = { export type PersonCreateInput = {
PipelineProgress?: InputMaybe<PipelineProgressCreateNestedManyWithoutPointOfContactInput>; city?: InputMaybe<Scalars['String']>;
city: Scalars['String'];
company?: InputMaybe<CompanyCreateNestedOneWithoutPeopleInput>; company?: InputMaybe<CompanyCreateNestedOneWithoutPeopleInput>;
createdAt?: InputMaybe<Scalars['DateTime']>; createdAt?: InputMaybe<Scalars['DateTime']>;
email: Scalars['String']; email?: InputMaybe<Scalars['String']>;
firstName: Scalars['String']; firstName?: InputMaybe<Scalars['String']>;
id?: InputMaybe<Scalars['String']>; id?: InputMaybe<Scalars['String']>;
lastName: Scalars['String']; lastName?: InputMaybe<Scalars['String']>;
phone: Scalars['String']; phone?: InputMaybe<Scalars['String']>;
pipelineProgresses?: InputMaybe<PipelineProgressCreateNestedManyWithoutPointOfContactInput>;
updatedAt?: InputMaybe<Scalars['DateTime']>; updatedAt?: InputMaybe<Scalars['DateTime']>;
}; };
@ -1026,7 +990,7 @@ export type PersonCreateNestedManyWithoutCompanyInput = {
connect?: InputMaybe<Array<PersonWhereUniqueInput>>; connect?: InputMaybe<Array<PersonWhereUniqueInput>>;
}; };
export type PersonCreateNestedOneWithoutPipelineProgressInput = { export type PersonCreateNestedOneWithoutPipelineProgressesInput = {
connect?: InputMaybe<PersonWhereUniqueInput>; connect?: InputMaybe<PersonWhereUniqueInput>;
}; };
@ -1041,7 +1005,6 @@ export type PersonOrderByRelationAggregateInput = {
}; };
export type PersonOrderByWithRelationInput = { export type PersonOrderByWithRelationInput = {
PipelineProgress?: InputMaybe<PipelineProgressOrderByRelationAggregateInput>;
city?: InputMaybe<SortOrder>; city?: InputMaybe<SortOrder>;
company?: InputMaybe<CompanyOrderByWithRelationInput>; company?: InputMaybe<CompanyOrderByWithRelationInput>;
companyId?: InputMaybe<SortOrder>; companyId?: InputMaybe<SortOrder>;
@ -1051,6 +1014,7 @@ export type PersonOrderByWithRelationInput = {
id?: InputMaybe<SortOrder>; id?: InputMaybe<SortOrder>;
lastName?: InputMaybe<SortOrder>; lastName?: InputMaybe<SortOrder>;
phone?: InputMaybe<SortOrder>; phone?: InputMaybe<SortOrder>;
pipelineProgresses?: InputMaybe<PipelineProgressOrderByRelationAggregateInput>;
updatedAt?: InputMaybe<SortOrder>; updatedAt?: InputMaybe<SortOrder>;
}; };
@ -1074,16 +1038,16 @@ export enum PersonScalarFieldEnum {
} }
export type PersonUpdateInput = { export type PersonUpdateInput = {
PipelineProgress?: InputMaybe<PipelineProgressUpdateManyWithoutPointOfContactNestedInput>; city?: InputMaybe<Scalars['String']>;
city?: InputMaybe<StringFieldUpdateOperationsInput>;
company?: InputMaybe<CompanyUpdateOneWithoutPeopleNestedInput>; company?: InputMaybe<CompanyUpdateOneWithoutPeopleNestedInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; createdAt?: InputMaybe<Scalars['DateTime']>;
email?: InputMaybe<StringFieldUpdateOperationsInput>; email?: InputMaybe<Scalars['String']>;
firstName?: InputMaybe<StringFieldUpdateOperationsInput>; firstName?: InputMaybe<Scalars['String']>;
id?: InputMaybe<StringFieldUpdateOperationsInput>; id?: InputMaybe<Scalars['String']>;
lastName?: InputMaybe<StringFieldUpdateOperationsInput>; lastName?: InputMaybe<Scalars['String']>;
phone?: InputMaybe<StringFieldUpdateOperationsInput>; phone?: InputMaybe<Scalars['String']>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; pipelineProgresses?: InputMaybe<PipelineProgressUpdateManyWithoutPointOfContactNestedInput>;
updatedAt?: InputMaybe<Scalars['DateTime']>;
}; };
export type PersonUpdateManyWithoutCompanyNestedInput = { export type PersonUpdateManyWithoutCompanyNestedInput = {
@ -1098,7 +1062,7 @@ export type PersonUpdateManyWithoutWorkspaceNestedInput = {
set?: InputMaybe<Array<PersonWhereUniqueInput>>; set?: InputMaybe<Array<PersonWhereUniqueInput>>;
}; };
export type PersonUpdateOneWithoutPipelineProgressNestedInput = { export type PersonUpdateOneWithoutPipelineProgressesNestedInput = {
connect?: InputMaybe<PersonWhereUniqueInput>; connect?: InputMaybe<PersonWhereUniqueInput>;
disconnect?: InputMaybe<Scalars['Boolean']>; disconnect?: InputMaybe<Scalars['Boolean']>;
}; };
@ -1107,16 +1071,16 @@ export type PersonWhereInput = {
AND?: InputMaybe<Array<PersonWhereInput>>; AND?: InputMaybe<Array<PersonWhereInput>>;
NOT?: InputMaybe<Array<PersonWhereInput>>; NOT?: InputMaybe<Array<PersonWhereInput>>;
OR?: InputMaybe<Array<PersonWhereInput>>; OR?: InputMaybe<Array<PersonWhereInput>>;
PipelineProgress?: InputMaybe<PipelineProgressListRelationFilter>; city?: InputMaybe<StringNullableFilter>;
city?: InputMaybe<StringFilter>;
company?: InputMaybe<CompanyRelationFilter>; company?: InputMaybe<CompanyRelationFilter>;
companyId?: InputMaybe<StringNullableFilter>; companyId?: InputMaybe<StringNullableFilter>;
createdAt?: InputMaybe<DateTimeFilter>; createdAt?: InputMaybe<DateTimeFilter>;
email?: InputMaybe<StringFilter>; email?: InputMaybe<StringNullableFilter>;
firstName?: InputMaybe<StringFilter>; firstName?: InputMaybe<StringNullableFilter>;
id?: InputMaybe<StringFilter>; id?: InputMaybe<StringFilter>;
lastName?: InputMaybe<StringFilter>; lastName?: InputMaybe<StringNullableFilter>;
phone?: InputMaybe<StringFilter>; phone?: InputMaybe<StringNullableFilter>;
pipelineProgresses?: InputMaybe<PipelineProgressListRelationFilter>;
updatedAt?: InputMaybe<DateTimeFilter>; updatedAt?: InputMaybe<DateTimeFilter>;
}; };
@ -1176,7 +1140,7 @@ export type PipelineProgressCreateInput = {
id?: InputMaybe<Scalars['String']>; id?: InputMaybe<Scalars['String']>;
pipeline: PipelineCreateNestedOneWithoutPipelineProgressesInput; pipeline: PipelineCreateNestedOneWithoutPipelineProgressesInput;
pipelineStage: PipelineStageCreateNestedOneWithoutPipelineProgressesInput; pipelineStage: PipelineStageCreateNestedOneWithoutPipelineProgressesInput;
pointOfContact?: InputMaybe<PersonCreateNestedOneWithoutPipelineProgressInput>; pointOfContact?: InputMaybe<PersonCreateNestedOneWithoutPipelineProgressesInput>;
probability?: InputMaybe<Scalars['Int']>; probability?: InputMaybe<Scalars['Int']>;
progressableId: Scalars['String']; progressableId: Scalars['String'];
progressableType: PipelineProgressableType; progressableType: PipelineProgressableType;
@ -1231,17 +1195,17 @@ export enum PipelineProgressScalarFieldEnum {
} }
export type PipelineProgressUpdateInput = { export type PipelineProgressUpdateInput = {
amount?: InputMaybe<NullableIntFieldUpdateOperationsInput>; amount?: InputMaybe<Scalars['Int']>;
closeDate?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>; closeDate?: InputMaybe<Scalars['DateTime']>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; createdAt?: InputMaybe<Scalars['DateTime']>;
id?: InputMaybe<StringFieldUpdateOperationsInput>; id?: InputMaybe<Scalars['String']>;
pipeline?: InputMaybe<PipelineUpdateOneRequiredWithoutPipelineProgressesNestedInput>; pipeline?: InputMaybe<PipelineUpdateOneRequiredWithoutPipelineProgressesNestedInput>;
pipelineStage?: InputMaybe<PipelineStageUpdateOneRequiredWithoutPipelineProgressesNestedInput>; pipelineStage?: InputMaybe<PipelineStageUpdateOneRequiredWithoutPipelineProgressesNestedInput>;
pointOfContact?: InputMaybe<PersonUpdateOneWithoutPipelineProgressNestedInput>; pointOfContact?: InputMaybe<PersonUpdateOneWithoutPipelineProgressesNestedInput>;
probability?: InputMaybe<NullableIntFieldUpdateOperationsInput>; probability?: InputMaybe<Scalars['Int']>;
progressableId?: InputMaybe<StringFieldUpdateOperationsInput>; progressableId?: InputMaybe<Scalars['String']>;
progressableType?: InputMaybe<EnumPipelineProgressableTypeFieldUpdateOperationsInput>; progressableType?: InputMaybe<PipelineProgressableType>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; updatedAt?: InputMaybe<Scalars['DateTime']>;
}; };
export type PipelineProgressUpdateManyWithoutPipelineStageNestedInput = { export type PipelineProgressUpdateManyWithoutPipelineStageNestedInput = {
@ -1367,15 +1331,15 @@ export enum PipelineStageScalarFieldEnum {
} }
export type PipelineStageUpdateInput = { export type PipelineStageUpdateInput = {
color?: InputMaybe<StringFieldUpdateOperationsInput>; color?: InputMaybe<Scalars['String']>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; createdAt?: InputMaybe<Scalars['DateTime']>;
id?: InputMaybe<StringFieldUpdateOperationsInput>; id?: InputMaybe<Scalars['String']>;
index?: InputMaybe<NullableIntFieldUpdateOperationsInput>; index?: InputMaybe<Scalars['Int']>;
name?: InputMaybe<StringFieldUpdateOperationsInput>; name?: InputMaybe<Scalars['String']>;
pipeline?: InputMaybe<PipelineUpdateOneRequiredWithoutPipelineStagesNestedInput>; pipeline?: InputMaybe<PipelineUpdateOneRequiredWithoutPipelineStagesNestedInput>;
pipelineProgresses?: InputMaybe<PipelineProgressUpdateManyWithoutPipelineStageNestedInput>; pipelineProgresses?: InputMaybe<PipelineProgressUpdateManyWithoutPipelineStageNestedInput>;
type?: InputMaybe<StringFieldUpdateOperationsInput>; type?: InputMaybe<Scalars['String']>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; updatedAt?: InputMaybe<Scalars['DateTime']>;
}; };
export type PipelineStageUpdateManyWithoutWorkspaceNestedInput = { export type PipelineStageUpdateManyWithoutWorkspaceNestedInput = {
@ -1569,10 +1533,6 @@ export enum SortOrder {
Desc = 'desc' Desc = 'desc'
} }
export type StringFieldUpdateOperationsInput = {
set?: InputMaybe<Scalars['String']>;
};
export type StringFilter = { export type StringFilter = {
contains?: InputMaybe<Scalars['String']>; contains?: InputMaybe<Scalars['String']>;
endsWith?: InputMaybe<Scalars['String']>; endsWith?: InputMaybe<Scalars['String']>;
@ -1732,11 +1692,11 @@ export type UserSettingsUpdateOneRequiredWithoutUserNestedInput = {
}; };
export type UserSettingsUpdateWithoutUserInput = { export type UserSettingsUpdateWithoutUserInput = {
colorScheme?: InputMaybe<EnumColorSchemeFieldUpdateOperationsInput>; colorScheme?: InputMaybe<ColorScheme>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; createdAt?: InputMaybe<Scalars['DateTime']>;
id?: InputMaybe<StringFieldUpdateOperationsInput>; id?: InputMaybe<Scalars['String']>;
locale?: InputMaybe<StringFieldUpdateOperationsInput>; locale?: InputMaybe<Scalars['String']>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; updatedAt?: InputMaybe<Scalars['DateTime']>;
}; };
export type UserSettingsWhereInput = { export type UserSettingsWhereInput = {
@ -1755,22 +1715,22 @@ export type UserUpdateInput = {
assignedCommentThreads?: InputMaybe<CommentThreadUpdateManyWithoutAssigneeNestedInput>; assignedCommentThreads?: InputMaybe<CommentThreadUpdateManyWithoutAssigneeNestedInput>;
authoredAttachments?: InputMaybe<AttachmentUpdateManyWithoutAuthorNestedInput>; authoredAttachments?: InputMaybe<AttachmentUpdateManyWithoutAuthorNestedInput>;
authoredCommentThreads?: InputMaybe<CommentThreadUpdateManyWithoutAuthorNestedInput>; authoredCommentThreads?: InputMaybe<CommentThreadUpdateManyWithoutAuthorNestedInput>;
avatarUrl?: InputMaybe<NullableStringFieldUpdateOperationsInput>; avatarUrl?: InputMaybe<Scalars['String']>;
comments?: InputMaybe<CommentUpdateManyWithoutAuthorNestedInput>; comments?: InputMaybe<CommentUpdateManyWithoutAuthorNestedInput>;
companies?: InputMaybe<CompanyUpdateManyWithoutAccountOwnerNestedInput>; companies?: InputMaybe<CompanyUpdateManyWithoutAccountOwnerNestedInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; createdAt?: InputMaybe<Scalars['DateTime']>;
disabled?: InputMaybe<BoolFieldUpdateOperationsInput>; disabled?: InputMaybe<Scalars['Boolean']>;
email?: InputMaybe<StringFieldUpdateOperationsInput>; email?: InputMaybe<Scalars['String']>;
emailVerified?: InputMaybe<BoolFieldUpdateOperationsInput>; emailVerified?: InputMaybe<Scalars['Boolean']>;
firstName?: InputMaybe<NullableStringFieldUpdateOperationsInput>; firstName?: InputMaybe<Scalars['String']>;
id?: InputMaybe<StringFieldUpdateOperationsInput>; id?: InputMaybe<Scalars['String']>;
lastName?: InputMaybe<NullableStringFieldUpdateOperationsInput>; lastName?: InputMaybe<Scalars['String']>;
lastSeen?: InputMaybe<NullableDateTimeFieldUpdateOperationsInput>; lastSeen?: InputMaybe<Scalars['DateTime']>;
locale?: InputMaybe<StringFieldUpdateOperationsInput>; locale?: InputMaybe<Scalars['String']>;
metadata?: InputMaybe<Scalars['JSON']>; metadata?: InputMaybe<Scalars['JSON']>;
phoneNumber?: InputMaybe<NullableStringFieldUpdateOperationsInput>; phoneNumber?: InputMaybe<Scalars['String']>;
settings?: InputMaybe<UserSettingsUpdateOneRequiredWithoutUserNestedInput>; settings?: InputMaybe<UserSettingsUpdateOneRequiredWithoutUserNestedInput>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; updatedAt?: InputMaybe<Scalars['DateTime']>;
}; };
export type UserUpdateOneRequiredWithoutAuthoredCommentThreadsNestedInput = { export type UserUpdateOneRequiredWithoutAuthoredCommentThreadsNestedInput = {
@ -1902,17 +1862,17 @@ export type WorkspaceUpdateInput = {
commentThreads?: InputMaybe<CommentThreadUpdateManyWithoutWorkspaceNestedInput>; commentThreads?: InputMaybe<CommentThreadUpdateManyWithoutWorkspaceNestedInput>;
comments?: InputMaybe<CommentUpdateManyWithoutWorkspaceNestedInput>; comments?: InputMaybe<CommentUpdateManyWithoutWorkspaceNestedInput>;
companies?: InputMaybe<CompanyUpdateManyWithoutWorkspaceNestedInput>; companies?: InputMaybe<CompanyUpdateManyWithoutWorkspaceNestedInput>;
createdAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; createdAt?: InputMaybe<Scalars['DateTime']>;
displayName?: InputMaybe<NullableStringFieldUpdateOperationsInput>; displayName?: InputMaybe<Scalars['String']>;
domainName?: InputMaybe<NullableStringFieldUpdateOperationsInput>; domainName?: InputMaybe<Scalars['String']>;
id?: InputMaybe<StringFieldUpdateOperationsInput>; id?: InputMaybe<Scalars['String']>;
inviteHash?: InputMaybe<NullableStringFieldUpdateOperationsInput>; inviteHash?: InputMaybe<Scalars['String']>;
logo?: InputMaybe<NullableStringFieldUpdateOperationsInput>; logo?: InputMaybe<Scalars['String']>;
people?: InputMaybe<PersonUpdateManyWithoutWorkspaceNestedInput>; people?: InputMaybe<PersonUpdateManyWithoutWorkspaceNestedInput>;
pipelineProgresses?: InputMaybe<PipelineProgressUpdateManyWithoutWorkspaceNestedInput>; pipelineProgresses?: InputMaybe<PipelineProgressUpdateManyWithoutWorkspaceNestedInput>;
pipelineStages?: InputMaybe<PipelineStageUpdateManyWithoutWorkspaceNestedInput>; pipelineStages?: InputMaybe<PipelineStageUpdateManyWithoutWorkspaceNestedInput>;
pipelines?: InputMaybe<PipelineUpdateManyWithoutWorkspaceNestedInput>; pipelines?: InputMaybe<PipelineUpdateManyWithoutWorkspaceNestedInput>;
updatedAt?: InputMaybe<DateTimeFieldUpdateOperationsInput>; updatedAt?: InputMaybe<Scalars['DateTime']>;
workspaceMember?: InputMaybe<WorkspaceMemberUpdateManyWithoutWorkspaceNestedInput>; workspaceMember?: InputMaybe<WorkspaceMemberUpdateManyWithoutWorkspaceNestedInput>;
}; };
@ -1946,14 +1906,14 @@ export type GetCommentThreadsByTargetsQueryVariables = Exact<{
}>; }>;
export type GetCommentThreadsByTargetsQuery = { __typename?: 'Query', findManyCommentThreads: Array<{ __typename?: 'CommentThread', id: string, createdAt: string, title?: string | null, body?: string | null, type: ActivityType, author: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null }, 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, commentThreadTargets?: Array<{ __typename?: 'CommentThreadTarget', id: string, commentableId: string, commentableType: CommentableType }> | null }> }; export type GetCommentThreadsByTargetsQuery = { __typename?: 'Query', findManyCommentThreads: Array<{ __typename?: 'CommentThread', id: string, createdAt: string, title?: string | null, body?: string | null, type: ActivityType, 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, commentThreadTargets?: Array<{ __typename?: 'CommentThreadTarget', id: string, commentableId: string, commentableType: CommentableType }> | null }> };
export type GetCommentThreadQueryVariables = Exact<{ export type GetCommentThreadQueryVariables = Exact<{
commentThreadId: Scalars['String']; commentThreadId: Scalars['String'];
}>; }>;
export type GetCommentThreadQuery = { __typename?: 'Query', findManyCommentThreads: Array<{ __typename?: 'CommentThread', id: string, createdAt: string, body?: string | null, title?: string | null, type: ActivityType, author: { __typename?: 'User', id: string, firstName?: string | null, lastName?: string | null }, 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, commentThreadTargets?: Array<{ __typename?: 'CommentThreadTarget', id: string, commentableId: string, commentableType: CommentableType }> | null }> }; export type GetCommentThreadQuery = { __typename?: 'Query', findManyCommentThreads: Array<{ __typename?: 'CommentThread', id: string, createdAt: string, body?: string | null, title?: string | null, type: ActivityType, 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, commentThreadTargets?: Array<{ __typename?: 'CommentThreadTarget', id: string, commentableId: string, commentableType: CommentableType }> | null }> };
export type AddCommentThreadTargetOnCommentThreadMutationVariables = Exact<{ export type AddCommentThreadTargetOnCommentThreadMutationVariables = Exact<{
commentThreadId: Scalars['String']; commentThreadId: Scalars['String'];
@ -2065,37 +2025,27 @@ export type GetCompanyQueryVariables = Exact<{
export type GetCompanyQuery = { __typename?: 'Query', findUniqueCompany: { __typename?: 'Company', id: string, domainName: string, name: string, createdAt: string, address: string, employees?: number | null, _commentThreadCount: number, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null } }; export type GetCompanyQuery = { __typename?: 'Query', findUniqueCompany: { __typename?: 'Company', id: string, domainName: string, name: string, createdAt: string, address: string, employees?: number | null, _commentThreadCount: number, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null } };
export type UpdateCompanyMutationVariables = Exact<{ export type UpdateOneCompanyMutationVariables = Exact<{
id?: InputMaybe<Scalars['String']>; where: CompanyWhereUniqueInput;
name?: InputMaybe<Scalars['String']>; data: CompanyUpdateInput;
domainName?: InputMaybe<Scalars['String']>;
accountOwnerId?: InputMaybe<Scalars['String']>;
createdAt?: InputMaybe<Scalars['DateTime']>;
address?: InputMaybe<Scalars['String']>;
employees?: InputMaybe<Scalars['Int']>;
}>; }>;
export type UpdateCompanyMutation = { __typename?: 'Mutation', updateOneCompany?: { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null } | null } | null }; export type UpdateOneCompanyMutation = { __typename?: 'Mutation', updateOneCompany?: { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null } | null } | null };
export type InsertCompanyMutationVariables = Exact<{ export type InsertOneCompanyMutationVariables = Exact<{
id: Scalars['String']; data: CompanyCreateInput;
name: Scalars['String'];
domainName: Scalars['String'];
createdAt?: InputMaybe<Scalars['DateTime']>;
address: Scalars['String'];
employees?: InputMaybe<Scalars['Int']>;
}>; }>;
export type InsertCompanyMutation = { __typename?: 'Mutation', createOneCompany: { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, id: string, name: string } }; export type InsertOneCompanyMutation = { __typename?: 'Mutation', createOneCompany: { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, id: string, name: string } };
export type DeleteCompaniesMutationVariables = Exact<{ export type DeleteManyCompaniesMutationVariables = Exact<{
ids?: InputMaybe<Array<Scalars['String']> | Scalars['String']>; ids?: InputMaybe<Array<Scalars['String']> | Scalars['String']>;
}>; }>;
export type DeleteCompaniesMutation = { __typename?: 'Mutation', deleteManyCompany: { __typename?: 'AffectedRows', count: number } }; export type DeleteManyCompaniesMutation = { __typename?: 'Mutation', deleteManyCompany: { __typename?: 'AffectedRows', count: number } };
export type GetPeopleQueryVariables = Exact<{ export type GetPeopleQueryVariables = Exact<{
orderBy?: InputMaybe<Array<PersonOrderByWithRelationInput> | PersonOrderByWithRelationInput>; orderBy?: InputMaybe<Array<PersonOrderByWithRelationInput> | PersonOrderByWithRelationInput>;
@ -2104,28 +2054,28 @@ export type GetPeopleQueryVariables = Exact<{
}>; }>;
export type GetPeopleQuery = { __typename?: 'Query', people: Array<{ __typename?: 'Person', id: string, phone: string, email: string, city: string, firstName: string, lastName: string, createdAt: string, _commentThreadCount: number, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null }> }; 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, createdAt: string, _commentThreadCount: number, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null }> };
export type GetPersonPhoneByIdQueryVariables = Exact<{ export type GetPersonPhoneByIdQueryVariables = Exact<{
id: Scalars['String']; id: Scalars['String'];
}>; }>;
export type GetPersonPhoneByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, phone: string } }; export type GetPersonPhoneByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, phone?: string | null } };
export type GetPersonEmailByIdQueryVariables = Exact<{ export type GetPersonEmailByIdQueryVariables = Exact<{
id: Scalars['String']; id: Scalars['String'];
}>; }>;
export type GetPersonEmailByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, email: string } }; export type GetPersonEmailByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, email?: string | null } };
export type GetPersonNamesAndCommentCountByIdQueryVariables = Exact<{ export type GetPersonNamesAndCommentCountByIdQueryVariables = Exact<{
id: Scalars['String']; id: Scalars['String'];
}>; }>;
export type GetPersonNamesAndCommentCountByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, firstName: string, lastName: string, _commentThreadCount: number } }; export type GetPersonNamesAndCommentCountByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, firstName?: string | null, lastName?: string | null, displayName: string, _commentThreadCount: number } };
export type GetPersonCompanyByIdQueryVariables = Exact<{ export type GetPersonCompanyByIdQueryVariables = Exact<{
id: Scalars['String']; id: Scalars['String'];
@ -2153,48 +2103,36 @@ export type GetPersonCityByIdQueryVariables = Exact<{
}>; }>;
export type GetPersonCityByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, city: string } }; export type GetPersonCityByIdQuery = { __typename?: 'Query', person: { __typename?: 'Person', id: string, city?: string | null } };
export type GetPersonQueryVariables = Exact<{ export type GetPersonQueryVariables = Exact<{
id: Scalars['String']; id: Scalars['String'];
}>; }>;
export type GetPersonQuery = { __typename?: 'Query', findUniquePerson: { __typename?: 'Person', id: string, firstName: string, lastName: string, displayName: string, email: string, createdAt: string, city: string, phone: string, _commentThreadCount: number, company?: { __typename?: 'Company', id: string, name: string, domainName: 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, phone?: string | null, _commentThreadCount: number, company?: { __typename?: 'Company', id: string, name: string, domainName: string } | null } };
export type UpdatePeopleMutationVariables = Exact<{ export type UpdateOnePersonMutationVariables = Exact<{
id?: InputMaybe<Scalars['String']>; where: PersonWhereUniqueInput;
firstName?: InputMaybe<Scalars['String']>; data: PersonUpdateInput;
lastName?: InputMaybe<Scalars['String']>;
phone?: InputMaybe<Scalars['String']>;
city?: InputMaybe<Scalars['String']>;
companyId?: InputMaybe<Scalars['String']>;
email?: InputMaybe<Scalars['String']>;
createdAt?: InputMaybe<Scalars['DateTime']>;
}>; }>;
export type UpdatePeopleMutation = { __typename?: 'Mutation', updateOnePerson?: { __typename?: 'Person', id: string, city: string, email: string, firstName: string, lastName: string, phone: string, createdAt: string, company?: { __typename?: 'Company', domainName: string, name: string, id: string } | null } | null }; export type UpdateOnePersonMutation = { __typename?: 'Mutation', updateOnePerson?: { __typename?: 'Person', id: string, city?: string | null, email?: 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 InsertPersonMutationVariables = Exact<{ export type InsertOnePersonMutationVariables = Exact<{
id: Scalars['String']; data: PersonCreateInput;
firstName: Scalars['String'];
lastName: Scalars['String'];
phone: Scalars['String'];
city: Scalars['String'];
email: Scalars['String'];
createdAt?: InputMaybe<Scalars['DateTime']>;
}>; }>;
export type InsertPersonMutation = { __typename?: 'Mutation', createOnePerson: { __typename?: 'Person', id: string, city: string, email: string, firstName: string, lastName: string, phone: string, createdAt: string, company?: { __typename?: 'Company', domainName: string, name: string, id: string } | null } }; export type InsertOnePersonMutation = { __typename?: 'Mutation', createOnePerson: { __typename?: 'Person', id: string, city?: string | null, email?: 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 } };
export type DeletePeopleMutationVariables = Exact<{ export type DeleteManyPersonMutationVariables = Exact<{
ids?: InputMaybe<Array<Scalars['String']> | Scalars['String']>; ids?: InputMaybe<Array<Scalars['String']> | Scalars['String']>;
}>; }>;
export type DeletePeopleMutation = { __typename?: 'Mutation', deleteManyPerson: { __typename?: 'AffectedRows', count: number } }; export type DeleteManyPersonMutation = { __typename?: 'Mutation', deleteManyPerson: { __typename?: 'AffectedRows', count: number } };
export type GetPipelinesQueryVariables = Exact<{ export type GetPipelinesQueryVariables = Exact<{
where?: InputMaybe<PipelineWhereInput>; where?: InputMaybe<PipelineWhereInput>;
@ -2209,7 +2147,7 @@ export type GetPipelineProgressQueryVariables = Exact<{
}>; }>;
export type GetPipelineProgressQuery = { __typename?: 'Query', findManyPipelineProgress: Array<{ __typename?: 'PipelineProgress', id: string, pipelineStageId: string, progressableType: PipelineProgressableType, progressableId: string, amount?: number | null, closeDate?: string | null, pointOfContactId?: string | null, probability?: number | null, pointOfContact?: { __typename?: 'Person', id: string, firstName: string, lastName: string } | null }> }; export type GetPipelineProgressQuery = { __typename?: 'Query', findManyPipelineProgress: Array<{ __typename?: 'PipelineProgress', id: string, pipelineStageId: string, progressableType: PipelineProgressableType, progressableId: string, 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 } | null }> };
export type UpdateOnePipelineProgressMutationVariables = Exact<{ export type UpdateOnePipelineProgressMutationVariables = Exact<{
id?: InputMaybe<Scalars['String']>; id?: InputMaybe<Scalars['String']>;
@ -2263,7 +2201,7 @@ export type SearchPeopleQueryVariables = Exact<{
}>; }>;
export type SearchPeopleQuery = { __typename?: 'Query', searchResults: Array<{ __typename?: 'Person', id: string, phone: string, email: string, city: string, firstName: string, lastName: string, createdAt: string }> }; export type SearchPeopleQuery = { __typename?: 'Query', searchResults: Array<{ __typename?: 'Person', id: string, phone?: string | null, email?: string | null, city?: string | null, firstName?: string | null, lastName?: string | null, createdAt: string }> };
export type SearchUserQueryVariables = Exact<{ export type SearchUserQueryVariables = Exact<{
where?: InputMaybe<UserWhereInput>; where?: InputMaybe<UserWhereInput>;
@ -2323,7 +2261,7 @@ export type RemoveProfilePictureMutation = { __typename?: 'Mutation', updateUser
export type GetWorkspaceMembersQueryVariables = Exact<{ [key: string]: never; }>; 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 } }> }; 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 UpdateWorkspaceMutationVariables = Exact<{ export type UpdateWorkspaceMutationVariables = Exact<{
data: WorkspaceUpdateInput; data: WorkspaceUpdateInput;
@ -2478,6 +2416,7 @@ export const GetCommentThreadsByTargetsDocument = gql`
id id
firstName firstName
lastName lastName
displayName
} }
comments { comments {
id id
@ -2541,6 +2480,7 @@ export const GetCommentThreadDocument = gql`
id id
firstName firstName
lastName lastName
displayName
} }
comments { comments {
id id
@ -2723,7 +2663,7 @@ export const UpdateCommentThreadDocument = gql`
mutation UpdateCommentThread($id: String!, $body: String, $title: String, $type: ActivityType) { mutation UpdateCommentThread($id: String!, $body: String, $title: String, $type: ActivityType) {
updateOneCommentThread( updateOneCommentThread(
where: {id: $id} where: {id: $id}
data: {body: {set: $body}, title: {set: $title}, type: {set: $type}} data: {body: $body, title: $title, type: $type}
) { ) {
id id
body body
@ -3181,12 +3121,9 @@ export function useGetCompanyLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions
export type GetCompanyQueryHookResult = ReturnType<typeof useGetCompanyQuery>; export type GetCompanyQueryHookResult = ReturnType<typeof useGetCompanyQuery>;
export type GetCompanyLazyQueryHookResult = ReturnType<typeof useGetCompanyLazyQuery>; export type GetCompanyLazyQueryHookResult = ReturnType<typeof useGetCompanyLazyQuery>;
export type GetCompanyQueryResult = Apollo.QueryResult<GetCompanyQuery, GetCompanyQueryVariables>; export type GetCompanyQueryResult = Apollo.QueryResult<GetCompanyQuery, GetCompanyQueryVariables>;
export const UpdateCompanyDocument = gql` export const UpdateOneCompanyDocument = gql`
mutation UpdateCompany($id: String, $name: String, $domainName: String, $accountOwnerId: String, $createdAt: DateTime, $address: String, $employees: Int) { mutation UpdateOneCompany($where: CompanyWhereUniqueInput!, $data: CompanyUpdateInput!) {
updateOneCompany( updateOneCompany(data: $data, where: $where) {
where: {id: $id}
data: {accountOwner: {connect: {id: $accountOwnerId}}, address: {set: $address}, domainName: {set: $domainName}, employees: {set: $employees}, name: {set: $name}, createdAt: {set: $createdAt}}
) {
accountOwner { accountOwner {
id id
email email
@ -3203,43 +3140,36 @@ export const UpdateCompanyDocument = gql`
} }
} }
`; `;
export type UpdateCompanyMutationFn = Apollo.MutationFunction<UpdateCompanyMutation, UpdateCompanyMutationVariables>; export type UpdateOneCompanyMutationFn = Apollo.MutationFunction<UpdateOneCompanyMutation, UpdateOneCompanyMutationVariables>;
/** /**
* __useUpdateCompanyMutation__ * __useUpdateOneCompanyMutation__
* *
* To run a mutation, you first call `useUpdateCompanyMutation` within a React component and pass it any options that fit your needs. * 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, `useUpdateCompanyMutation` returns a tuple that includes: * When your component renders, `useUpdateOneCompanyMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation * - 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 * - 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; * @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 * @example
* const [updateCompanyMutation, { data, loading, error }] = useUpdateCompanyMutation({ * const [updateOneCompanyMutation, { data, loading, error }] = useUpdateOneCompanyMutation({
* variables: { * variables: {
* id: // value for 'id' * where: // value for 'where'
* name: // value for 'name' * data: // value for 'data'
* domainName: // value for 'domainName'
* accountOwnerId: // value for 'accountOwnerId'
* createdAt: // value for 'createdAt'
* address: // value for 'address'
* employees: // value for 'employees'
* }, * },
* }); * });
*/ */
export function useUpdateCompanyMutation(baseOptions?: Apollo.MutationHookOptions<UpdateCompanyMutation, UpdateCompanyMutationVariables>) { export function useUpdateOneCompanyMutation(baseOptions?: Apollo.MutationHookOptions<UpdateOneCompanyMutation, UpdateOneCompanyMutationVariables>) {
const options = {...defaultOptions, ...baseOptions} const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<UpdateCompanyMutation, UpdateCompanyMutationVariables>(UpdateCompanyDocument, options); return Apollo.useMutation<UpdateOneCompanyMutation, UpdateOneCompanyMutationVariables>(UpdateOneCompanyDocument, options);
} }
export type UpdateCompanyMutationHookResult = ReturnType<typeof useUpdateCompanyMutation>; export type UpdateOneCompanyMutationHookResult = ReturnType<typeof useUpdateOneCompanyMutation>;
export type UpdateCompanyMutationResult = Apollo.MutationResult<UpdateCompanyMutation>; export type UpdateOneCompanyMutationResult = Apollo.MutationResult<UpdateOneCompanyMutation>;
export type UpdateCompanyMutationOptions = Apollo.BaseMutationOptions<UpdateCompanyMutation, UpdateCompanyMutationVariables>; export type UpdateOneCompanyMutationOptions = Apollo.BaseMutationOptions<UpdateOneCompanyMutation, UpdateOneCompanyMutationVariables>;
export const InsertCompanyDocument = gql` export const InsertOneCompanyDocument = gql`
mutation InsertCompany($id: String!, $name: String!, $domainName: String!, $createdAt: DateTime, $address: String!, $employees: Int) { mutation InsertOneCompany($data: CompanyCreateInput!) {
createOneCompany( createOneCompany(data: $data) {
data: {id: $id, name: $name, domainName: $domainName, createdAt: $createdAt, address: $address, employees: $employees}
) {
address address
createdAt createdAt
domainName domainName
@ -3249,70 +3179,65 @@ export const InsertCompanyDocument = gql`
} }
} }
`; `;
export type InsertCompanyMutationFn = Apollo.MutationFunction<InsertCompanyMutation, InsertCompanyMutationVariables>; export type InsertOneCompanyMutationFn = Apollo.MutationFunction<InsertOneCompanyMutation, InsertOneCompanyMutationVariables>;
/** /**
* __useInsertCompanyMutation__ * __useInsertOneCompanyMutation__
* *
* To run a mutation, you first call `useInsertCompanyMutation` within a React component and pass it any options that fit your needs. * 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, `useInsertCompanyMutation` returns a tuple that includes: * When your component renders, `useInsertOneCompanyMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation * - 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 * - 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; * @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 * @example
* const [insertCompanyMutation, { data, loading, error }] = useInsertCompanyMutation({ * const [insertOneCompanyMutation, { data, loading, error }] = useInsertOneCompanyMutation({
* variables: { * variables: {
* id: // value for 'id' * data: // value for 'data'
* name: // value for 'name'
* domainName: // value for 'domainName'
* createdAt: // value for 'createdAt'
* address: // value for 'address'
* employees: // value for 'employees'
* }, * },
* }); * });
*/ */
export function useInsertCompanyMutation(baseOptions?: Apollo.MutationHookOptions<InsertCompanyMutation, InsertCompanyMutationVariables>) { export function useInsertOneCompanyMutation(baseOptions?: Apollo.MutationHookOptions<InsertOneCompanyMutation, InsertOneCompanyMutationVariables>) {
const options = {...defaultOptions, ...baseOptions} const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<InsertCompanyMutation, InsertCompanyMutationVariables>(InsertCompanyDocument, options); return Apollo.useMutation<InsertOneCompanyMutation, InsertOneCompanyMutationVariables>(InsertOneCompanyDocument, options);
} }
export type InsertCompanyMutationHookResult = ReturnType<typeof useInsertCompanyMutation>; export type InsertOneCompanyMutationHookResult = ReturnType<typeof useInsertOneCompanyMutation>;
export type InsertCompanyMutationResult = Apollo.MutationResult<InsertCompanyMutation>; export type InsertOneCompanyMutationResult = Apollo.MutationResult<InsertOneCompanyMutation>;
export type InsertCompanyMutationOptions = Apollo.BaseMutationOptions<InsertCompanyMutation, InsertCompanyMutationVariables>; export type InsertOneCompanyMutationOptions = Apollo.BaseMutationOptions<InsertOneCompanyMutation, InsertOneCompanyMutationVariables>;
export const DeleteCompaniesDocument = gql` export const DeleteManyCompaniesDocument = gql`
mutation DeleteCompanies($ids: [String!]) { mutation DeleteManyCompanies($ids: [String!]) {
deleteManyCompany(where: {id: {in: $ids}}) { deleteManyCompany(where: {id: {in: $ids}}) {
count count
} }
} }
`; `;
export type DeleteCompaniesMutationFn = Apollo.MutationFunction<DeleteCompaniesMutation, DeleteCompaniesMutationVariables>; export type DeleteManyCompaniesMutationFn = Apollo.MutationFunction<DeleteManyCompaniesMutation, DeleteManyCompaniesMutationVariables>;
/** /**
* __useDeleteCompaniesMutation__ * __useDeleteManyCompaniesMutation__
* *
* To run a mutation, you first call `useDeleteCompaniesMutation` within a React component and pass it any options that fit your needs. * 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, `useDeleteCompaniesMutation` returns a tuple that includes: * When your component renders, `useDeleteManyCompaniesMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation * - 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 * - 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; * @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 * @example
* const [deleteCompaniesMutation, { data, loading, error }] = useDeleteCompaniesMutation({ * const [deleteManyCompaniesMutation, { data, loading, error }] = useDeleteManyCompaniesMutation({
* variables: { * variables: {
* ids: // value for 'ids' * ids: // value for 'ids'
* }, * },
* }); * });
*/ */
export function useDeleteCompaniesMutation(baseOptions?: Apollo.MutationHookOptions<DeleteCompaniesMutation, DeleteCompaniesMutationVariables>) { export function useDeleteManyCompaniesMutation(baseOptions?: Apollo.MutationHookOptions<DeleteManyCompaniesMutation, DeleteManyCompaniesMutationVariables>) {
const options = {...defaultOptions, ...baseOptions} const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<DeleteCompaniesMutation, DeleteCompaniesMutationVariables>(DeleteCompaniesDocument, options); return Apollo.useMutation<DeleteManyCompaniesMutation, DeleteManyCompaniesMutationVariables>(DeleteManyCompaniesDocument, options);
} }
export type DeleteCompaniesMutationHookResult = ReturnType<typeof useDeleteCompaniesMutation>; export type DeleteManyCompaniesMutationHookResult = ReturnType<typeof useDeleteManyCompaniesMutation>;
export type DeleteCompaniesMutationResult = Apollo.MutationResult<DeleteCompaniesMutation>; export type DeleteManyCompaniesMutationResult = Apollo.MutationResult<DeleteManyCompaniesMutation>;
export type DeleteCompaniesMutationOptions = Apollo.BaseMutationOptions<DeleteCompaniesMutation, DeleteCompaniesMutationVariables>; export type DeleteManyCompaniesMutationOptions = Apollo.BaseMutationOptions<DeleteManyCompaniesMutation, DeleteManyCompaniesMutationVariables>;
export const GetPeopleDocument = gql` export const GetPeopleDocument = gql`
query GetPeople($orderBy: [PersonOrderByWithRelationInput!], $where: PersonWhereInput, $limit: Int) { query GetPeople($orderBy: [PersonOrderByWithRelationInput!], $where: PersonWhereInput, $limit: Int) {
people: findManyPerson(orderBy: $orderBy, where: $where, take: $limit) { people: findManyPerson(orderBy: $orderBy, where: $where, take: $limit) {
@ -3322,6 +3247,7 @@ export const GetPeopleDocument = gql`
city city
firstName firstName
lastName lastName
displayName
createdAt createdAt
_commentThreadCount _commentThreadCount
company { company {
@ -3440,6 +3366,7 @@ export const GetPersonNamesAndCommentCountByIdDocument = gql`
id id
firstName firstName
lastName lastName
displayName
_commentThreadCount _commentThreadCount
} }
} }
@ -3668,12 +3595,9 @@ export function useGetPersonLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<
export type GetPersonQueryHookResult = ReturnType<typeof useGetPersonQuery>; export type GetPersonQueryHookResult = ReturnType<typeof useGetPersonQuery>;
export type GetPersonLazyQueryHookResult = ReturnType<typeof useGetPersonLazyQuery>; export type GetPersonLazyQueryHookResult = ReturnType<typeof useGetPersonLazyQuery>;
export type GetPersonQueryResult = Apollo.QueryResult<GetPersonQuery, GetPersonQueryVariables>; export type GetPersonQueryResult = Apollo.QueryResult<GetPersonQuery, GetPersonQueryVariables>;
export const UpdatePeopleDocument = gql` export const UpdateOnePersonDocument = gql`
mutation UpdatePeople($id: String, $firstName: String, $lastName: String, $phone: String, $city: String, $companyId: String, $email: String, $createdAt: DateTime) { mutation UpdateOnePerson($where: PersonWhereUniqueInput!, $data: PersonUpdateInput!) {
updateOnePerson( updateOnePerson(data: $data, where: $where) {
where: {id: $id}
data: {city: {set: $city}, company: {connect: {id: $companyId}}, email: {set: $email}, firstName: {set: $firstName}, id: {set: $id}, lastName: {set: $lastName}, phone: {set: $phone}, createdAt: {set: $createdAt}}
) {
id id
city city
company { company {
@ -3684,49 +3608,42 @@ export const UpdatePeopleDocument = gql`
email email
firstName firstName
lastName lastName
displayName
phone phone
createdAt createdAt
} }
} }
`; `;
export type UpdatePeopleMutationFn = Apollo.MutationFunction<UpdatePeopleMutation, UpdatePeopleMutationVariables>; export type UpdateOnePersonMutationFn = Apollo.MutationFunction<UpdateOnePersonMutation, UpdateOnePersonMutationVariables>;
/** /**
* __useUpdatePeopleMutation__ * __useUpdateOnePersonMutation__
* *
* To run a mutation, you first call `useUpdatePeopleMutation` within a React component and pass it any options that fit your needs. * 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, `useUpdatePeopleMutation` returns a tuple that includes: * When your component renders, `useUpdateOnePersonMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation * - 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 * - 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; * @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 * @example
* const [updatePeopleMutation, { data, loading, error }] = useUpdatePeopleMutation({ * const [updateOnePersonMutation, { data, loading, error }] = useUpdateOnePersonMutation({
* variables: { * variables: {
* id: // value for 'id' * where: // value for 'where'
* firstName: // value for 'firstName' * data: // value for 'data'
* lastName: // value for 'lastName'
* phone: // value for 'phone'
* city: // value for 'city'
* companyId: // value for 'companyId'
* email: // value for 'email'
* createdAt: // value for 'createdAt'
* }, * },
* }); * });
*/ */
export function useUpdatePeopleMutation(baseOptions?: Apollo.MutationHookOptions<UpdatePeopleMutation, UpdatePeopleMutationVariables>) { export function useUpdateOnePersonMutation(baseOptions?: Apollo.MutationHookOptions<UpdateOnePersonMutation, UpdateOnePersonMutationVariables>) {
const options = {...defaultOptions, ...baseOptions} const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<UpdatePeopleMutation, UpdatePeopleMutationVariables>(UpdatePeopleDocument, options); return Apollo.useMutation<UpdateOnePersonMutation, UpdateOnePersonMutationVariables>(UpdateOnePersonDocument, options);
} }
export type UpdatePeopleMutationHookResult = ReturnType<typeof useUpdatePeopleMutation>; export type UpdateOnePersonMutationHookResult = ReturnType<typeof useUpdateOnePersonMutation>;
export type UpdatePeopleMutationResult = Apollo.MutationResult<UpdatePeopleMutation>; export type UpdateOnePersonMutationResult = Apollo.MutationResult<UpdateOnePersonMutation>;
export type UpdatePeopleMutationOptions = Apollo.BaseMutationOptions<UpdatePeopleMutation, UpdatePeopleMutationVariables>; export type UpdateOnePersonMutationOptions = Apollo.BaseMutationOptions<UpdateOnePersonMutation, UpdateOnePersonMutationVariables>;
export const InsertPersonDocument = gql` export const InsertOnePersonDocument = gql`
mutation InsertPerson($id: String!, $firstName: String!, $lastName: String!, $phone: String!, $city: String!, $email: String!, $createdAt: DateTime) { mutation InsertOnePerson($data: PersonCreateInput!) {
createOnePerson( createOnePerson(data: $data) {
data: {id: $id, firstName: $firstName, lastName: $lastName, phone: $phone, city: $city, email: $email, createdAt: $createdAt}
) {
id id
city city
company { company {
@ -3737,76 +3654,71 @@ export const InsertPersonDocument = gql`
email email
firstName firstName
lastName lastName
displayName
phone phone
createdAt createdAt
} }
} }
`; `;
export type InsertPersonMutationFn = Apollo.MutationFunction<InsertPersonMutation, InsertPersonMutationVariables>; export type InsertOnePersonMutationFn = Apollo.MutationFunction<InsertOnePersonMutation, InsertOnePersonMutationVariables>;
/** /**
* __useInsertPersonMutation__ * __useInsertOnePersonMutation__
* *
* To run a mutation, you first call `useInsertPersonMutation` within a React component and pass it any options that fit your needs. * 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, `useInsertPersonMutation` returns a tuple that includes: * When your component renders, `useInsertOnePersonMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation * - 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 * - 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; * @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 * @example
* const [insertPersonMutation, { data, loading, error }] = useInsertPersonMutation({ * const [insertOnePersonMutation, { data, loading, error }] = useInsertOnePersonMutation({
* variables: { * variables: {
* id: // value for 'id' * data: // value for 'data'
* firstName: // value for 'firstName'
* lastName: // value for 'lastName'
* phone: // value for 'phone'
* city: // value for 'city'
* email: // value for 'email'
* createdAt: // value for 'createdAt'
* }, * },
* }); * });
*/ */
export function useInsertPersonMutation(baseOptions?: Apollo.MutationHookOptions<InsertPersonMutation, InsertPersonMutationVariables>) { export function useInsertOnePersonMutation(baseOptions?: Apollo.MutationHookOptions<InsertOnePersonMutation, InsertOnePersonMutationVariables>) {
const options = {...defaultOptions, ...baseOptions} const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<InsertPersonMutation, InsertPersonMutationVariables>(InsertPersonDocument, options); return Apollo.useMutation<InsertOnePersonMutation, InsertOnePersonMutationVariables>(InsertOnePersonDocument, options);
} }
export type InsertPersonMutationHookResult = ReturnType<typeof useInsertPersonMutation>; export type InsertOnePersonMutationHookResult = ReturnType<typeof useInsertOnePersonMutation>;
export type InsertPersonMutationResult = Apollo.MutationResult<InsertPersonMutation>; export type InsertOnePersonMutationResult = Apollo.MutationResult<InsertOnePersonMutation>;
export type InsertPersonMutationOptions = Apollo.BaseMutationOptions<InsertPersonMutation, InsertPersonMutationVariables>; export type InsertOnePersonMutationOptions = Apollo.BaseMutationOptions<InsertOnePersonMutation, InsertOnePersonMutationVariables>;
export const DeletePeopleDocument = gql` export const DeleteManyPersonDocument = gql`
mutation DeletePeople($ids: [String!]) { mutation DeleteManyPerson($ids: [String!]) {
deleteManyPerson(where: {id: {in: $ids}}) { deleteManyPerson(where: {id: {in: $ids}}) {
count count
} }
} }
`; `;
export type DeletePeopleMutationFn = Apollo.MutationFunction<DeletePeopleMutation, DeletePeopleMutationVariables>; export type DeleteManyPersonMutationFn = Apollo.MutationFunction<DeleteManyPersonMutation, DeleteManyPersonMutationVariables>;
/** /**
* __useDeletePeopleMutation__ * __useDeleteManyPersonMutation__
* *
* To run a mutation, you first call `useDeletePeopleMutation` within a React component and pass it any options that fit your needs. * 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, `useDeletePeopleMutation` returns a tuple that includes: * When your component renders, `useDeleteManyPersonMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation * - 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 * - 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; * @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 * @example
* const [deletePeopleMutation, { data, loading, error }] = useDeletePeopleMutation({ * const [deleteManyPersonMutation, { data, loading, error }] = useDeleteManyPersonMutation({
* variables: { * variables: {
* ids: // value for 'ids' * ids: // value for 'ids'
* }, * },
* }); * });
*/ */
export function useDeletePeopleMutation(baseOptions?: Apollo.MutationHookOptions<DeletePeopleMutation, DeletePeopleMutationVariables>) { export function useDeleteManyPersonMutation(baseOptions?: Apollo.MutationHookOptions<DeleteManyPersonMutation, DeleteManyPersonMutationVariables>) {
const options = {...defaultOptions, ...baseOptions} const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<DeletePeopleMutation, DeletePeopleMutationVariables>(DeletePeopleDocument, options); return Apollo.useMutation<DeleteManyPersonMutation, DeleteManyPersonMutationVariables>(DeleteManyPersonDocument, options);
} }
export type DeletePeopleMutationHookResult = ReturnType<typeof useDeletePeopleMutation>; export type DeleteManyPersonMutationHookResult = ReturnType<typeof useDeleteManyPersonMutation>;
export type DeletePeopleMutationResult = Apollo.MutationResult<DeletePeopleMutation>; export type DeleteManyPersonMutationResult = Apollo.MutationResult<DeleteManyPersonMutation>;
export type DeletePeopleMutationOptions = Apollo.BaseMutationOptions<DeletePeopleMutation, DeletePeopleMutationVariables>; export type DeleteManyPersonMutationOptions = Apollo.BaseMutationOptions<DeleteManyPersonMutation, DeleteManyPersonMutationVariables>;
export const GetPipelinesDocument = gql` export const GetPipelinesDocument = gql`
query GetPipelines($where: PipelineWhereInput) { query GetPipelines($where: PipelineWhereInput) {
findManyPipeline(where: $where) { findManyPipeline(where: $where) {
@ -3864,6 +3776,7 @@ export const GetPipelineProgressDocument = gql`
id id
firstName firstName
lastName lastName
displayName
} }
probability probability
} }
@ -3902,7 +3815,7 @@ export const UpdateOnePipelineProgressDocument = gql`
mutation UpdateOnePipelineProgress($id: String, $amount: Int, $closeDate: DateTime, $probability: Int, $pointOfContactId: String) { mutation UpdateOnePipelineProgress($id: String, $amount: Int, $closeDate: DateTime, $probability: Int, $pointOfContactId: String) {
updateOnePipelineProgress( updateOnePipelineProgress(
where: {id: $id} where: {id: $id}
data: {amount: {set: $amount}, closeDate: {set: $closeDate}, probability: {set: $probability}, pointOfContact: {connect: {id: $pointOfContactId}}} data: {amount: $amount, closeDate: $closeDate, probability: $probability, pointOfContact: {connect: {id: $pointOfContactId}}}
) { ) {
id id
amount amount
@ -4051,7 +3964,7 @@ export type DeleteManyPipelineProgressMutationResult = Apollo.MutationResult<Del
export type DeleteManyPipelineProgressMutationOptions = Apollo.BaseMutationOptions<DeleteManyPipelineProgressMutation, DeleteManyPipelineProgressMutationVariables>; export type DeleteManyPipelineProgressMutationOptions = Apollo.BaseMutationOptions<DeleteManyPipelineProgressMutation, DeleteManyPipelineProgressMutationVariables>;
export const UpdatePipelineStageDocument = gql` export const UpdatePipelineStageDocument = gql`
mutation UpdatePipelineStage($id: String, $name: String) { mutation UpdatePipelineStage($id: String, $name: String) {
updateOnePipelineStage(where: {id: $id}, data: {name: {set: $name}}) { updateOnePipelineStage(where: {id: $id}, data: {name: $name}) {
id id
name name
} }
@ -4421,7 +4334,7 @@ export type UploadProfilePictureMutationResult = Apollo.MutationResult<UploadPro
export type UploadProfilePictureMutationOptions = Apollo.BaseMutationOptions<UploadProfilePictureMutation, UploadProfilePictureMutationVariables>; export type UploadProfilePictureMutationOptions = Apollo.BaseMutationOptions<UploadProfilePictureMutation, UploadProfilePictureMutationVariables>;
export const RemoveProfilePictureDocument = gql` export const RemoveProfilePictureDocument = gql`
mutation RemoveProfilePicture($where: UserWhereUniqueInput!) { mutation RemoveProfilePicture($where: UserWhereUniqueInput!) {
updateUser(data: {avatarUrl: {set: null}}, where: $where) { updateUser(data: {avatarUrl: null}, where: $where) {
id id
avatarUrl avatarUrl
} }
@ -4463,6 +4376,7 @@ export const GetWorkspaceMembersDocument = gql`
avatarUrl avatarUrl
firstName firstName
lastName lastName
displayName
} }
} }
} }
@ -4563,7 +4477,7 @@ export type UploadWorkspaceLogoMutationResult = Apollo.MutationResult<UploadWork
export type UploadWorkspaceLogoMutationOptions = Apollo.BaseMutationOptions<UploadWorkspaceLogoMutation, UploadWorkspaceLogoMutationVariables>; export type UploadWorkspaceLogoMutationOptions = Apollo.BaseMutationOptions<UploadWorkspaceLogoMutation, UploadWorkspaceLogoMutationVariables>;
export const RemoveWorkspaceLogoDocument = gql` export const RemoveWorkspaceLogoDocument = gql`
mutation RemoveWorkspaceLogo { mutation RemoveWorkspaceLogo {
updateWorkspace(data: {logo: {set: null}}) { updateWorkspace(data: {logo: null}) {
id id
} }
} }

View File

@ -22,6 +22,7 @@ export const GET_COMMENT_THREADS_BY_TARGETS = gql`
id id
firstName firstName
lastName lastName
displayName
} }
comments { comments {
id id
@ -57,6 +58,7 @@ export const GET_COMMENT_THREAD = gql`
id id
firstName firstName
lastName lastName
displayName
} }
comments { comments {
id id

View File

@ -78,11 +78,7 @@ export const UPDATE_COMMENT_THREAD = gql`
) { ) {
updateOneCommentThread( updateOneCommentThread(
where: { id: $id } where: { id: $id }
data: { data: { body: $body, title: $title, type: $type }
body: { set: $body }
title: { set: $title }
type: { set: $type }
}
) { ) {
id id
body body

View File

@ -252,10 +252,7 @@ export function Timeline({ entity }: { entity: CommentableEntity }) {
<IconNotes /> <IconNotes />
</StyledIconContainer> </StyledIconContainer>
<StyledItemTitleContainer> <StyledItemTitleContainer>
<span> <span>{commentThread.author.displayName}</span>
{commentThread.author.firstName}{' '}
{commentThread.author.lastName}
</span>
created a note created a note
</StyledItemTitleContainer> </StyledItemTitleContainer>
<StyledItemTitleDate id={`id-${commentThread.id}`}> <StyledItemTitleDate id={`id-${commentThread.id}`}>

View File

@ -8,7 +8,7 @@ import {
Company, Company,
User, User,
useSearchUserQuery, useSearchUserQuery,
useUpdateCompanyMutation, useUpdateOneCompanyMutation,
} from '~/generated/graphql'; } from '~/generated/graphql';
export type OwnProps = { export type OwnProps = {
@ -31,7 +31,7 @@ export function CompanyAccountOwnerPicker({
const [searchFilter] = useRecoilScopedState( const [searchFilter] = useRecoilScopedState(
relationPickerSearchFilterScopedState, relationPickerSearchFilterScopedState,
); );
const [updateCompany] = useUpdateCompanyMutation(); const [updateCompany] = useUpdateOneCompanyMutation();
const companies = useFilteredSearchEntityQuery({ const companies = useFilteredSearchEntityQuery({
queryHook: useSearchUserQuery, queryHook: useSearchUserQuery,
@ -51,8 +51,10 @@ export function CompanyAccountOwnerPicker({
async function handleEntitySelected(selectedUser: UserForSelect) { async function handleEntitySelected(selectedUser: UserForSelect) {
await updateCompany({ await updateCompany({
variables: { variables: {
...company, where: { id: company.id },
accountOwnerId: selectedUser.id, data: {
accountOwner: { connect: { id: selectedUser.id } },
},
}, },
}); });

View File

@ -4,7 +4,7 @@ import { getOperationName } from '@apollo/client/utilities';
import { EditableCellChip } from '@/ui/table/editable-cell/types/EditableChip'; import { EditableCellChip } from '@/ui/table/editable-cell/types/EditableChip';
import { import {
GetCompaniesQuery, GetCompaniesQuery,
useUpdateCompanyMutation, useUpdateOneCompanyMutation,
} from '~/generated/graphql'; } from '~/generated/graphql';
import { getLogoUrlFromDomainName } from '~/utils'; import { getLogoUrlFromDomainName } from '~/utils';
@ -20,7 +20,7 @@ type OwnProps = {
}; };
export function CompanyEditableNameChipCell({ company }: OwnProps) { export function CompanyEditableNameChipCell({ company }: OwnProps) {
const [updateCompany] = useUpdateCompanyMutation(); const [updateCompany] = useUpdateOneCompanyMutation();
const [internalValue, setInternalValue] = useState(company.name ?? ''); const [internalValue, setInternalValue] = useState(company.name ?? '');
@ -44,8 +44,10 @@ export function CompanyEditableNameChipCell({ company }: OwnProps) {
onSubmit={() => onSubmit={() =>
updateCompany({ updateCompany({
variables: { variables: {
id: company.id, where: { id: company.id },
name: internalValue, data: {
name: internalValue,
},
}, },
refetchQueries: [getOperationName(GET_COMPANY) ?? ''], refetchQueries: [getOperationName(GET_COMPANY) ?? ''],
}) })

View File

@ -5,7 +5,7 @@ import { FieldContext } from '@/ui/editable-field/states/FieldContext';
import { IconMap } from '@/ui/icon'; import { IconMap } from '@/ui/icon';
import { InplaceInputText } from '@/ui/inplace-input/components/InplaceInputText'; import { InplaceInputText } from '@/ui/inplace-input/components/InplaceInputText';
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope'; import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
import { Company, useUpdateCompanyMutation } from '~/generated/graphql'; import { Company, useUpdateOneCompanyMutation } from '~/generated/graphql';
type OwnProps = { type OwnProps = {
company: Pick<Company, 'id' | 'address'>; company: Pick<Company, 'id' | 'address'>;
@ -14,7 +14,7 @@ type OwnProps = {
export function CompanyAddressEditableField({ company }: OwnProps) { export function CompanyAddressEditableField({ company }: OwnProps) {
const [internalValue, setInternalValue] = useState(company.address); const [internalValue, setInternalValue] = useState(company.address);
const [updateCompany] = useUpdateCompanyMutation(); const [updateCompany] = useUpdateOneCompanyMutation();
useEffect(() => { useEffect(() => {
setInternalValue(company.address); setInternalValue(company.address);
@ -27,8 +27,12 @@ export function CompanyAddressEditableField({ company }: OwnProps) {
async function handleSubmit() { async function handleSubmit() {
await updateCompany({ await updateCompany({
variables: { variables: {
id: company.id, where: {
address: internalValue ?? '', id: company.id,
},
data: {
address: internalValue ?? '',
},
}, },
}); });
} }

View File

@ -5,7 +5,7 @@ import { FieldContext } from '@/ui/editable-field/states/FieldContext';
import { EditableFieldEditModeDate } from '@/ui/editable-field/variants/components/EditableFieldEditModeDate'; import { EditableFieldEditModeDate } from '@/ui/editable-field/variants/components/EditableFieldEditModeDate';
import { IconCalendar } from '@/ui/icon'; import { IconCalendar } from '@/ui/icon';
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope'; import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
import { Company, useUpdateCompanyMutation } from '~/generated/graphql'; import { Company, useUpdateOneCompanyMutation } from '~/generated/graphql';
import { formatToHumanReadableDate } from '~/utils'; import { formatToHumanReadableDate } from '~/utils';
import { parseDate } from '~/utils/date-utils'; import { parseDate } from '~/utils/date-utils';
@ -16,7 +16,7 @@ type OwnProps = {
export function CompanyCreatedAtEditableField({ company }: OwnProps) { export function CompanyCreatedAtEditableField({ company }: OwnProps) {
const [internalValue, setInternalValue] = useState(company.createdAt); const [internalValue, setInternalValue] = useState(company.createdAt);
const [updateCompany] = useUpdateCompanyMutation(); const [updateCompany] = useUpdateOneCompanyMutation();
useEffect(() => { useEffect(() => {
setInternalValue(company.createdAt); setInternalValue(company.createdAt);
@ -29,8 +29,12 @@ export function CompanyCreatedAtEditableField({ company }: OwnProps) {
async function handleSubmit() { async function handleSubmit() {
await updateCompany({ await updateCompany({
variables: { variables: {
id: company.id, where: {
createdAt: internalValue ?? '', id: company.id,
},
data: {
createdAt: internalValue ?? '',
},
}, },
}); });
} }

View File

@ -6,7 +6,7 @@ import { FieldContext } from '@/ui/editable-field/states/FieldContext';
import { IconLink } from '@/ui/icon'; import { IconLink } from '@/ui/icon';
import { InplaceInputText } from '@/ui/inplace-input/components/InplaceInputText'; import { InplaceInputText } from '@/ui/inplace-input/components/InplaceInputText';
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope'; import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
import { Company, useUpdateCompanyMutation } from '~/generated/graphql'; import { Company, useUpdateOneCompanyMutation } from '~/generated/graphql';
type OwnProps = { type OwnProps = {
company: Pick<Company, 'id' | 'domainName'>; company: Pick<Company, 'id' | 'domainName'>;
@ -15,7 +15,7 @@ type OwnProps = {
export function CompanyDomainNameEditableField({ company }: OwnProps) { export function CompanyDomainNameEditableField({ company }: OwnProps) {
const [internalValue, setInternalValue] = useState(company.domainName); const [internalValue, setInternalValue] = useState(company.domainName);
const [updateCompany] = useUpdateCompanyMutation(); const [updateCompany] = useUpdateOneCompanyMutation();
useEffect(() => { useEffect(() => {
setInternalValue(company.domainName); setInternalValue(company.domainName);
@ -28,8 +28,12 @@ export function CompanyDomainNameEditableField({ company }: OwnProps) {
async function handleSubmit() { async function handleSubmit() {
await updateCompany({ await updateCompany({
variables: { variables: {
id: company.id, where: {
domainName: internalValue ?? '', id: company.id,
},
data: {
domainName: internalValue ?? '',
},
}, },
}); });
} }

View File

@ -5,7 +5,7 @@ import { FieldContext } from '@/ui/editable-field/states/FieldContext';
import { IconUsers } from '@/ui/icon'; import { IconUsers } from '@/ui/icon';
import { InplaceInputText } from '@/ui/inplace-input/components/InplaceInputText'; import { InplaceInputText } from '@/ui/inplace-input/components/InplaceInputText';
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope'; import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
import { Company, useUpdateCompanyMutation } from '~/generated/graphql'; import { Company, useUpdateOneCompanyMutation } from '~/generated/graphql';
type OwnProps = { type OwnProps = {
company: Pick<Company, 'id' | 'employees'>; company: Pick<Company, 'id' | 'employees'>;
@ -16,7 +16,7 @@ export function CompanyEmployeesEditableField({ company }: OwnProps) {
company.employees?.toString(), company.employees?.toString(),
); );
const [updateCompany] = useUpdateCompanyMutation(); const [updateCompany] = useUpdateOneCompanyMutation();
useEffect(() => { useEffect(() => {
setInternalValue(company.employees?.toString()); setInternalValue(company.employees?.toString());
@ -38,8 +38,12 @@ export function CompanyEmployeesEditableField({ company }: OwnProps) {
await updateCompany({ await updateCompany({
variables: { variables: {
id: company.id, where: {
employees: numberValue, id: company.id,
},
data: {
employees: numberValue,
},
}, },
}); });

View File

@ -1,26 +1,11 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export const UPDATE_COMPANY = gql` export const UPDATE_ONE_COMPANY = gql`
mutation UpdateCompany( mutation UpdateOneCompany(
$id: String $where: CompanyWhereUniqueInput!
$name: String $data: CompanyUpdateInput!
$domainName: String
$accountOwnerId: String
$createdAt: DateTime
$address: String
$employees: Int
) { ) {
updateOneCompany( updateOneCompany(data: $data, where: $where) {
where: { id: $id }
data: {
accountOwner: { connect: { id: $accountOwnerId } }
address: { set: $address }
domainName: { set: $domainName }
employees: { set: $employees }
name: { set: $name }
createdAt: { set: $createdAt }
}
) {
accountOwner { accountOwner {
id id
email email
@ -38,25 +23,9 @@ export const UPDATE_COMPANY = gql`
} }
`; `;
export const INSERT_COMPANY = gql` export const INSERT_ONE_COMPANY = gql`
mutation InsertCompany( mutation InsertOneCompany($data: CompanyCreateInput!) {
$id: String! createOneCompany(data: $data) {
$name: String!
$domainName: String!
$createdAt: DateTime
$address: String!
$employees: Int
) {
createOneCompany(
data: {
id: $id
name: $name
domainName: $domainName
createdAt: $createdAt
address: $address
employees: $employees
}
) {
address address
createdAt createdAt
domainName domainName
@ -67,8 +36,8 @@ export const INSERT_COMPANY = gql`
} }
`; `;
export const DELETE_COMPANIES = gql` export const DELETE_MANY_COMPANIES = gql`
mutation DeleteCompanies($ids: [String!]) { mutation DeleteManyCompanies($ids: [String!]) {
deleteManyCompany(where: { id: { in: $ids } }) { deleteManyCompany(where: { id: { in: $ids } }) {
count count
} }

View File

@ -4,12 +4,12 @@ import { useRecoilValue } from 'recoil';
import { companyAddressFamilyState } from '@/companies/states/companyAddressFamilyState'; import { companyAddressFamilyState } from '@/companies/states/companyAddressFamilyState';
import { EditableCellText } from '@/ui/table/editable-cell/types/EditableCellText'; import { EditableCellText } from '@/ui/table/editable-cell/types/EditableCellText';
import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId'; import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId';
import { useUpdateCompanyMutation } from '~/generated/graphql'; import { useUpdateOneCompanyMutation } from '~/generated/graphql';
export function EditableCompanyAddressCell() { export function EditableCompanyAddressCell() {
const currentRowEntityId = useCurrentRowEntityId(); const currentRowEntityId = useCurrentRowEntityId();
const [updateCompany] = useUpdateCompanyMutation(); const [updateCompany] = useUpdateOneCompanyMutation();
const address = useRecoilValue( const address = useRecoilValue(
companyAddressFamilyState(currentRowEntityId ?? ''), companyAddressFamilyState(currentRowEntityId ?? ''),
@ -27,8 +27,12 @@ export function EditableCompanyAddressCell() {
onSubmit={() => onSubmit={() =>
updateCompany({ updateCompany({
variables: { variables: {
id: currentRowEntityId, where: {
address: internalValue, id: currentRowEntityId,
},
data: {
address: internalValue,
},
}, },
}) })
} }

View File

@ -4,7 +4,7 @@ import { useRecoilValue } from 'recoil';
import { companyCreatedAtFamilyState } from '@/companies/states/companyCreatedAtFamilyState'; import { companyCreatedAtFamilyState } from '@/companies/states/companyCreatedAtFamilyState';
import { EditableCellDate } from '@/ui/table/editable-cell/types/EditableCellDate'; import { EditableCellDate } from '@/ui/table/editable-cell/types/EditableCellDate';
import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId'; import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId';
import { useUpdateCompanyMutation } from '~/generated/graphql'; import { useUpdateOneCompanyMutation } from '~/generated/graphql';
export function EditableCompanyCreatedAtCell() { export function EditableCompanyCreatedAtCell() {
const currentRowEntityId = useCurrentRowEntityId(); const currentRowEntityId = useCurrentRowEntityId();
@ -13,7 +13,7 @@ export function EditableCompanyCreatedAtCell() {
companyCreatedAtFamilyState(currentRowEntityId ?? ''), companyCreatedAtFamilyState(currentRowEntityId ?? ''),
); );
const [updateCompany] = useUpdateCompanyMutation(); const [updateCompany] = useUpdateOneCompanyMutation();
return ( return (
<EditableCellDate <EditableCellDate
@ -22,8 +22,12 @@ export function EditableCompanyCreatedAtCell() {
await updateCompany({ await updateCompany({
variables: { variables: {
id: currentRowEntityId, where: {
createdAt: newDate.toISOString(), id: currentRowEntityId,
},
data: {
createdAt: newDate.toISOString(),
},
}, },
}); });
}} }}

View File

@ -4,12 +4,12 @@ import { useRecoilValue } from 'recoil';
import { companyDomainNameFamilyState } from '@/companies/states/companyDomainNameFamilyState'; import { companyDomainNameFamilyState } from '@/companies/states/companyDomainNameFamilyState';
import { EditableCellText } from '@/ui/table/editable-cell/types/EditableCellText'; import { EditableCellText } from '@/ui/table/editable-cell/types/EditableCellText';
import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId'; import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId';
import { useUpdateCompanyMutation } from '~/generated/graphql'; import { useUpdateOneCompanyMutation } from '~/generated/graphql';
export function EditableCompanyDomainNameCell() { export function EditableCompanyDomainNameCell() {
const currentRowEntityId = useCurrentRowEntityId(); const currentRowEntityId = useCurrentRowEntityId();
const [updateCompany] = useUpdateCompanyMutation(); const [updateCompany] = useUpdateOneCompanyMutation();
const name = useRecoilValue( const name = useRecoilValue(
companyDomainNameFamilyState(currentRowEntityId ?? ''), companyDomainNameFamilyState(currentRowEntityId ?? ''),
@ -26,8 +26,12 @@ export function EditableCompanyDomainNameCell() {
onSubmit={() => onSubmit={() =>
updateCompany({ updateCompany({
variables: { variables: {
id: currentRowEntityId, where: {
domainName: internalValue, id: currentRowEntityId,
},
data: {
domainName: internalValue,
},
}, },
}) })
} }

View File

@ -4,12 +4,12 @@ import { useRecoilValue } from 'recoil';
import { companyEmployeesFamilyState } from '@/companies/states/companyEmployeesFamilyState'; import { companyEmployeesFamilyState } from '@/companies/states/companyEmployeesFamilyState';
import { EditableCellText } from '@/ui/table/editable-cell/types/EditableCellText'; import { EditableCellText } from '@/ui/table/editable-cell/types/EditableCellText';
import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId'; import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId';
import { useUpdateCompanyMutation } from '~/generated/graphql'; import { useUpdateOneCompanyMutation } from '~/generated/graphql';
export function EditableCompanyEmployeesCell() { export function EditableCompanyEmployeesCell() {
const currentRowEntityId = useCurrentRowEntityId(); const currentRowEntityId = useCurrentRowEntityId();
const [updateCompany] = useUpdateCompanyMutation(); const [updateCompany] = useUpdateOneCompanyMutation();
const employees = useRecoilValue( const employees = useRecoilValue(
companyEmployeesFamilyState(currentRowEntityId ?? ''), companyEmployeesFamilyState(currentRowEntityId ?? ''),
@ -29,8 +29,12 @@ export function EditableCompanyEmployeesCell() {
onSubmit={() => onSubmit={() =>
updateCompany({ updateCompany({
variables: { variables: {
id: currentRowEntityId, where: {
employees: parseInt(internalValue), id: currentRowEntityId,
},
data: {
employees: parseInt(internalValue),
},
}, },
}) })
} }

View File

@ -6,14 +6,14 @@ import { IconTrash } from '@/ui/icon/index';
import { EntityTableActionBarButton } from '@/ui/table/action-bar/components/EntityTableActionBarButton'; import { EntityTableActionBarButton } from '@/ui/table/action-bar/components/EntityTableActionBarButton';
import { useResetTableRowSelection } from '@/ui/table/hooks/useResetTableRowSelection'; import { useResetTableRowSelection } from '@/ui/table/hooks/useResetTableRowSelection';
import { selectedRowIdsSelector } from '@/ui/table/states/selectedRowIdsSelector'; import { selectedRowIdsSelector } from '@/ui/table/states/selectedRowIdsSelector';
import { useDeleteCompaniesMutation } from '~/generated/graphql'; import { useDeleteManyCompaniesMutation } from '~/generated/graphql';
export function TableActionBarButtonDeleteCompanies() { export function TableActionBarButtonDeleteCompanies() {
const selectedRowIds = useRecoilValue(selectedRowIdsSelector); const selectedRowIds = useRecoilValue(selectedRowIdsSelector);
const resetRowSelection = useResetTableRowSelection(); const resetRowSelection = useResetTableRowSelection();
const [deleteCompanies] = useDeleteCompaniesMutation({ const [deleteCompanies] = useDeleteManyCompaniesMutation({
refetchQueries: [getOperationName(GET_COMPANIES) ?? ''], refetchQueries: [getOperationName(GET_COMPANIES) ?? ''],
}); });

View File

@ -10,7 +10,7 @@ export type PipelineProgressForBoard = Pick<
| 'probability' | 'probability'
| 'pointOfContactId' | 'pointOfContactId'
> & { > & {
pointOfContact?: Pick<Person, 'id' | 'firstName' | 'lastName'> | null; pointOfContact?: Pick<Person, 'id' | 'displayName'> | null;
}; };
export type CompanyProgress = { export type CompanyProgress = {

View File

@ -8,7 +8,14 @@ import { PersonChip } from './PersonChip';
type OwnProps = { type OwnProps = {
person: person:
| Partial< | Partial<
Pick<Person, 'id' | 'firstName' | 'lastName' | '_commentThreadCount'> Pick<
Person,
| 'id'
| 'firstName'
| 'lastName'
| 'displayName'
| '_commentThreadCount'
>
> >
| null | null
| undefined; | undefined;
@ -49,7 +56,7 @@ export function EditablePeopleFullName({
nonEditModeContent={ nonEditModeContent={
<NoEditModeContainer> <NoEditModeContainer>
<PersonChip <PersonChip
name={person?.firstName + ' ' + person?.lastName} name={`${person?.firstName ?? ''} ${person?.lastName ?? ''}`}
id={person?.id ?? ''} id={person?.id ?? ''}
clickable clickable
/> />

View File

@ -9,8 +9,8 @@ import { isCreateModeScopedState } from '@/ui/table/editable-cell/states/isCreat
import { EditableCellDoubleTextEditMode } from '@/ui/table/editable-cell/types/EditableCellDoubleTextEditMode'; import { EditableCellDoubleTextEditMode } from '@/ui/table/editable-cell/types/EditableCellDoubleTextEditMode';
import { import {
Person, Person,
useInsertCompanyMutation, useInsertOneCompanyMutation,
useUpdatePeopleMutation, useUpdateOnePersonMutation,
} from '~/generated/graphql'; } from '~/generated/graphql';
import { logError } from '~/utils/logError'; import { logError } from '~/utils/logError';
@ -30,8 +30,8 @@ export function PeopleCompanyCreateCell({ people }: OwnProps) {
const [companyName, setCompanyName] = useState(currentSearchFilter); const [companyName, setCompanyName] = useState(currentSearchFilter);
const [companyDomainName, setCompanyDomainName] = useState(''); const [companyDomainName, setCompanyDomainName] = useState('');
const [insertCompany] = useInsertCompanyMutation(); const [insertCompany] = useInsertOneCompanyMutation();
const [updatePeople] = useUpdatePeopleMutation(); const [updatePerson] = useUpdateOnePersonMutation();
function handleDoubleTextChange(leftValue: string, rightValue: string): void { function handleDoubleTextChange(leftValue: string, rightValue: string): void {
setCompanyDomainName(leftValue); setCompanyDomainName(leftValue);
@ -47,11 +47,12 @@ export function PeopleCompanyCreateCell({ people }: OwnProps) {
try { try {
await insertCompany({ await insertCompany({
variables: { variables: {
id: newCompanyId, data: {
name: companyName, id: newCompanyId,
domainName: companyDomainName, name: companyName,
address: '', domainName: companyDomainName,
createdAt: new Date().toISOString(), address: '',
},
}, },
refetchQueries: [ refetchQueries: [
getOperationName(GET_COMPANIES) ?? '', getOperationName(GET_COMPANIES) ?? '',
@ -59,10 +60,14 @@ export function PeopleCompanyCreateCell({ people }: OwnProps) {
], ],
}); });
await updatePeople({ await updatePerson({
variables: { variables: {
...people, where: {
companyId: newCompanyId, id: people.id,
},
data: {
company: { connect: { id: newCompanyId } },
},
}, },
}); });
} catch (error) { } catch (error) {

View File

@ -10,7 +10,11 @@ import { RelationPickerHotkeyScope } from '@/ui/relation-picker/types/RelationPi
import { useEditableCell } from '@/ui/table/editable-cell/hooks/useEditableCell'; import { useEditableCell } from '@/ui/table/editable-cell/hooks/useEditableCell';
import { isCreateModeScopedState } from '@/ui/table/editable-cell/states/isCreateModeScopedState'; import { isCreateModeScopedState } from '@/ui/table/editable-cell/states/isCreateModeScopedState';
import { TableHotkeyScope } from '@/ui/table/types/TableHotkeyScope'; import { TableHotkeyScope } from '@/ui/table/types/TableHotkeyScope';
import { Company, Person, useUpdatePeopleMutation } from '~/generated/graphql'; import {
Company,
Person,
useUpdateOnePersonMutation,
} from '~/generated/graphql';
export type OwnProps = { export type OwnProps = {
people: Pick<Person, 'id'> & { company?: Pick<Company, 'id'> | null }; people: Pick<Person, 'id'> & { company?: Pick<Company, 'id'> | null };
@ -22,7 +26,7 @@ export function PeopleCompanyPicker({ people }: OwnProps) {
const [searchFilter] = useRecoilScopedState( const [searchFilter] = useRecoilScopedState(
relationPickerSearchFilterScopedState, relationPickerSearchFilterScopedState,
); );
const [updatePeople] = useUpdatePeopleMutation(); const [updatePerson] = useUpdateOnePersonMutation();
const { closeEditableCell } = useEditableCell(); const { closeEditableCell } = useEditableCell();
@ -34,10 +38,14 @@ export function PeopleCompanyPicker({ people }: OwnProps) {
}); });
async function handleEntitySelected(entity: any) { async function handleEntitySelected(entity: any) {
await updatePeople({ await updatePerson({
variables: { variables: {
...people, where: {
companyId: entity.id, id: people.id,
},
data: {
company: { connect: { id: entity.id } },
},
}, },
}); });

View File

@ -9,7 +9,11 @@ import { PropertyBox } from '@/ui/editable-field/property-box/components/Propert
import { DateEditableField } from '@/ui/editable-field/variants/components/DateEditableField'; import { DateEditableField } from '@/ui/editable-field/variants/components/DateEditableField';
import { PhoneEditableField } from '@/ui/editable-field/variants/components/PhoneEditableField'; import { PhoneEditableField } from '@/ui/editable-field/variants/components/PhoneEditableField';
import { TextEditableField } from '@/ui/editable-field/variants/components/TextEditableField'; import { TextEditableField } from '@/ui/editable-field/variants/components/TextEditableField';
import { Company, Person, useUpdatePeopleMutation } from '~/generated/graphql'; import {
Company,
Person,
useUpdateOnePersonMutation,
} from '~/generated/graphql';
import { PeopleCompanyEditableField } from '../editable-field/components/PeopleCompanyEditableField'; import { PeopleCompanyEditableField } from '../editable-field/components/PeopleCompanyEditableField';
@ -23,7 +27,7 @@ type OwnProps = {
}; };
export function PersonPropertyBox({ person }: OwnProps) { export function PersonPropertyBox({ person }: OwnProps) {
const [updatePerson] = useUpdatePeopleMutation(); const [updatePerson] = useUpdateOnePersonMutation();
return ( return (
<PropertyBox extraPadding={true}> <PropertyBox extraPadding={true}>
@ -34,8 +38,12 @@ export function PersonPropertyBox({ person }: OwnProps) {
onSubmit={(newEmail) => { onSubmit={(newEmail) => {
updatePerson({ updatePerson({
variables: { variables: {
id: person.id, where: {
email: newEmail, id: person.id,
},
data: {
email: newEmail,
},
}, },
}); });
}} }}
@ -47,8 +55,12 @@ export function PersonPropertyBox({ person }: OwnProps) {
onSubmit={(newPhone) => { onSubmit={(newPhone) => {
updatePerson({ updatePerson({
variables: { variables: {
id: person.id, where: {
phone: newPhone, id: person.id,
},
data: {
phone: newPhone,
},
}, },
}); });
}} }}
@ -59,8 +71,12 @@ export function PersonPropertyBox({ person }: OwnProps) {
onSubmit={(newDate) => { onSubmit={(newDate) => {
updatePerson({ updatePerson({
variables: { variables: {
id: person.id, where: {
createdAt: newDate, id: person.id,
},
data: {
createdAt: newDate,
},
}, },
}); });
}} }}
@ -73,8 +89,12 @@ export function PersonPropertyBox({ person }: OwnProps) {
onSubmit={(newCity) => { onSubmit={(newCity) => {
updatePerson({ updatePerson({
variables: { variables: {
id: person.id, where: {
city: newCity, id: person.id,
},
data: {
city: newCity,
},
}, },
}); });
}} }}

View File

@ -4,7 +4,11 @@ import { useRecoilScopedState } from '@/ui/recoil-scope/hooks/useRecoilScopedSta
import { SingleEntitySelect } from '@/ui/relation-picker/components/SingleEntitySelect'; import { SingleEntitySelect } from '@/ui/relation-picker/components/SingleEntitySelect';
import { relationPickerSearchFilterScopedState } from '@/ui/relation-picker/states/relationPickerSearchFilterScopedState'; import { relationPickerSearchFilterScopedState } from '@/ui/relation-picker/states/relationPickerSearchFilterScopedState';
import { EntityForSelect } from '@/ui/relation-picker/types/EntityForSelect'; import { EntityForSelect } from '@/ui/relation-picker/types/EntityForSelect';
import { Company, Person, useUpdatePeopleMutation } from '~/generated/graphql'; import {
Company,
Person,
useUpdateOnePersonMutation,
} from '~/generated/graphql';
export type OwnProps = { export type OwnProps = {
people: Pick<Person, 'id'> & { company?: Pick<Company, 'id'> | null }; people: Pick<Person, 'id'> & { company?: Pick<Company, 'id'> | null };
@ -16,7 +20,7 @@ export function PeopleCompanyEditableFieldEditMode({ people }: OwnProps) {
const [searchFilter] = useRecoilScopedState( const [searchFilter] = useRecoilScopedState(
relationPickerSearchFilterScopedState, relationPickerSearchFilterScopedState,
); );
const [updatePeople] = useUpdatePeopleMutation(); const [updatePerson] = useUpdateOnePersonMutation();
const companies = useFilteredSearchCompanyQuery({ const companies = useFilteredSearchCompanyQuery({
searchFilter, searchFilter,
@ -24,10 +28,14 @@ export function PeopleCompanyEditableFieldEditMode({ people }: OwnProps) {
}); });
async function handleEntitySelected(entity: EntityForSelect) { async function handleEntitySelected(entity: EntityForSelect) {
await updatePeople({ await updatePerson({
variables: { variables: {
...people, where: {
companyId: entity.id, id: people.id,
},
data: {
company: { connect: { id: entity.id } },
},
}, },
}); });
closeEditableField(); closeEditableField();

View File

@ -19,7 +19,7 @@ export function useSetPeopleEntityTable() {
.valueOrThrow(); .valueOrThrow();
if (currentEmail !== person.email) { if (currentEmail !== person.email) {
set(peopleEmailFamilyState(person.id), person.email); set(peopleEmailFamilyState(person.id), person.email ?? null);
} }
const currentCity = snapshot const currentCity = snapshot
@ -27,7 +27,7 @@ export function useSetPeopleEntityTable() {
.valueOrThrow(); .valueOrThrow();
if (currentCity !== person.city) { if (currentCity !== person.city) {
set(peopleCityFamilyState(person.id), person.city); set(peopleCityFamilyState(person.id), person.city ?? null);
} }
const currentCompany = snapshot const currentCompany = snapshot
@ -45,7 +45,7 @@ export function useSetPeopleEntityTable() {
.valueOrThrow(); .valueOrThrow();
if (currentPhone !== person.phone) { if (currentPhone !== person.phone) {
set(peoplePhoneFamilyState(person.id), person.phone); set(peoplePhoneFamilyState(person.id), person.phone ?? null);
} }
const currentCreatedAt = snapshot const currentCreatedAt = snapshot
@ -66,9 +66,10 @@ export function useSetPeopleEntityTable() {
currentNameCell.commentCount !== person._commentThreadCount currentNameCell.commentCount !== person._commentThreadCount
) { ) {
set(peopleNameCellFamilyState(person.id), { set(peopleNameCellFamilyState(person.id), {
firstName: person.firstName, firstName: person.firstName ?? null,
lastName: person.lastName, lastName: person.lastName ?? null,
commentCount: person._commentThreadCount, commentCount: person._commentThreadCount,
displayName: person.displayName ?? null,
}); });
} }
} }

View File

@ -9,13 +9,11 @@ describe('reduceSortsToOrderBy', () => {
key: 'firstName', key: 'firstName',
label: 'firstName', label: 'firstName',
order: 'asc', order: 'asc',
_type: 'default_sort',
}, },
{ {
key: 'lastName', key: 'lastName',
label: 'lastName', label: 'lastName',
order: 'desc', order: 'desc',
_type: 'default_sort',
}, },
] satisfies PeopleSelectedSortType[]; ] satisfies PeopleSelectedSortType[];
const result = reduceSortsToOrderBy(sorts); const result = reduceSortsToOrderBy(sorts);

View File

@ -27,6 +27,7 @@ export const GET_PEOPLE = gql`
city city
firstName firstName
lastName lastName
displayName
createdAt createdAt
_commentThreadCount _commentThreadCount
company { company {
@ -103,6 +104,7 @@ export const GET_PERSON_NAMES_AND_COMMENT_COUNT = gql`
id id
firstName firstName
lastName lastName
displayName
_commentThreadCount _commentThreadCount
} }
} }

View File

@ -1,29 +1,11 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export const UPDATE_PERSON = gql` export const UPDATE_ONE_PERSON = gql`
mutation UpdatePeople( mutation UpdateOnePerson(
$id: String $where: PersonWhereUniqueInput!
$firstName: String $data: PersonUpdateInput!
$lastName: String
$phone: String
$city: String
$companyId: String
$email: String
$createdAt: DateTime
) { ) {
updateOnePerson( updateOnePerson(data: $data, where: $where) {
where: { id: $id }
data: {
city: { set: $city }
company: { connect: { id: $companyId } }
email: { set: $email }
firstName: { set: $firstName }
id: { set: $id }
lastName: { set: $lastName }
phone: { set: $phone }
createdAt: { set: $createdAt }
}
) {
id id
city city
company { company {
@ -34,33 +16,16 @@ export const UPDATE_PERSON = gql`
email email
firstName firstName
lastName lastName
displayName
phone phone
createdAt createdAt
} }
} }
`; `;
export const INSERT_PERSON = gql` export const INSERT_ONE_PERSON = gql`
mutation InsertPerson( mutation InsertOnePerson($data: PersonCreateInput!) {
$id: String! createOnePerson(data: $data) {
$firstName: String!
$lastName: String!
$phone: String!
$city: String!
$email: String!
$createdAt: DateTime
) {
createOnePerson(
data: {
id: $id
firstName: $firstName
lastName: $lastName
phone: $phone
city: $city
email: $email
createdAt: $createdAt
}
) {
id id
city city
company { company {
@ -71,14 +36,15 @@ export const INSERT_PERSON = gql`
email email
firstName firstName
lastName lastName
displayName
phone phone
createdAt createdAt
} }
} }
`; `;
export const DELETE_PEOPLE = gql` export const DELETE_MANY_PERSON = gql`
mutation DeletePeople($ids: [String!]) { mutation DeleteManyPerson($ids: [String!]) {
deleteManyPerson(where: { id: { in: $ids } }) { deleteManyPerson(where: { id: { in: $ids } }) {
count count
} }

View File

@ -5,6 +5,7 @@ export const peopleNameCellFamilyState = atomFamily<
firstName: string | null; firstName: string | null;
lastName: string | null; lastName: string | null;
commentCount: number | null; commentCount: number | null;
displayName: string | null;
}, },
string string
>({ >({
@ -13,5 +14,6 @@ export const peopleNameCellFamilyState = atomFamily<
firstName: null, firstName: null,
lastName: null, lastName: null,
commentCount: null, commentCount: null,
displayName: null,
}, },
}); });

View File

@ -4,12 +4,12 @@ import { useRecoilValue } from 'recoil';
import { peopleCityFamilyState } from '@/people/states/peopleCityFamilyState'; import { peopleCityFamilyState } from '@/people/states/peopleCityFamilyState';
import { EditableCellText } from '@/ui/table/editable-cell/types/EditableCellText'; import { EditableCellText } from '@/ui/table/editable-cell/types/EditableCellText';
import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId'; import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId';
import { useUpdatePeopleMutation } from '~/generated/graphql'; import { useUpdateOnePersonMutation } from '~/generated/graphql';
export function EditablePeopleCityCell() { export function EditablePeopleCityCell() {
const currentRowEntityId = useCurrentRowEntityId(); const currentRowEntityId = useCurrentRowEntityId();
const [updatePerson] = useUpdatePeopleMutation(); const [updatePerson] = useUpdateOnePersonMutation();
const city = useRecoilValue(peopleCityFamilyState(currentRowEntityId ?? '')); const city = useRecoilValue(peopleCityFamilyState(currentRowEntityId ?? ''));
@ -26,8 +26,12 @@ export function EditablePeopleCityCell() {
onSubmit={() => onSubmit={() =>
updatePerson({ updatePerson({
variables: { variables: {
id: currentRowEntityId, where: {
city: internalValue, id: currentRowEntityId,
},
data: {
city: internalValue,
},
}, },
}) })
} }

View File

@ -4,7 +4,7 @@ import { useRecoilValue } from 'recoil';
import { peopleCreatedAtFamilyState } from '@/people/states/peopleCreatedAtFamilyState'; import { peopleCreatedAtFamilyState } from '@/people/states/peopleCreatedAtFamilyState';
import { EditableCellDate } from '@/ui/table/editable-cell/types/EditableCellDate'; import { EditableCellDate } from '@/ui/table/editable-cell/types/EditableCellDate';
import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId'; import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId';
import { useUpdatePeopleMutation } from '~/generated/graphql'; import { useUpdateOnePersonMutation } from '~/generated/graphql';
export function EditablePeopleCreatedAtCell() { export function EditablePeopleCreatedAtCell() {
const currentRowEntityId = useCurrentRowEntityId(); const currentRowEntityId = useCurrentRowEntityId();
@ -13,7 +13,7 @@ export function EditablePeopleCreatedAtCell() {
peopleCreatedAtFamilyState(currentRowEntityId ?? ''), peopleCreatedAtFamilyState(currentRowEntityId ?? ''),
); );
const [updatePerson] = useUpdatePeopleMutation(); const [updatePerson] = useUpdateOnePersonMutation();
return ( return (
<EditableCellDate <EditableCellDate
@ -22,8 +22,12 @@ export function EditablePeopleCreatedAtCell() {
await updatePerson({ await updatePerson({
variables: { variables: {
id: currentRowEntityId, where: {
createdAt: newDate.toISOString(), id: currentRowEntityId,
},
data: {
createdAt: newDate.toISOString(),
},
}, },
}); });
}} }}

View File

@ -4,12 +4,12 @@ import { useRecoilValue } from 'recoil';
import { peopleEmailFamilyState } from '@/people/states/peopleEmailFamilyState'; import { peopleEmailFamilyState } from '@/people/states/peopleEmailFamilyState';
import { EditableCellText } from '@/ui/table/editable-cell/types/EditableCellText'; import { EditableCellText } from '@/ui/table/editable-cell/types/EditableCellText';
import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId'; import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId';
import { useUpdatePeopleMutation } from '~/generated/graphql'; import { useUpdateOnePersonMutation } from '~/generated/graphql';
export function EditablePeopleEmailCell() { export function EditablePeopleEmailCell() {
const currentRowEntityId = useCurrentRowEntityId(); const currentRowEntityId = useCurrentRowEntityId();
const [updatePerson] = useUpdatePeopleMutation(); const [updatePerson] = useUpdateOnePersonMutation();
const email = useRecoilValue( const email = useRecoilValue(
peopleEmailFamilyState(currentRowEntityId ?? ''), peopleEmailFamilyState(currentRowEntityId ?? ''),
@ -28,8 +28,12 @@ export function EditablePeopleEmailCell() {
onSubmit={() => onSubmit={() =>
updatePerson({ updatePerson({
variables: { variables: {
id: currentRowEntityId, where: {
email: internalValue, id: currentRowEntityId,
},
data: {
email: internalValue,
},
}, },
}) })
} }

View File

@ -5,16 +5,16 @@ import { useRecoilValue } from 'recoil';
import { EditablePeopleFullName } from '@/people/components/EditablePeopleFullName'; import { EditablePeopleFullName } from '@/people/components/EditablePeopleFullName';
import { peopleNameCellFamilyState } from '@/people/states/peopleNamesFamilyState'; import { peopleNameCellFamilyState } from '@/people/states/peopleNamesFamilyState';
import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId'; import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId';
import { useUpdatePeopleMutation } from '~/generated/graphql'; import { useUpdateOnePersonMutation } from '~/generated/graphql';
import { GET_PERSON } from '../../queries'; import { GET_PERSON } from '../../queries';
export function EditablePeopleFullNameCell() { export function EditablePeopleFullNameCell() {
const currentRowEntityId = useCurrentRowEntityId(); const currentRowEntityId = useCurrentRowEntityId();
const [updatePerson] = useUpdatePeopleMutation(); const [updatePerson] = useUpdateOnePersonMutation();
const { commentCount, firstName, lastName } = useRecoilValue( const { commentCount, firstName, lastName, displayName } = useRecoilValue(
peopleNameCellFamilyState(currentRowEntityId ?? ''), peopleNameCellFamilyState(currentRowEntityId ?? ''),
); );
@ -33,6 +33,7 @@ export function EditablePeopleFullNameCell() {
_commentThreadCount: commentCount ?? undefined, _commentThreadCount: commentCount ?? undefined,
firstName: internalFirstName, firstName: internalFirstName,
lastName: internalLastName, lastName: internalLastName,
displayName: displayName ?? undefined,
}} }}
onChange={(firstName, lastName) => { onChange={(firstName, lastName) => {
setInternalFirstName(firstName); setInternalFirstName(firstName);
@ -41,9 +42,13 @@ export function EditablePeopleFullNameCell() {
onSubmit={() => onSubmit={() =>
updatePerson({ updatePerson({
variables: { variables: {
id: currentRowEntityId, where: {
firstName: internalFirstName, id: currentRowEntityId,
lastName: internalLastName, },
data: {
firstName: internalFirstName,
lastName: internalLastName,
},
}, },
refetchQueries: [getOperationName(GET_PERSON) ?? ''], refetchQueries: [getOperationName(GET_PERSON) ?? ''],
}) })

View File

@ -4,12 +4,12 @@ import { useRecoilValue } from 'recoil';
import { peoplePhoneFamilyState } from '@/people/states/peoplePhoneFamilyState'; import { peoplePhoneFamilyState } from '@/people/states/peoplePhoneFamilyState';
import { EditableCellPhone } from '@/ui/table/editable-cell/types/EditableCellPhone'; import { EditableCellPhone } from '@/ui/table/editable-cell/types/EditableCellPhone';
import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId'; import { useCurrentRowEntityId } from '@/ui/table/hooks/useCurrentEntityId';
import { useUpdatePeopleMutation } from '~/generated/graphql'; import { useUpdateOnePersonMutation } from '~/generated/graphql';
export function EditablePeoplePhoneCell() { export function EditablePeoplePhoneCell() {
const currentRowEntityId = useCurrentRowEntityId(); const currentRowEntityId = useCurrentRowEntityId();
const [updatePerson] = useUpdatePeopleMutation(); const [updatePerson] = useUpdateOnePersonMutation();
const phone = useRecoilValue( const phone = useRecoilValue(
peoplePhoneFamilyState(currentRowEntityId ?? ''), peoplePhoneFamilyState(currentRowEntityId ?? ''),
@ -28,8 +28,12 @@ export function EditablePeoplePhoneCell() {
onSubmit={() => onSubmit={() =>
updatePerson({ updatePerson({
variables: { variables: {
id: currentRowEntityId, where: {
phone: internalValue, id: currentRowEntityId,
},
data: {
phone: internalValue,
},
}, },
}) })
} }

View File

@ -6,14 +6,14 @@ import { IconTrash } from '@/ui/icon/index';
import { EntityTableActionBarButton } from '@/ui/table/action-bar/components/EntityTableActionBarButton'; import { EntityTableActionBarButton } from '@/ui/table/action-bar/components/EntityTableActionBarButton';
import { useResetTableRowSelection } from '@/ui/table/hooks/useResetTableRowSelection'; import { useResetTableRowSelection } from '@/ui/table/hooks/useResetTableRowSelection';
import { selectedRowIdsSelector } from '@/ui/table/states/selectedRowIdsSelector'; import { selectedRowIdsSelector } from '@/ui/table/states/selectedRowIdsSelector';
import { useDeletePeopleMutation } from '~/generated/graphql'; import { useDeleteManyPersonMutation } from '~/generated/graphql';
export function TableActionBarButtonDeletePeople() { export function TableActionBarButtonDeletePeople() {
const selectedRowIds = useRecoilValue(selectedRowIdsSelector); const selectedRowIds = useRecoilValue(selectedRowIdsSelector);
const resetRowSelection = useResetTableRowSelection(); const resetRowSelection = useResetTableRowSelection();
const [deletePeople] = useDeletePeopleMutation({ const [deleteManyPerson] = useDeleteManyPersonMutation({
refetchQueries: [getOperationName(GET_PEOPLE) ?? ''], refetchQueries: [getOperationName(GET_PEOPLE) ?? ''],
}); });
@ -22,7 +22,7 @@ export function TableActionBarButtonDeletePeople() {
resetRowSelection(); resetRowSelection();
await deletePeople({ await deleteManyPerson({
variables: { variables: {
ids: rowIdsToDelete, ids: rowIdsToDelete,
}, },

View File

@ -10,7 +10,7 @@ import { PipelineProgressPointOfContactPickerFieldEditMode } from './PipelinePro
type OwnProps = { type OwnProps = {
pipelineProgress: Pick<PipelineProgress, 'id' | 'pointOfContactId'> & { pipelineProgress: Pick<PipelineProgress, 'id' | 'pointOfContactId'> & {
pointOfContact?: Pick<Person, 'id' | 'firstName' | 'lastName'> | null; pointOfContact?: Pick<Person, 'id' | 'displayName'> | null;
}; };
}; };
@ -34,10 +34,7 @@ export function PipelineProgressPointOfContactEditableField({
pipelineProgress.pointOfContact ? ( pipelineProgress.pointOfContact ? (
<PersonChip <PersonChip
id={pipelineProgress.pointOfContact.id} id={pipelineProgress.pointOfContact.id}
name={ name={pipelineProgress.pointOfContact.displayName}
pipelineProgress.pointOfContact?.firstName +
pipelineProgress.pointOfContact.lastName
}
/> />
) : ( ) : (
<></> <></>

View File

@ -12,7 +12,10 @@ const PipelineProgressPointOfContactPickerContainer = styled.div`
export type OwnProps = { export type OwnProps = {
pipelineProgress: Pick<PipelineProgress, 'id'> & { pipelineProgress: Pick<PipelineProgress, 'id'> & {
pointOfContact?: Pick<Person, 'id' | 'firstName' | 'lastName'> | null; pointOfContact?: Pick<
Person,
'id' | 'firstName' | 'lastName' | 'displayName'
> | null;
}; };
onSubmit?: () => void; onSubmit?: () => void;
onCancel?: () => void; onCancel?: () => void;

View File

@ -42,6 +42,7 @@ export const GET_PIPELINE_PROGRESS = gql`
id id
firstName firstName
lastName lastName
displayName
} }
probability probability
} }
@ -59,9 +60,9 @@ export const UPDATE_PIPELINE_PROGRESS = gql`
updateOnePipelineProgress( updateOnePipelineProgress(
where: { id: $id } where: { id: $id }
data: { data: {
amount: { set: $amount } amount: $amount
closeDate: { set: $closeDate } closeDate: $closeDate
probability: { set: $probability } probability: $probability
pointOfContact: { connect: { id: $pointOfContactId } } pointOfContact: { connect: { id: $pointOfContactId } }
} }
) { ) {

View File

@ -10,7 +10,7 @@ export const DELETE_PIPELINE_PROGRESS = gql`
export const UPDATE_PIPELINE_STAGE = gql` export const UPDATE_PIPELINE_STAGE = gql`
mutation UpdatePipelineStage($id: String, $name: String) { mutation UpdatePipelineStage($id: String, $name: String) {
updateOnePipelineStage(where: { id: $id }, data: { name: { set: $name } }) { updateOnePipelineStage(where: { id: $id }, data: { name: $name }) {
id id
name name
} }

View File

@ -51,12 +51,8 @@ export function NameFields({
id: currentUser?.id, id: currentUser?.id,
}, },
data: { data: {
firstName: { firstName,
set: firstName, lastName,
},
lastName: {
set: lastName,
},
}, },
}, },
refetchQueries: [getOperationName(GET_CURRENT_USER) ?? ''], refetchQueries: [getOperationName(GET_CURRENT_USER) ?? ''],

View File

@ -44,9 +44,7 @@ export function NameField({ autoSave = true, onNameUpdate }: OwnProps) {
const { data, errors } = await updateWorkspace({ const { data, errors } = await updateWorkspace({
variables: { variables: {
data: { data: {
displayName: { displayName: name,
set: name,
},
}, },
}, },
refetchQueries: [getOperationName(GET_CURRENT_USER) ?? ''], refetchQueries: [getOperationName(GET_CURRENT_USER) ?? ''],

View File

@ -5,7 +5,7 @@ import { FieldContext } from '@/ui/editable-field/states/FieldContext';
import { IconMap } from '@/ui/icon'; import { IconMap } from '@/ui/icon';
import { InplaceInputText } from '@/ui/inplace-input/components/InplaceInputText'; import { InplaceInputText } from '@/ui/inplace-input/components/InplaceInputText';
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope'; import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
import { Company, useUpdateCompanyMutation } from '~/generated/graphql'; import { Company, useUpdateOneCompanyMutation } from '~/generated/graphql';
type OwnProps = { type OwnProps = {
company: Pick<Company, 'id' | 'address'>; company: Pick<Company, 'id' | 'address'>;
@ -14,7 +14,7 @@ type OwnProps = {
export function CompanyEditableFieldAddress({ company }: OwnProps) { export function CompanyEditableFieldAddress({ company }: OwnProps) {
const [internalValue, setInternalValue] = useState(company.address); const [internalValue, setInternalValue] = useState(company.address);
const [updateCompany] = useUpdateCompanyMutation(); const [updateCompany] = useUpdateOneCompanyMutation();
useEffect(() => { useEffect(() => {
setInternalValue(company.address); setInternalValue(company.address);
@ -27,8 +27,12 @@ export function CompanyEditableFieldAddress({ company }: OwnProps) {
async function handleSubmit() { async function handleSubmit() {
await updateCompany({ await updateCompany({
variables: { variables: {
id: company.id, where: {
address: internalValue ?? '', id: company.id,
},
data: {
address: internalValue ?? '',
},
}, },
}); });
} }

View File

@ -29,9 +29,7 @@ export function useColorScheme() {
data: { data: {
settings: { settings: {
update: { update: {
colorScheme: { colorScheme: value,
set: value,
},
}, },
}, },
}, },

View File

@ -36,7 +36,7 @@ export const UPDATE_PROFILE_PICTURE = gql`
export const REMOVE_PROFILE_PICTURE = gql` export const REMOVE_PROFILE_PICTURE = gql`
mutation RemoveProfilePicture($where: UserWhereUniqueInput!) { mutation RemoveProfilePicture($where: UserWhereUniqueInput!) {
updateUser(data: { avatarUrl: { set: null } }, where: $where) { updateUser(data: { avatarUrl: null }, where: $where) {
id id
avatarUrl avatarUrl
} }

View File

@ -1,7 +1,6 @@
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { Avatar } from '@/users/components/Avatar'; import { Avatar } from '@/users/components/Avatar';
import { getImageAbsoluteURIOrBase64 } from '@/users/utils/getProfilePictureAbsoluteURI';
import { User } from '~/generated/graphql'; import { User } from '~/generated/graphql';
const StyledContainer = styled.div` const StyledContainer = styled.div`
@ -33,7 +32,10 @@ const EmailText = styled.span`
type OwnProps = { type OwnProps = {
workspaceMember: { workspaceMember: {
user: Pick<User, 'id' | 'firstName' | 'lastName' | 'avatarUrl' | 'email'>; user: Pick<
User,
'id' | 'firstName' | 'lastName' | 'displayName' | 'avatarUrl' | 'email'
>;
}; };
accessory?: React.ReactNode; accessory?: React.ReactNode;
}; };
@ -42,16 +44,14 @@ export function WorkspaceMemberCard({ workspaceMember, accessory }: OwnProps) {
return ( return (
<StyledContainer> <StyledContainer>
<Avatar <Avatar
avatarUrl={getImageAbsoluteURIOrBase64(workspaceMember.user.avatarUrl)} avatarUrl={workspaceMember.user.avatarUrl}
colorId={workspaceMember.user.id} colorId={workspaceMember.user.id}
placeholder={workspaceMember.user.firstName || ''} placeholder={workspaceMember.user.firstName || ''}
type="squared" type="squared"
size={40} size={40}
/> />
<Content> <Content>
<NameText> <NameText>{workspaceMember.user.displayName}</NameText>
{workspaceMember.user.firstName} {workspaceMember.user.lastName}{' '}
</NameText>
<EmailText>{workspaceMember.user.email}</EmailText> <EmailText>{workspaceMember.user.email}</EmailText>
</Content> </Content>

View File

@ -10,6 +10,7 @@ export const GET_WORKSPACE_MEMBERS = gql`
avatarUrl avatarUrl
firstName firstName
lastName lastName
displayName
} }
} }
} }

View File

@ -19,7 +19,7 @@ export const UPDATE_WORKSPACE_LOGO = gql`
export const REMOVE_WORKSPACE_LOGO = gql` export const REMOVE_WORKSPACE_LOGO = gql`
mutation RemoveWorkspaceLogo { mutation RemoveWorkspaceLogo {
updateWorkspace(data: { logo: { set: null } }) { updateWorkspace(data: { logo: null }) {
id id
} }
} }

View File

@ -98,12 +98,8 @@ export function CreateProfile() {
id: currentUser?.id, id: currentUser?.id,
}, },
data: { data: {
firstName: { firstName: data.firstName,
set: data.firstName, lastName: data.lastName,
},
lastName: {
set: data.lastName,
},
}, },
}, },
refetchQueries: [getOperationName(GET_CURRENT_USER) ?? ''], refetchQueries: [getOperationName(GET_CURRENT_USER) ?? ''],

View File

@ -73,9 +73,7 @@ export function CreateWorkspace() {
const result = await updateWorkspace({ const result = await updateWorkspace({
variables: { variables: {
data: { data: {
displayName: { displayName: data.name,
set: data.name,
},
}, },
}, },
refetchQueries: [getOperationName(GET_CURRENT_USER) ?? ''], refetchQueries: [getOperationName(GET_CURRENT_USER) ?? ''],

View File

@ -1,7 +1,6 @@
import { getOperationName } from '@apollo/client/utilities'; import { getOperationName } from '@apollo/client/utilities';
import { useTheme } from '@emotion/react'; import { useTheme } from '@emotion/react';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { v4 as uuidv4 } from 'uuid';
import { GET_COMPANIES } from '@/companies/queries'; import { GET_COMPANIES } from '@/companies/queries';
import { CompanyTable } from '@/companies/table/components/CompanyTable'; import { CompanyTable } from '@/companies/table/components/CompanyTable';
@ -12,10 +11,7 @@ import { WithTopBarContainer } from '@/ui/layout/components/WithTopBarContainer'
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope'; import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
import { EntityTableActionBar } from '@/ui/table/action-bar/components/EntityTableActionBar'; import { EntityTableActionBar } from '@/ui/table/action-bar/components/EntityTableActionBar';
import { TableContext } from '@/ui/table/states/TableContext'; import { TableContext } from '@/ui/table/states/TableContext';
import { import { useInsertOneCompanyMutation } from '~/generated/graphql';
InsertCompanyMutationVariables,
useInsertCompanyMutation,
} from '~/generated/graphql';
import { SEARCH_COMPANY_QUERY } from '../../modules/search/queries/search'; import { SEARCH_COMPANY_QUERY } from '../../modules/search/queries/search';
@ -25,20 +21,17 @@ const StyledTableContainer = styled.div`
`; `;
export function Companies() { export function Companies() {
const [insertCompany] = useInsertCompanyMutation(); const [insertCompany] = useInsertOneCompanyMutation();
async function handleAddButtonClick() { async function handleAddButtonClick() {
const newCompany: InsertCompanyMutationVariables = {
id: uuidv4(),
name: '',
domainName: '',
employees: null,
address: '',
createdAt: new Date().toISOString(),
};
await insertCompany({ await insertCompany({
variables: newCompany, variables: {
data: {
name: '',
domainName: '',
address: '',
},
},
refetchQueries: [ refetchQueries: [
getOperationName(GET_COMPANIES) ?? '', getOperationName(GET_COMPANIES) ?? '',
getOperationName(SEARCH_COMPANY_QUERY) ?? '', getOperationName(SEARCH_COMPANY_QUERY) ?? '',

View File

@ -1,7 +1,6 @@
import { getOperationName } from '@apollo/client/utilities'; import { getOperationName } from '@apollo/client/utilities';
import { useTheme } from '@emotion/react'; import { useTheme } from '@emotion/react';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { v4 as uuidv4 } from 'uuid';
import { GET_PEOPLE } from '@/people/queries'; import { GET_PEOPLE } from '@/people/queries';
import { PeopleTable } from '@/people/table/components/PeopleTable'; import { PeopleTable } from '@/people/table/components/PeopleTable';
@ -12,7 +11,7 @@ import { WithTopBarContainer } from '@/ui/layout/components/WithTopBarContainer'
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope'; import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
import { EntityTableActionBar } from '@/ui/table/action-bar/components/EntityTableActionBar'; import { EntityTableActionBar } from '@/ui/table/action-bar/components/EntityTableActionBar';
import { TableContext } from '@/ui/table/states/TableContext'; import { TableContext } from '@/ui/table/states/TableContext';
import { useInsertPersonMutation } from '~/generated/graphql'; import { useInsertOnePersonMutation } from '~/generated/graphql';
const StyledTableContainer = styled.div` const StyledTableContainer = styled.div`
display: flex; display: flex;
@ -20,18 +19,12 @@ const StyledTableContainer = styled.div`
`; `;
export function People() { export function People() {
const [insertPersonMutation] = useInsertPersonMutation(); const [insertOnePerson] = useInsertOnePersonMutation();
async function handleAddButtonClick() { async function handleAddButtonClick() {
await insertPersonMutation({ await insertOnePerson({
variables: { variables: {
id: uuidv4(), data: {},
firstName: '',
lastName: '',
email: '',
phone: '',
createdAt: new Date().toISOString(),
city: '',
}, },
refetchQueries: [getOperationName(GET_PEOPLE) ?? ''], refetchQueries: [getOperationName(GET_PEOPLE) ?? ''],
}); });

View File

@ -4,7 +4,7 @@ import type { Meta } from '@storybook/react';
import { userEvent, within } from '@storybook/testing-library'; import { userEvent, within } from '@storybook/testing-library';
import { graphql } from 'msw'; import { graphql } from 'msw';
import { UPDATE_PERSON } from '@/people/queries'; import { UPDATE_ONE_PERSON } from '@/people/queries';
import { SEARCH_COMPANY_QUERY } from '@/search/queries/search'; import { SEARCH_COMPANY_QUERY } from '@/search/queries/search';
import { Company } from '~/generated/graphql'; import { Company } from '~/generated/graphql';
import { graphqlMocks } from '~/testing/graphqlMocks'; import { graphqlMocks } from '~/testing/graphqlMocks';
@ -113,7 +113,7 @@ const editRelationMocks = (
if ( if (
typeof graphqlMock.info.operationName === 'string' && typeof graphqlMock.info.operationName === 'string' &&
[ [
getOperationName(UPDATE_PERSON), getOperationName(UPDATE_ONE_PERSON),
getOperationName(SEARCH_COMPANY_QUERY), getOperationName(SEARCH_COMPANY_QUERY),
].includes(graphqlMock.info.operationName) ].includes(graphqlMock.info.operationName)
) { ) {
@ -122,23 +122,26 @@ const editRelationMocks = (
return true; return true;
}), }),
...[ ...[
graphql.mutation(getOperationName(UPDATE_PERSON) ?? '', (req, res, ctx) => { graphql.mutation(
return res( getOperationName(UPDATE_ONE_PERSON) ?? '',
ctx.data({ (req, res, ctx) => {
updateOnePerson: { return res(
...fetchOneFromData(mockedPeopleData, req.variables.id), ctx.data({
...{ updateOnePerson: {
company: { ...fetchOneFromData(mockedPeopleData, req.variables.where.id),
id: req.variables.companyId, ...{
name: updateSelectedCompany.name, company: {
domainName: updateSelectedCompany.domainName, id: req.variables.where.id,
__typename: 'Company', name: updateSelectedCompany.name,
domainName: updateSelectedCompany.domainName,
__typename: 'Company',
},
}, },
}, },
}, }),
}), );
); },
}), ),
graphql.query( graphql.query(
getOperationName(SEARCH_COMPANY_QUERY) ?? '', getOperationName(SEARCH_COMPANY_QUERY) ?? '',
(req, res, ctx) => { (req, res, ctx) => {

View File

@ -4,7 +4,7 @@ import { graphql } from 'msw';
import { CREATE_EVENT } from '@/analytics/queries'; import { CREATE_EVENT } from '@/analytics/queries';
import { GET_CLIENT_CONFIG } from '@/client-config/queries'; import { GET_CLIENT_CONFIG } from '@/client-config/queries';
import { GET_COMPANIES } from '@/companies/queries'; import { GET_COMPANIES } from '@/companies/queries';
import { GET_PEOPLE, GET_PERSON, UPDATE_PERSON } from '@/people/queries'; import { GET_PEOPLE, GET_PERSON, UPDATE_ONE_PERSON } from '@/people/queries';
import { GET_PIPELINE_PROGRESS, GET_PIPELINES } from '@/pipeline/queries'; import { GET_PIPELINE_PROGRESS, GET_PIPELINES } from '@/pipeline/queries';
import { import {
SEARCH_COMPANY_QUERY, SEARCH_COMPANY_QUERY,
@ -134,17 +134,20 @@ export const graphqlMocks = [
}), }),
); );
}), }),
graphql.mutation(getOperationName(UPDATE_PERSON) ?? '', (req, res, ctx) => { graphql.mutation(
return res( getOperationName(UPDATE_ONE_PERSON) ?? '',
ctx.data({ (req, res, ctx) => {
updateOnePerson: updateOneFromData( return res(
mockedPeopleData, ctx.data({
req.variables.id, updateOnePerson: updateOneFromData(
req.variables, mockedPeopleData,
), req.variables.where.id,
}), req.variables,
); ),
}), }),
);
},
),
graphql.query(getOperationName(GET_PIPELINES) ?? '', (req, res, ctx) => { graphql.query(getOperationName(GET_PIPELINES) ?? '', (req, res, ctx) => {
return res( return res(
ctx.data({ ctx.data({

View File

@ -22,6 +22,7 @@ type MockedCommentThread = Pick<
id: string; id: string;
firstName: string; firstName: string;
lastName: string; lastName: string;
displayName: string;
}; };
comments: Array<Pick<Comment, 'body'>>; comments: Array<Pick<Comment, 'body'>>;
commentThreadTargets: Array< commentThreadTargets: Array<
@ -50,6 +51,7 @@ export const mockedCommentThreads: Array<MockedCommentThread> = [
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e', id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
firstName: 'Charles', firstName: 'Charles',
lastName: 'Test', lastName: 'Test',
displayName: 'Charles Test',
}, },
authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e', authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
comments: [], comments: [],
@ -96,6 +98,7 @@ export const mockedCommentThreads: Array<MockedCommentThread> = [
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e', id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
firstName: 'Charles', firstName: 'Charles',
lastName: 'Test', lastName: 'Test',
displayName: 'Charles Test',
}, },
authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e', authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
comments: [], comments: [],

View File

@ -7,6 +7,8 @@ import {
UserOrderByWithRelationInput, UserOrderByWithRelationInput,
} from '~/generated/graphql'; } from '~/generated/graphql';
import { isDefined } from '../../utils/isDefined';
function filterData<DataT>( function filterData<DataT>(
data: Array<DataT>, data: Array<DataT>,
where: Record<string, any>, where: Record<string, any>,
@ -135,15 +137,28 @@ export function fetchOneFromData<DataT extends { id: string }>(
data: Array<DataT>, data: Array<DataT>,
id: string, id: string,
): DataT | undefined { ): DataT | undefined {
if (!isDefined(id)) {
throw new Error(
`id is not defined in updateOneFromData, check that you provided where.id if needed.`,
);
}
return data.filter((item) => item.id === id)[0]; return data.filter((item) => item.id === id)[0];
} }
export function updateOneFromData<DataT extends { id: string }>( export function updateOneFromData<DataT extends { id: string }>(
data: Array<DataT>, data: Array<DataT>,
id: string, id: string | undefined,
payload: GraphQLVariables, payload: GraphQLVariables,
): DataT | undefined { ): DataT | undefined {
if (!isDefined(id)) {
throw new Error(
`id is not defined in updateOneFromData, check that you provided where.id if needed.`,
);
}
const object = data.filter((item) => item.id === id)[0]; const object = data.filter((item) => item.id === id)[0];
const newObject = Object.assign(object, payload); const newObject = Object.assign(object, payload);
return newObject; return newObject;

View File

@ -1,22 +1,28 @@
import { Company, Person } from '~/generated/graphql'; import { Company, Person } from '~/generated/graphql';
type MockedPerson = Pick< type RequiredAndNotNull<T> = {
Person, [P in keyof T]-?: Exclude<T[P], null | undefined>;
| 'id'
| 'firstName'
| 'lastName'
| 'displayName'
| 'email'
| '__typename'
| 'phone'
| 'city'
| '_commentThreadCount'
| 'createdAt'
> & {
company: Pick<Company, 'id' | 'name' | 'domainName' | '__typename'>;
}; };
export const mockedPeopleData: Array<MockedPerson> = [ type MockedPerson = RequiredAndNotNull<
Pick<
Person,
| 'id'
| 'firstName'
| 'lastName'
| 'displayName'
| 'email'
| '__typename'
| 'phone'
| 'city'
| '_commentThreadCount'
| 'createdAt'
> & {
company: Pick<Company, 'id' | 'name' | 'domainName' | '__typename'>;
}
>;
export const mockedPeopleData: MockedPerson[] = [
{ {
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b', id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
__typename: 'Person', __typename: 'Person',

View File

@ -89,21 +89,6 @@ export class CompanyResolver {
@PrismaSelector({ modelName: 'Company' }) @PrismaSelector({ modelName: 'Company' })
prismaSelect: PrismaSelect<'Company'>, prismaSelect: PrismaSelect<'Company'>,
): Promise<Partial<Company> | null> { ): Promise<Partial<Company> | null> {
// TODO: Do a proper check with recursion testing on args in a more generic place
for (const key in args.data) {
if (args.data[key]) {
for (const subKey in args.data[key]) {
if (JSON.stringify(args.data[key][subKey]) === '{}') {
delete args.data[key][subKey];
}
}
}
if (JSON.stringify(args.data[key]) === '{}') {
delete args.data[key];
}
}
return this.companyService.update({ return this.companyService.update({
where: args.where, where: args.where,
data: args.data, data: args.data,

View File

@ -0,0 +1,6 @@
-- AlterTable
ALTER TABLE "people" ALTER COLUMN "email" DROP NOT NULL,
ALTER COLUMN "phone" DROP NOT NULL,
ALTER COLUMN "city" DROP NOT NULL,
ALTER COLUMN "firstName" DROP NOT NULL,
ALTER COLUMN "lastName" DROP NOT NULL;

View File

@ -9,8 +9,9 @@ datasource db {
} }
generator nestgraphql { generator nestgraphql {
provider = "node node_modules/prisma-nestjs-graphql" provider = "node node_modules/prisma-nestjs-graphql"
output = "../../src/core/@generated" output = "../../src/core/@generated"
noAtomicOperations = true
// field validator // field validator
fields_Validator_input = true fields_Validator_input = true
@ -47,11 +48,13 @@ generator nestgraphql {
decorate_count_arguments = "[]" decorate_count_arguments = "[]"
// create data validator // create data validator
decorate_classValidator_type = "@(Create|Update|Upsert)*Args" decorate_classValidator_type = "@(Create|Update|Upsert)*Args"
decorate_classValidator_field = "@(data|[A-Z]*)" decorate_classValidator_field = "@(data|[A-Z]*)"
decorate_classValidator_name = ValidateNested decorate_classValidator_name = ValidateNested
decorate_classValidator_from = "class-validator" decorate_classValidator_from = "class-validator"
decorate_classValidator_arguments = "['{each: true}']" decorate_classValidator_arguments = "['{each: true}']"
// create data transformer
decorate_classTransformer_type = "@(Create|Update|Upsert)*Args" decorate_classTransformer_type = "@(Create|Update|Upsert)*Args"
decorate_classTransformer_field = "@(data|[A-Z]*)" decorate_classTransformer_field = "@(data|[A-Z]*)"
decorate_classTransformer_from = "class-transformer" decorate_classTransformer_from = "class-transformer"
@ -70,6 +73,7 @@ model User {
/// @Validator.IsOptional() /// @Validator.IsOptional()
lastName String? lastName String?
/// @Validator.IsEmail() /// @Validator.IsEmail()
/// @Validator.IsOptional()
email String @unique email String @unique
/// @Validator.IsBoolean() /// @Validator.IsBoolean()
/// @Validator.IsOptional() /// @Validator.IsOptional()
@ -78,6 +82,7 @@ model User {
/// @Validator.IsOptional() /// @Validator.IsOptional()
avatarUrl String? avatarUrl String?
/// @Validator.IsString() /// @Validator.IsString()
/// @Validator.IsOptional()
locale String locale String
/// @Validator.IsString() /// @Validator.IsString()
/// @Validator.IsOptional() /// @Validator.IsOptional()
@ -200,10 +205,13 @@ model Company {
/// @Validator.IsOptional() /// @Validator.IsOptional()
id String @id @default(uuid()) id String @id @default(uuid())
/// @Validator.IsString() /// @Validator.IsString()
/// @Validator.IsOptional()
name String name String
/// @Validator.IsString() /// @Validator.IsString()
/// @Validator.IsOptional()
domainName String domainName String
/// @Validator.IsString() /// @Validator.IsString()
/// @Validator.IsOptional()
address String address String
/// @Validator.IsNumber() /// @Validator.IsNumber()
/// @Validator.IsOptional() /// @Validator.IsOptional()
@ -229,31 +237,36 @@ model Company {
model Person { model Person {
/// @Validator.IsString() /// @Validator.IsString()
/// @Validator.IsOptional() /// @Validator.IsOptional()
id String @id @default(uuid()) id String @id @default(uuid())
/// @Validator.IsString() /// @Validator.IsString()
firstName String /// @Validator.IsOptional()
firstName String?
/// @Validator.IsString() /// @Validator.IsString()
lastName String /// @Validator.IsOptional()
lastName String?
/// @Validator.IsString() /// @Validator.IsString()
email String /// @Validator.IsOptional()
email String?
/// @Validator.IsString() /// @Validator.IsString()
phone String /// @Validator.IsOptional()
phone String?
/// @Validator.IsString() /// @Validator.IsString()
city String /// @Validator.IsOptional()
city String?
company Company? @relation(fields: [companyId], references: [id]) company Company? @relation(fields: [companyId], references: [id])
companyId String? companyId String?
/// @TypeGraphQL.omit(input: true, output: true) /// @TypeGraphQL.omit(input: true, output: true)
workspace Workspace @relation(fields: [workspaceId], references: [id]) workspace Workspace @relation(fields: [workspaceId], references: [id])
/// @TypeGraphQL.omit(input: true, output: true) /// @TypeGraphQL.omit(input: true, output: true)
workspaceId String workspaceId String
pipelineProgresses PipelineProgress[]
/// @TypeGraphQL.omit(input: true, output: true) /// @TypeGraphQL.omit(input: true, output: true)
deletedAt DateTime? deletedAt DateTime?
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
PipelineProgress PipelineProgress[]
@@map("people") @@map("people")
} }
@ -413,6 +426,7 @@ model PipelineStage {
index Int? index Int?
pipelineProgresses PipelineProgress[] pipelineProgresses PipelineProgress[]
///
pipeline Pipeline @relation(fields: [pipelineId], references: [id]) pipeline Pipeline @relation(fields: [pipelineId], references: [id])
pipelineId String pipelineId String
/// @TypeGraphQL.omit(input: true, output: true) /// @TypeGraphQL.omit(input: true, output: true)

View File

@ -17,6 +17,11 @@ const globalDefaultFields: DefaultFieldsMap = {
firstName: true, firstName: true,
lastName: true, lastName: true,
}, },
Person: {
// Needed for displayName resolve field
firstName: true,
lastName: true,
},
}; };
export const PrismaSelector = createParamDecorator( export const PrismaSelector = createParamDecorator(