shurcooL/githubv4

Field 'bypassPullRequestActorIds' doesn't exist on type 'BranchProtectionRule'

jtyr opened this issue · 3 comments

jtyr commented

I'm getting an error:

{
 "errors": [
  {
   "path": [
    "query",
    "node",
    "... on BranchProtectionRule",
    "bypassPullRequestActorIds"
   ],
   "extensions": {
    "code": "undefinedField",
    "typeName": "BranchProtectionRule",
    "fieldName": "bypassPullRequestActorIds"
   },
   "locations": [
    {
     "line": 1,
     "column": 635
    }
   ],
   "message": "Field 'bypassPullRequestActorIds' doesn't exist on type 'BranchProtectionRule'"
  }
 ]
}

when trying to use updated API from your last commit requested via issue #97. I think that they have updated the API again and now there is bypassPullRequestAllowances instead of the bypassPullRequestActorIds as documented here.

Please could you re-generate your code again?

The generated code includes enums in enum.go, and convenience input structs in input.go. The field bypassForcePushActorIds was added to CreateBranchProtectionRuleInput and UpdateBranchProtectionRuleInput as mentioned in https://docs.github.com/en/graphql/overview/changelog#schema-changes-for-2022-01-04, which are included in commit 0707a5a.

The error you show means the query is doing something wrong, and it's not related to the generated code.

jtyr commented

The query seems to be this:

{
  "query": "query($id:ID!){node(id: $id){... on BranchProtectionRule{repository{id,name},pushAllowances(first: 100){nodes{actor{... on App{id,name},... on Team{id,name},... on User{id,name}}}},reviewDismissalAllowances(first: 100){nodes{actor{... on Team{id,name},... on User{id,name}}}},allowsDeletions,allowsForcePushes,dismissesStaleReviews,id,isAdminEnforced,pattern,requiredApprovingReviewCount,requiredStatusCheckContexts,requiresApprovingReviews,requiresCodeOwnerReviews,requiresCommitSignatures,requiresLinearHistory,requiresConversationResolution,requiresStatusChecks,requiresStrictStatusChecks,restrictsPushes,restrictsReviewDismissals,bypassPullRequestActorIds}}}",
  "variables": {
    "id": "BPR_kwDoGMmQuc3BZ8ZT"
  }
}

I don't understand GraphQL so I cannot say what's wrong there ;o( I just thought that the bypassPullRequestActorIds should be listed here and it isn't.

jtyr commented

Problem solved after giving me hint in my feature branch! ❤️