Skip to content

GitHub Branch Protection Rules Mutation #212

Answered by barbieri
rgajason asked this question in Q&A
Discussion options

You must be logged in to vote

@rgajason The GitHub GraphQL API doesn't take repository argument, instead it takes an input argument with repository field, you can check that in their docs or in your own code snippet:

class Mutation(sgqlc.types.Type):
    ...
    create_branch_protection_rule = sgqlc.types.Field(
        CreateBranchProtectionRulePayload,
        graphql_name="createBranchProtectionRule",
        args=sgqlc.types.ArgDict(
            (
                (
                    "input",  # <-------------------- HERE
                    sgqlc.types.Arg(
                        sgqlc.types.non_null(CreateBranchProtectionRuleInput),
                        graphql_name="input",
                        default=N…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@barbieri
Comment options

@rgajason
Comment options

Answer selected by rgajason
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants