Files
twenty_crm/front/src/modules/pipeline/queries/select.ts
Emilien Chauvet 21e3d8fcac Refactor: Morph strategy on PipelineProgress (#1065)
* Deprecate pipelineprogress backref on person to improve naming

* Remove deprecated point of contact fields

* Add company and person entities on pipelineprogress

* Migrate data from old progressable to new entity fields

* Codegen frontend

* Use company Id, deprecate progressableId

* Get rid of deprecated progressableId field

* Remove deprecated progressableType field from pipeline progress

* Remove useless migrations
2023-08-03 09:08:35 -07:00

58 lines
1.2 KiB
TypeScript

import { gql } from '@apollo/client';
import { SelectedSortType } from '@/ui/filter-n-sort/types/interface';
import {
PipelineProgressOrderByWithRelationInput as PipelineProgresses_Order_By,
SortOrder as Order_By,
} from '~/generated/graphql';
export type PipelineProgressesSelectedSortType =
SelectedSortType<PipelineProgresses_Order_By>;
export const GET_PIPELINES = gql`
query GetPipelines($where: PipelineWhereInput) {
findManyPipeline(where: $where) {
id
name
pipelineProgressableType
pipelineStages {
id
name
color
index
}
}
}
`;
export const GET_PIPELINE_PROGRESS = gql`
query GetPipelineProgress(
$where: PipelineProgressWhereInput
$orderBy: [PipelineProgressOrderByWithRelationInput!]
) {
findManyPipelineProgress(where: $where, orderBy: $orderBy) {
id
pipelineStageId
companyId
personId
amount
closeDate
pointOfContactId
pointOfContact {
id
firstName
lastName
displayName
avatarUrl
}
probability
}
}
`;
export const defaultPipelineProgressOrderBy: PipelineProgresses_Order_By[] = [
{
createdAt: Order_By.Asc,
},
];