InputObject 'UpdateRepositoryInput' doesn't accept argument 'deleteBranchOnMerge' #180819
-
Select Topic AreaQuestion BodyI am attempting to use the GraphQL API to update our repositories to all have the option "Automatically delete head branches" turned on with the following mutation: However, I get the error message This makes sense after I looked at the documentation for UpdateRepositoryInput So... how can I set that property using GraphQL? It is a legitimate property on the Repository object |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
You’re running into a limitation of the GitHub GraphQL schema, that error is actually telling you the whole story 🙂
To turn on “Automatically delete head branches” programmatically, you have to use the REST API instead of GraphQL. The setting is exposed there as Example with Or using GitHub CLI: So short answer: |
Beta Was this translation helpful? Give feedback.
You’re running into a limitation of the GitHub GraphQL schema, that error is actually telling you the whole story 🙂
deleteBranchOnMergeis a field on theRepositoryobject, but it’s not part ofUpdateRepositoryInput, so there’s currently no way to set it via theupdateRepositoryGraphQL mutation. In other words, in GraphQL it’s effectively read-only.To turn on “Automatically delete head branches” programmatically, you have to use the REST API instead of GraphQL. The setting is exposed there as
delete_branch_on_mergeon the repository update endpoint:Example with
curl: