snowballtools-base/packages/gql-client/src/mutations.ts
nabarun d486f44cfe
All checks were successful
Lint / lint (20.x) (push) Successful in 4m55s
Update UI to take environment variables from user (#6)
Part of [Service provider auctions for web deployments](https://www.notion.so/Service-provider-auctions-for-web-deployments-104a6b22d47280dbad51d28aa3a91d75)

- Take environment variables from the user in the `Configure` deployment step

Co-authored-by: Isha Venikar <ishavenikar@Ishas-MacBook-Air.local>
Co-authored-by: IshaVenikar <ishavenikar7@gmail.com>
Reviewed-on: #6
2024-10-21 11:05:35 +00:00

128 lines
3.4 KiB
TypeScript

import { gql } from "@apollo/client";
export const removeProjectMember = gql`
mutation ($projectMemberId: String!) {
removeProjectMember(projectMemberId: $projectMemberId)
}
`;
export const updateProjectMember = gql`
mutation ($projectMemberId: String!, $data: UpdateProjectMemberInput) {
updateProjectMember(projectMemberId: $projectMemberId, data: $data)
}
`;
export const addProjectMember = gql`
mutation ($projectId: String!, $data: AddProjectMemberInput) {
addProjectMember(projectId: $projectId, data: $data)
}
`;
export const addEnvironmentVariables = gql`
mutation ($projectId: String!, $data: [AddEnvironmentVariableInput!]) {
addEnvironmentVariables(projectId: $projectId, data: $data)
}
`;
export const updateEnvironmentVariable = gql`
mutation (
$environmentVariableId: String!
$data: UpdateEnvironmentVariableInput!
) {
updateEnvironmentVariable(
environmentVariableId: $environmentVariableId
data: $data
)
}
`;
export const removeEnvironmentVariable = gql`
mutation ($environmentVariableId: String!) {
removeEnvironmentVariable(environmentVariableId: $environmentVariableId)
}
`;
export const updateDeploymentToProd = gql`
mutation ($deploymentId: String!) {
updateDeploymentToProd(deploymentId: $deploymentId)
}
`;
export const addProjectFromTemplate = gql`
mutation ($organizationSlug: String!, $data: AddProjectFromTemplateInput, $lrn: String, $auctionParams: AuctionParams, $environmentVariables: [AddEnvironmentVariableInput!]) {
addProjectFromTemplate(organizationSlug: $organizationSlug, data: $data, lrn: $lrn, auctionParams: $auctionParams, environmentVariables: $environmentVariables) {
id
}
}
`;
export const addProject = gql`
mutation ($organizationSlug: String!, $data: AddProjectInput!, $lrn: String, $auctionParams: AuctionParams, $environmentVariables: [AddEnvironmentVariableInput!]) {
addProject(organizationSlug: $organizationSlug, data: $data, lrn: $lrn, auctionParams: $auctionParams, environmentVariables: $environmentVariables) {
id
}
}
`;
export const updateProjectMutation = gql`
mutation ($projectId: String!, $data: UpdateProjectInput) {
updateProject(projectId: $projectId, data: $data)
}
`;
export const updateDomainMutation = gql`
mutation ($domainId: String!, $data: UpdateDomainInput!) {
updateDomain(domainId: $domainId, data: $data)
}
`;
export const redeployToProd = gql`
mutation ($deploymentId: String!) {
redeployToProd(deploymentId: $deploymentId)
}
`;
export const deleteProject = gql`
mutation ($projectId: String!) {
deleteProject(projectId: $projectId)
}
`;
export const deleteDomain = gql`
mutation ($domainId: String!) {
deleteDomain(domainId: $domainId)
}
`;
export const rollbackDeployment = gql`
mutation ($projectId: String!, $deploymentId: String!) {
rollbackDeployment(projectId: $projectId, deploymentId: $deploymentId)
}
`;
export const deleteDeployment = gql`
mutation ($deploymentId: String!) {
deleteDeployment(deploymentId: $deploymentId)
}
`;
export const addDomain = gql`
mutation ($projectId: String!, $data: AddDomainInput!) {
addDomain(projectId: $projectId, data: $data)
}
`;
export const authenticateGitHub = gql`
mutation ($code: String!) {
authenticateGitHub(code: $code) {
token
}
}
`;
export const unauthenticateGitHub = gql`
mutation {
unauthenticateGitHub
}
`;