From a8d93732ced8e9d34b82453ccbf26cd3294c975f Mon Sep 17 00:00:00 2001 From: Eric Lewis Date: Wed, 27 Mar 2024 12:58:56 -0400 Subject: [PATCH] feat(gql-client): deployment removal request --- packages/gql-client/src/client.ts | 11 +++++++++++ packages/gql-client/src/mutations.ts | 6 ++++++ packages/gql-client/src/types.ts | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/packages/gql-client/src/client.ts b/packages/gql-client/src/client.ts index 74c7683e..f238869e 100644 --- a/packages/gql-client/src/client.ts +++ b/packages/gql-client/src/client.ts @@ -276,6 +276,17 @@ export class GQLClient { return data; } + async deleteDeployment (deploymentId: string): Promise { + const { data } = await this.client.mutate({ + mutation: mutations.deleteDeployment, + variables: { + deploymentId + } + }); + + return data; + } + async addDomain (projectId: string, data: types.AddDomainInput): Promise { const result = await this.client.mutate({ mutation: mutations.addDomain, diff --git a/packages/gql-client/src/mutations.ts b/packages/gql-client/src/mutations.ts index fd7a9c2e..be8d96d9 100644 --- a/packages/gql-client/src/mutations.ts +++ b/packages/gql-client/src/mutations.ts @@ -82,6 +82,12 @@ mutation ($projectId: String! ,$deploymentId: String!) { } `; +export const deleteDeployment = gql` +mutation ($deploymentId: String!) { + deleteDeployment(deploymentId: $deploymentId) +} +`; + export const addDomain = gql` mutation ($projectId: String!, $data: AddDomainInput!) { addDomain(projectId: $projectId, data: $data) diff --git a/packages/gql-client/src/types.ts b/packages/gql-client/src/types.ts index 71c44c00..786b7519 100644 --- a/packages/gql-client/src/types.ts +++ b/packages/gql-client/src/types.ts @@ -269,6 +269,10 @@ export type RollbackDeploymentResponse = { rollbackDeployment: boolean } +export type DeleteDeploymentResponse = { + deleteDeployment: boolean +} + export type AddDomainInput = { name: string }