# Deployments

Documentação de referência para tipos de esquema GraphQL na categoria Implantações.

## approveDeployments - mutation

Approve all pending deployments under one or more environments.

### Input fields for `approveDeployments`

* `input` (ApproveDeploymentsInput!): 

### Return fields for `approveDeployments`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `deployments` ([Deployment!]): The affected deployments.

## ApproveDeploymentsInput - input object

Autogenerated input type of ApproveDeployments.

### Input fields for `ApproveDeploymentsInput`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `comment` (String): Optional comment for approving deployments.
* `environmentIds` ([ID!]!): The ids of environments to reject deployments.
* `workflowRunId` (ID!): The node ID of the workflow run containing the pending deployments.

## createDeployment - mutation

Creates a new deployment event.

### Input fields for `createDeployment`

* `input` (CreateDeploymentInput!): 

### Return fields for `createDeployment`

* `autoMerged` (Boolean): True if the default branch has been auto-merged into the deployment ref.
* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `deployment` (Deployment): The new deployment.

## CreateDeploymentInput - input object

Autogenerated input type of CreateDeployment.

### Input fields for `CreateDeploymentInput`

* `autoMerge` (Boolean): Attempt to automatically merge the default branch into the requested ref, defaults to true.
* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `description` (String): Short description of the deployment.
* `environment` (String): Name for the target deployment environment.
* `payload` (String): JSON payload with extra information about the deployment.
* `refId` (ID!): The node ID of the ref to be deployed.
* `repositoryId` (ID!): The node ID of the repository.
* `requiredContexts` ([String!]): The status contexts to verify against commit status checks. To bypass required
contexts, pass an empty array. Defaults to all unique contexts.
* `task` (String): Specifies a task to execute.

## createDeploymentStatus - mutation

Create a deployment status.

### Input fields for `createDeploymentStatus`

* `input` (CreateDeploymentStatusInput!): 

### Return fields for `createDeploymentStatus`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `deploymentStatus` (DeploymentStatus): The new deployment status.

## CreateDeploymentStatusInput - input object

Autogenerated input type of CreateDeploymentStatus.

### Input fields for `CreateDeploymentStatusInput`

* `autoInactive` (Boolean): Adds a new inactive status to all non-transient, non-production environment
deployments with the same repository and environment name as the created
status's deployment.
* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `deploymentId` (ID!): The node ID of the deployment.
* `description` (String): A short description of the status. Maximum length of 140 characters.
* `environment` (String): If provided, updates the environment of the deploy. Otherwise, does not modify the environment.
* `environmentUrl` (String): Sets the URL for accessing your environment.
* `logUrl` (String): The log URL to associate with this status.       This URL should contain
output to keep the user updated while the task is running       or serve as
historical information for what happened in the deployment.
* `state` (DeploymentStatusState!): The state of the deployment.

## createEnvironment - mutation

Creates an environment or simply returns it if already exists.

### Input fields for `createEnvironment`

* `input` (CreateEnvironmentInput!): 

### Return fields for `createEnvironment`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `environment` (Environment): The new or existing environment.

## CreateEnvironmentInput - input object

Autogenerated input type of CreateEnvironment.

### Input fields for `CreateEnvironmentInput`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `name` (String!): The name of the environment.
* `repositoryId` (ID!): The node ID of the repository.

## deleteDeployment - mutation

Deletes a deployment.

### Input fields for `deleteDeployment`

* `input` (DeleteDeploymentInput!): 

### Return fields for `deleteDeployment`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.

## DeleteDeploymentInput - input object

Autogenerated input type of DeleteDeployment.

### Input fields for `DeleteDeploymentInput`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `id` (ID!): The Node ID of the deployment to be deleted.

## deleteEnvironment - mutation

Deletes an environment.

### Input fields for `deleteEnvironment`

* `input` (DeleteEnvironmentInput!): 

### Return fields for `deleteEnvironment`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.

## DeleteEnvironmentInput - input object

Autogenerated input type of DeleteEnvironment.

### Input fields for `DeleteEnvironmentInput`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `id` (ID!): The Node ID of the environment to be deleted.

## DeployedEvent - object

Represents adeployedevent on a given pull request.

**Implements:** Node

### Fields for `DeployedEvent`

