Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jtyr opened this issue Jan 10, 2022 · 3 comments
Closed

Comments

@jtyr
Copy link

jtyr commented Jan 10, 2022

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?

@dmitshur
Copy link
Member

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
Copy link
Author

jtyr commented Jan 10, 2022

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
Copy link
Author

jtyr commented Jan 11, 2022

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

@jtyr jtyr closed this as completed Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants