@@ -61,20 +61,6 @@ pub async fn edit_environment(args: Args) -> Result<()> {
6161 return Ok ( ( ) ) ;
6262 }
6363
64- // Stage changes with merge=true to combine with any existing staged changes
65- let stage_vars = mutations:: environment_stage_changes:: Variables {
66- environment_id : environment_id. clone ( ) ,
67- input : env_config,
68- merge : Some ( true ) ,
69- } ;
70-
71- post_graphql :: < mutations:: EnvironmentStageChanges , _ > (
72- & client,
73- configs. get_backboard ( ) ,
74- stage_vars,
75- )
76- . await ?;
77-
7864 // Determine whether to stage only or apply now
7965 // --stage flag means stage only, --message flag implies apply now
8066 let should_stage_only = if args. stage {
@@ -90,6 +76,20 @@ pub async fn edit_environment(args: Args) -> Result<()> {
9076 } ;
9177
9278 if should_stage_only {
79+ // Stage only: use environmentStageChanges with merge=true
80+ let stage_vars = mutations:: environment_stage_changes:: Variables {
81+ environment_id : environment_id. clone ( ) ,
82+ input : env_config,
83+ merge : Some ( true ) ,
84+ } ;
85+
86+ post_graphql :: < mutations:: EnvironmentStageChanges , _ > (
87+ & client,
88+ configs. get_backboard ( ) ,
89+ stage_vars,
90+ )
91+ . await ?;
92+
9393 if json {
9494 println ! (
9595 "{}" ,
@@ -116,14 +116,14 @@ pub async fn edit_environment(args: Args) -> Result<()> {
116116 . clone ( )
117117 . inspect ( |msg| fake_select ( "Commit message" , msg) ) ;
118118
119- // Commit the staged changes
120- let commit_vars = mutations:: environment_patch_commit_staged :: Variables {
119+ // Commit directly with patch (single mutation instead of stage + commit)
120+ let commit_vars = mutations:: environment_patch_commit :: Variables {
121121 environment_id : environment_id. clone ( ) ,
122+ patch : env_config,
122123 commit_message : commit_message. clone ( ) ,
123- skip_deploys : None ,
124124 } ;
125125
126- post_graphql :: < mutations:: EnvironmentPatchCommitStaged , _ > (
126+ post_graphql :: < mutations:: EnvironmentPatchCommit , _ > (
127127 & client,
128128 configs. get_backboard ( ) ,
129129 commit_vars,
0 commit comments