* `actor` (Actor): Identifies the actor who performed the event.
* `createdAt` (DateTime!): Identifies the date and time when the object was created.
* `databaseId` (Int): Identifies the primary key from the database.
* `deployment` (Deployment!): The deployment associated with thedeployedevent.
* `id` (ID!): The Node ID of the DeployedEvent object.
* `pullRequest` (PullRequest!): PullRequest referenced by event.
* `ref` (Ref): The ref associated with thedeployedevent.

## Deployment - object

Represents triggered deployment instance.

**Implements:** Node

### Fields for `Deployment`

* `commit` (Commit): Identifies the commit sha of the deployment.
* `commitOid` (String!): Identifies the oid of the deployment commit, even if the commit has been deleted.
* `createdAt` (DateTime!): Identifies the date and time when the object was created.
* `creator` (Actor!): Identifies the actor who triggered the deployment.
* `databaseId` (Int): Identifies the primary key from the database.
* `description` (String): The deployment description.
* `environment` (String): The latest environment to which this deployment was made.
* `id` (ID!): The Node ID of the Deployment object.
* `latestEnvironment` (String): The latest environment to which this deployment was made.
* `latestStatus` (DeploymentStatus): The latest status of this deployment.
* `originalEnvironment` (String): The original environment to which this deployment was made.
* `payload` (String): Extra information that a deployment system might need.
* `ref` (Ref): Identifies the Ref of the deployment, if the deployment was created by ref.
* `repository` (Repository!): Identifies the repository associated with the deployment.
* `state` (DeploymentState): The current state of the deployment.
* `statuses` (DeploymentStatusConnection): A list of statuses associated with the deployment. _(Pagination: `after`, `before`, `first`, `last`)_
* `task` (String): The deployment task.
* `updatedAt` (DateTime!): Identifies the date and time when the object was last updated.

## DeploymentConnection - object

The connection type for Deployment.

### Fields for `DeploymentConnection`

* `edges` ([DeploymentEdge]): A list of edges.
* `nodes` ([Deployment]): A list of nodes.
* `pageInfo` (PageInfo!): Information to aid in pagination.
* `totalCount` (Int!): Identifies the total count of items in the connection.

## DeploymentEdge - object

An edge in a connection.

### Fields for `DeploymentEdge`

* `cursor` (String!): A cursor for use in pagination.
* `node` (Deployment): The item at the end of the edge.

## DeploymentEnvironmentChangedEvent - object

Represents adeployment_environment_changedevent on a given pull request.

**Implements:** Node

### Fields for `DeploymentEnvironmentChangedEvent`

* `actor` (Actor): Identifies the actor who performed the event.
* `createdAt` (DateTime!): Identifies the date and time when the object was created.
* `deploymentStatus` (DeploymentStatus!): The deployment status that updated the deployment environment.
* `id` (ID!): The Node ID of the DeploymentEnvironmentChangedEvent object.
* `pullRequest` (PullRequest!): PullRequest referenced by event.

## DeploymentOrder - input object

Ordering options for deployment connections.

### Input fields for `DeploymentOrder`

* `direction` (OrderDirection!): The ordering direction.
* `field` (DeploymentOrderField!): The field to order deployments by.

## DeploymentOrderField - enum

Properties by which deployment connections can be ordered.

### Values for `DeploymentOrderField`

* `CREATED_AT`: Order collection by creation time.

## DeploymentProtectionRule - object

A protection rule.

### Fields for `DeploymentProtectionRule`

* `databaseId` (Int): Identifies the primary key from the database.
* `preventSelfReview` (Boolean): Whether deployments to this environment can be approved by the user who created the deployment.
* `reviewers` (DeploymentReviewerConnection!): The teams or users that can review the deployment. _(Pagination: `after`, `before`, `first`, `last`)_
* `timeout` (Int!): The timeout in minutes for this protection rule.
* `type` (DeploymentProtectionRuleType!): The type of protection rule.

## DeploymentProtectionRuleConnection - object

The connection type for DeploymentProtectionRule.

### Fields for `DeploymentProtectionRuleConnection`

* `edges` ([DeploymentProtectionRuleEdge]): A list of edges.
* `nodes` ([DeploymentProtectionRule]): A list of nodes.
* `pageInfo` (PageInfo!): Information to aid in pagination.
* `totalCount` (Int!): Identifies the total count of items in the connection.

## DeploymentProtectionRuleEdge - object

An edge in a connection.

### Fields for `DeploymentProtectionRuleEdge`

* `cursor` (String!): A cursor for use in pagination.
* `node` (DeploymentProtectionRule): The item at the end of the edge.

## DeploymentProtectionRuleType - enum

The possible protection rule types.

### Values for `DeploymentProtectionRuleType`

* `BRANCH_POLICY`: Branch policy.
* `REQUIRED_REVIEWERS`: Required reviewers.
* `WAIT_TIMER`: Wait timer.

## DeploymentRequest - object

A request to deploy a workflow run to an environment.

### Fields for `DeploymentRequest`

* `currentUserCanApprove` (Boolean!): Whether or not the current user can approve the deployment.
* `environment` (Environment!): The target environment of the deployment.
* `reviewers` (DeploymentReviewerConnection!): The teams or users that can review the deployment. _(Pagination: `after`, `before`, `first`, `last`)_
* `waitTimer` (Int!): The wait timer in minutes configured in the environment.
* `waitTimerStartedAt` (DateTime): The wait timer in minutes configured in the environment.

## DeploymentRequestConnection - object

The connection type for DeploymentRequest.

### Fields for `DeploymentRequestConnection`

* `edges` ([DeploymentRequestEdge]): A list of edges.
* `nodes` ([DeploymentRequest]): A list of nodes.
* `pageInfo` (PageInfo!): Information to aid in pagination.
* `totalCount` (Int!): Identifies the total count of items in the connection.

## DeploymentRequestEdge - object

An edge in a connection.

### Fields for `DeploymentRequestEdge`

* `cursor` (String!): A cursor for use in pagination.
* `node` (DeploymentRequest): The item at the end of the edge.

## DeploymentReview - object

A deployment review.

**Implements:** Node

### Fields for `DeploymentReview`

* `comment` (String!): The comment the user left.
* `databaseId` (Int): Identifies the primary key from the database.
* `environments` (EnvironmentConnection!): The environments approved or rejected. _(Pagination: `after`, `before`, `first`, `last`)_
* `id` (ID!): The Node ID of the DeploymentReview object.
* `state` (DeploymentReviewState!): The decision of the user.
* `user` (User!): The user that reviewed the deployment.

## DeploymentReviewConnection - object

The connection type for DeploymentReview.

### Fields for `DeploymentReviewConnection`

* `edges` ([DeploymentReviewEdge]): A list of edges.
* `nodes` ([DeploymentReview]): A list of nodes.
* `pageInfo` (PageInfo!): Information to aid in pagination.
* `totalCount` (Int!): Identifies the total count of items in the connection.

## DeploymentReviewEdge - object

An edge in a connection.

### Fields for `DeploymentReviewEdge`

* `cursor` (String!): A cursor for use in pagination.
* `node` (DeploymentReview): The item at the end of the edge.

## DeploymentReviewer - union

Users and teams.

### Possible types for `DeploymentReviewer`

* Team
* User

## DeploymentReviewerConnection - object

The connection type for DeploymentReviewer.

### Fields for `DeploymentReviewerConnection`

* `edges` ([DeploymentReviewerEdge]): A list of edges.
* `nodes` ([DeploymentReviewer]): A list of nodes.
* `pageInfo` (PageInfo!): Information to aid in pagination.
* `totalCount` (Int!): Identifies the total count of items in the connection.

## DeploymentReviewerEdge - object

An edge in a connection.

### Fields for `DeploymentReviewerEdge`

* `cursor` (String!): A cursor for use in pagination.
* `node` (DeploymentReviewer): The item at the end of the edge.

## DeploymentReviewState - enum

The possible states for a deployment review.

### Values for `DeploymentReviewState`

* `APPROVED`: The deployment was approved.
* `REJECTED`: The deployment was rejected.

## DeploymentState - enum

The possible states in which a deployment can be.

### Values for `DeploymentState`

* `ABANDONED`: The pending deployment was not updated after 30 minutes.
* `ACTIVE`: The deployment is currently active.
* `DESTROYED`: An inactive transient deployment.
* `ERROR`: The deployment experienced an error.
* `FAILURE`: The deployment has failed.
* `INACTIVE`: The deployment is inactive.
* `IN_PROGRESS`: The deployment is in progress.
* `PENDING`: The deployment is pending.
* `QUEUED`: The deployment has queued.
* `SUCCESS`: The deployment was successful.
* `WAITING`: The deployment is waiting.

## DeploymentStatus - object

Describes the status of a given deployment attempt.

**Implements:** Node

### Fields for `DeploymentStatus`

* `createdAt` (DateTime!): Identifies the date and time when the object was created.
* `creator` (Actor!): Identifies the actor who triggered the deployment.
* `deployment` (Deployment!): Identifies the deployment associated with status.
* `description` (String): Identifies the description of the deployment.
* `environment` (String): Identifies the environment of the deployment at the time of this deployment status.
* `environmentUrl` (URI): Identifies the environment URL of the deployment.
* `id` (ID!): The Node ID of the DeploymentStatus object.
* `logUrl` (URI): Identifies the log URL of the deployment.
* `state` (DeploymentStatusState!): Identifies the current state of the deployment.
* `updatedAt` (DateTime!): Identifies the date and time when the object was last updated.

## DeploymentStatusConnection - object

The connection type for DeploymentStatus.

### Fields for `DeploymentStatusConnection`

* `edges` ([DeploymentStatusEdge]): A list of edges.
* `nodes` ([DeploymentStatus]): A list of nodes.
* `pageInfo` (PageInfo!): Information to aid in pagination.
* `totalCount` (Int!): Identifies the total count of items in the connection.

## DeploymentStatusEdge - object

An edge in a connection.

### Fields for `DeploymentStatusEdge`

* `cursor` (String!): A cursor for use in pagination.
* `node` (DeploymentStatus): The item at the end of the edge.

## DeploymentStatusState - enum

The possible states for a deployment status.

### Values for `DeploymentStatusState`

* `ERROR`: The deployment experienced an error.
* `FAILURE`: The deployment has failed.
* `INACTIVE`: The deployment is inactive.
* `IN_PROGRESS`: The deployment is in progress.
* `PENDING`: The deployment is pending.
* `QUEUED`: The deployment is queued.
* `SUCCESS`: The deployment was successful.
* `WAITING`: The deployment is waiting.

## Environment - object

An environment.

**Implements:** Node

### Fields for `Environment`

* `databaseId` (Int): Identifies the primary key from the database.
* `id` (ID!): The Node ID of the Environment object.
* `isPinned` (Boolean): Indicates whether or not this environment is currently pinned to the repository.
* `latestCompletedDeployment` (Deployment): The latest completed deployment with status success, failure, or error if it exists.
* `name` (String!): The name of the environment.
* `pinnedPosition` (Int): The position of the environment if it is pinned, null if it is not pinned.
* `protectionRules` (DeploymentProtectionRuleConnection!): The protection rules defined for this environment. _(Pagination: `after`, `before`, `first`, `last`)_

## EnvironmentConnection - object

The connection type for Environment.

### Fields for `EnvironmentConnection`

* `edges` ([EnvironmentEdge]): A list of edges.
* `nodes` ([Environment]): A list of nodes.
* `pageInfo` (PageInfo!): Information to aid in pagination.
* `totalCount` (Int!): Identifies the total count of items in the connection.

## EnvironmentEdge - object

An edge in a connection.

### Fields for `EnvironmentEdge`

* `cursor` (String!): A cursor for use in pagination.
* `node` (Environment): The item at the end of the edge.

## EnvironmentOrderField - enum

Properties by which environments connections can be ordered.

### Values for `EnvironmentOrderField`

* `NAME`: Order environments by name.

## EnvironmentPinnedFilterField - enum

Properties by which environments connections can be ordered.

### Values for `EnvironmentPinnedFilterField`

* `ALL`: All environments will be returned.
* `NONE`: Environments exclude pinned will be returned.
* `ONLY`: Only pinned environment will be returned.

## Environments - input object

Ordering options for environments.

### Input fields for `Environments`

* `direction` (OrderDirection!): The direction in which to order environments by the specified field.
* `field` (EnvironmentOrderField!): The field to order environments by.

## pinEnvironment - mutation

Pin an environment to a repository.

### Input fields for `pinEnvironment`

* `input` (PinEnvironmentInput!): 

### Return fields for `pinEnvironment`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `environment` (Environment): The environment that was pinned.
* `pinnedEnvironment` (PinnedEnvironment): The pinned environment if we pinned.

## PinEnvironmentInput - input object

