MCPcopy
hub / github.com/PyGithub/PyGithub / graphql_named_mutation_class

Method graphql_named_mutation_class

github/Requester.py:840–857  ·  view source on GitHub ↗

Send a GraphQL mutation to the GraphQL API, populates and returns a PyGithub class instance. Uses :func:`graphql_named_mutation` to send the mutation to the GraphQL API. :param mutation_name: name of the mutation :param mutation_input: input data for the mutation

(
        self, mutation_name: str, mutation_input: dict[str, Any], output_schema: str, item: str, klass: type[T_gh]
    )

Source from the content-addressed store, hash-verified

838 return headers, data.get("data", {}).get(mutation_name, {})
839
840 def graphql_named_mutation_class(
841 self, mutation_name: str, mutation_input: dict[str, Any], output_schema: str, item: str, klass: type[T_gh]
842 ) -> T_gh:
843 """
844 Send a GraphQL mutation to the GraphQL API, populates and returns a PyGithub class instance.
845
846 Uses :func:`graphql_named_mutation` to send the mutation to the GraphQL API.
847
848 :param mutation_name: name of the mutation
849 :param mutation_input: input data for the mutation
850 :param output_schema: The schema of the retrieved properties of the mutation, without enclosing curly brackets
851 :param item: property in the response to extract the properties for the class to return
852 :return: PyGithub class instance
853 :raises: :class:`GithubException` for error status codes
854
855 """
856 headers, data = self.graphql_named_mutation(mutation_name, mutation_input, output_schema)
857 return self.data_as_class(headers, data, [item], klass)
858
859 def __check(
860 self,

Callers 4

add_commentMethod · 0.80
editMethod · 0.80
deleteMethod · 0.80
testMutationClassMethod · 0.80

Calls 2

data_as_classMethod · 0.95

Tested by

no test coverage detected