forkEnvironment
Create a new environment by forking an existing one.
The new environment is linked to the parent via its parent field. Instances
are initialized from the project's components and seeded with the parent's
instance params. By default, secrets and remote references are not copied
— set copySecrets / copyRemoteReferences to fan the equivalent
copyInstance behavior across every package in one call. Pass
copyEnvironmentDefaults: true to also copy the parent's default resource
connections.
Each copied environment default and remote reference requires resource:view on
the resource and a resource grant that covers the new environment — the same checks
as setEnvironmentDefault and setRemoteReference. Copying secrets requires
instance:configure on each parent instance that has secrets. If any check fails,
the fork makes no changes.
Re-calling forkEnvironment with the same parent + id is a no-op that
returns the existing environment. Re-calling with the same id but a
different parentId is rejected — a fork's parent is immutable.
forkEnvironment(
organizationId: ID!
parentId: ID!
input: ForkEnvironmentInput!
): EnvironmentPayload
Form Schema
This mutation supports dynamic form generation using JSON Schema.
Loading schema...
Arguments
forkEnvironment.organizationId ● ID! non-null scalar {#organization-id}
Your organization's unique identifier.
forkEnvironment.parentId ● ID! non-null scalar {#parent-id}
The identifier of the environment to fork from.
forkEnvironment.input ● ForkEnvironmentInput! non-null input {#input}
Create or update a fork of an existing environment.