Autogenerated input type of PinEnvironment.

### Input fields for `PinEnvironmentInput`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `environmentId` (ID!): The ID of the environment to modify.
* `pinned` (Boolean!): The desired state of the environment. If true, environment will be pinned. If false, it will be unpinned.

## PinnedEnvironment - object

Represents a pinned environment on a given repository.

**Implements:** Node

### Fields for `PinnedEnvironment`

* `createdAt` (DateTime!): Identifies the date and time when the pinned environment was created.
* `databaseId` (Int): Identifies the primary key from the database.
* `environment` (Environment!): Identifies the environment associated.
* `id` (ID!): The Node ID of the PinnedEnvironment object.
* `position` (Int!): Identifies the position of the pinned environment.
* `repository` (Repository!): The repository that this environment was pinned to.

## PinnedEnvironmentConnection - object

The connection type for PinnedEnvironment.

### Fields for `PinnedEnvironmentConnection`

* `edges` ([PinnedEnvironmentEdge]): A list of edges.
* `nodes` ([PinnedEnvironment]): A list of nodes.
* `pageInfo` (PageInfo!): Information to aid in pagination.
* `totalCount` (Int!): Identifies the total count of items in the connection.

## PinnedEnvironmentEdge - object

An edge in a connection.

### Fields for `PinnedEnvironmentEdge`

* `cursor` (String!): A cursor for use in pagination.
* `node` (PinnedEnvironment): The item at the end of the edge.

## PinnedEnvironmentOrder - input object

Ordering options for pinned environments.

### Input fields for `PinnedEnvironmentOrder`

* `direction` (OrderDirection!): The direction in which to order pinned environments by the specified field.
* `field` (PinnedEnvironmentOrderField!): The field to order pinned environments by.

## PinnedEnvironmentOrderField - enum

Properties by which pinned environments connections can be ordered.

### Values for `PinnedEnvironmentOrderField`

* `POSITION`: Order pinned environments by position.

## rejectDeployments - mutation

Reject all pending deployments under one or more environments.

### Input fields for `rejectDeployments`

* `input` (RejectDeploymentsInput!): 

### Return fields for `rejectDeployments`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `deployments` ([Deployment!]): The affected deployments.

## RejectDeploymentsInput - input object

Autogenerated input type of RejectDeployments.

### Input fields for `RejectDeploymentsInput`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `comment` (String): Optional comment for rejecting deployments.
* `environmentIds` ([ID!]!): The ids of environments to reject deployments.
* `workflowRunId` (ID!): The node ID of the workflow run containing the pending deployments.

## reorderEnvironment - mutation

Reorder a pinned repository environment.

### Input fields for `reorderEnvironment`

* `input` (ReorderEnvironmentInput!): 

### Return fields for `reorderEnvironment`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `environment` (Environment): The environment that was reordered.

## ReorderEnvironmentInput - input object

Autogenerated input type of ReorderEnvironment.

### Input fields for `ReorderEnvironmentInput`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `environmentId` (ID!): The ID of the environment to modify.
* `position` (Int!): The desired position of the environment.

## RequiredDeploymentsParameters - object

Choose which environments must be successfully deployed to before refs can be pushed into a ref that matches this rule.

### Fields for `RequiredDeploymentsParameters`

* `requiredDeploymentEnvironments` ([String!]!): The environments that must be successfully deployed to before branches can be merged.

## RequiredDeploymentsParametersInput - input object

Choose which environments must be successfully deployed to before refs can be pushed into a ref that matches this rule.

### Input fields for `RequiredDeploymentsParametersInput`

* `requiredDeploymentEnvironments` ([String!]!): The environments that must be successfully deployed to before branches can be merged.

## updateEnvironment - mutation

Updates an environment.

### Input fields for `updateEnvironment`

* `input` (UpdateEnvironmentInput!): 

### Return fields for `updateEnvironment`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `environment` (Environment): The updated environment.

## UpdateEnvironmentInput - input object

Autogenerated input type of UpdateEnvironment.

### Input fields for `UpdateEnvironmentInput`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `environmentId` (ID!): The node ID of the environment.
* `preventSelfReview` (Boolean): Whether deployments to this environment can be approved by the user who created the deployment.
* `reviewers` ([ID!]): The ids of users or teams that can approve deployments to this environment.
* `waitTimer` (Int): The wait timer in minutes.