Moving queries into dedicated files (#1210)

* Moving queries into dedicated files

* fix ci
This commit is contained in:
Weiko
2023-08-14 19:31:20 -07:00
committed by GitHub
parent 656f1af15c
commit 24e5132029
149 changed files with 2908 additions and 3094 deletions

View File

@ -0,0 +1,21 @@
import { gql } from '@apollo/client';
export const CREATE_COMPANY_PIPELINE_PROGRESS = gql`
mutation CreateOneCompanyPipelineProgress(
$uuid: String!
$companyId: String!
$pipelineId: String!
$pipelineStageId: String!
) {
createOnePipelineProgress(
data: {
id: $uuid
company: { connect: { id: $companyId } }
pipeline: { connect: { id: $pipelineId } }
pipelineStage: { connect: { id: $pipelineStageId } }
}
) {
id
}
}
`;

View File

@ -0,0 +1,9 @@
import { gql } from '@apollo/client';
export const DELETE_PIPELINE_PROGRESS = gql`
mutation DeleteManyPipelineProgress($ids: [String!]) {
deleteManyPipelineProgress(where: { id: { in: $ids } }) {
count
}
}
`;

View File

@ -0,0 +1,18 @@
import { gql } from '@apollo/client';
export const UPDATE_PIPELINE_PROGRESS = gql`
mutation UpdateOnePipelineProgress(
$data: PipelineProgressUpdateInput!
$where: PipelineProgressWhereUniqueInput!
) {
updateOnePipelineProgress(where: $where, data: $data) {
id
amount
closeDate
probability
pointOfContact {
id
}
}
}
`;

View File

@ -0,0 +1,15 @@
import { gql } from '@apollo/client';
export const UPDATE_PIPELINE_PROGRESS_STAGE = gql`
mutation UpdateOnePipelineProgressStage(
$id: String
$pipelineStageId: String
) {
updateOnePipelineProgress(
where: { id: $id }
data: { pipelineStage: { connect: { id: $pipelineStageId } } }
) {
id
}
}
`;

View File

@ -0,0 +1,11 @@
import { gql } from '@apollo/client';
export const UPDATE_PIPELINE_STAGE = gql`
mutation UpdatePipelineStage($id: String, $data: PipelineStageUpdateInput!) {
updateOnePipelineStage(where: { id: $id }, data: $data) {
id
name
color
}
}
`;

View File

@ -0,0 +1,26 @@
import { gql } from '@apollo/client';
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
}
}
`;

View File

@ -0,0 +1,17 @@
import { gql } from '@apollo/client';
export const GET_PIPELINES = gql`
query GetPipelines($where: PipelineWhereInput) {
findManyPipeline(where: $where) {
id
name
pipelineProgressableType
pipelineStages {
id
name
color
index
}
}
}
`;

View File

@ -1,2 +0,0 @@
export * from './select';
export * from './update';

View File

@ -1,57 +0,0 @@
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,
},
];

View File

@ -1,70 +0,0 @@
import { gql } from '@apollo/client';
export const DELETE_PIPELINE_PROGRESS = gql`
mutation DeleteManyPipelineProgress($ids: [String!]) {
deleteManyPipelineProgress(where: { id: { in: $ids } }) {
count
}
}
`;
export const UPDATE_PIPELINE_STAGE = gql`
mutation UpdatePipelineStage($id: String, $data: PipelineStageUpdateInput!) {
updateOnePipelineStage(where: { id: $id }, data: $data) {
id
name
color
}
}
`;
export const UPDATE_PIPELINE_PROGRESS = gql`
mutation UpdateOnePipelineProgress(
$data: PipelineProgressUpdateInput!
$where: PipelineProgressWhereUniqueInput!
) {
updateOnePipelineProgress(where: $where, data: $data) {
id
amount
closeDate
probability
pointOfContact {
id
}
}
}
`;
export const UPDATE_PIPELINE_PROGRESS_STAGE = gql`
mutation UpdateOnePipelineProgressStage(
$id: String
$pipelineStageId: String
) {
updateOnePipelineProgress(
where: { id: $id }
data: { pipelineStage: { connect: { id: $pipelineStageId } } }
) {
id
}
}
`;
export const CREATE_COMPANY_PIPELINE_PROGRESS = gql`
mutation CreateOneCompanyPipelineProgress(
$uuid: String!
$companyId: String!
$pipelineId: String!
$pipelineStageId: String!
) {
createOnePipelineProgress(
data: {
id: $uuid
company: { connect: { id: $companyId } }
pipeline: { connect: { id: $pipelineId } }
pipelineStage: { connect: { id: $pipelineStageId } }
}
) {
id
}
}
`;