MCPcopy
hub / github.com/PyGithub/PyGithub / convert_to_draft

Method convert_to_draft

github/PullRequest.py:1011–1034  ·  view source on GitHub ↗

:calls: `POST /graphql `_ to convert pull request to draft

(
        self,
        client_mutation_id: Opt[str] = NotSet,
    )

Source from the content-addressed store, hash-verified

1009 return status == 202
1010
1011 def convert_to_draft(
1012 self,
1013 client_mutation_id: Opt[str] = NotSet,
1014 ) -> dict[str, Any]:
1015 """
1016 :calls: `POST /graphql <https://docs.github.com/en/graphql>`_ to convert pull request to draft
1017 <https://docs.github.com/en/graphql/reference/mutations#convertpullrequesttodraft>
1018 """
1019 assert is_optional(client_mutation_id, str), client_mutation_id
1020
1021 # Define the variables
1022 variables = {
1023 "pullRequestId": self.node_id,
1024 "clientMutationId": client_mutation_id,
1025 }
1026
1027 # Make the request
1028 _, data = self._requester.graphql_named_mutation(
1029 mutation_name="convertPullRequestToDraft",
1030 mutation_input=NotSet.remove_unset_items(variables),
1031 output_schema="clientMutationId pullRequest { isDraft }",
1032 )
1033 self._useAttributes({"draft": data["pullRequest"]["isDraft"]})
1034 return data
1035
1036 def mark_ready_for_review(
1037 self,

Callers 1

testConvertToDraftMethod · 0.80

Calls 4

_useAttributesMethod · 0.95
is_optionalFunction · 0.90
remove_unset_itemsMethod · 0.80

Tested by

no test coverage detected