-
In the past I was able to retrieve a GitHub repository's branch protection rules like so: op = Operation(schema.Query)
repo = op.repository(owner="myorg", name="myrepo")
repo.id()
repo.name()
repo.description()
repo.name_with_owner()
repo.branch_protection_rules(first=10)
data = gql.endpoint(op) ...where python3 -m sgqlc.introspection \
--exclude-deprecated \
--exclude-description \
-H "Authorization: bearer ${GITHUB_PAT}" \
https://api.github.com/graphql \
github_schema.json
sgqlc-codegen schema github_schema.json github_schema.py Recently, however, when I attempt to add BPRs to the repo query I get the following error: >>> repo.branch_protection_rules(first=10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/my/virtualenv/lib/python3.10/site-packages/sgqlc/operation/__init__.py", line 1811, in __call__
raise ValueError(
ValueError: branch_protection_rules already have a selection branchProtectionRules {
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
edges {
cursor
}
nodes {
id
allowsDeletions
allowsForcePushes
blocksCreations
databaseId
dismissesStaleReviews
isAdminEnforced
lockAllowsFetchAndMerge
lockBranch
pattern
requireLastPushApproval
requiredApprovingReviewCount
requiredStatusCheckContexts
requiresApprovingReviews
requiresCodeOwnerReviews
requiresCommitSignatures
requiresConversationResolution
requiresLinearHistory
requiresStatusChecks
requiresStrictStatusChecks
restrictsPushes
restrictsReviewDismissals
}
totalCount
}. Maybe use __alias__ as param? I'm using release 16.0 of Thoughts? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
EDIT :: Real answer is in the comment thread below. TL;DR: issue with CLI vs script. In true fashion, I was able to get it sorta working in my very next test... This fails:
But this works:
This also fails:
The
Would be interested in thoughts on how I should be doing these queries so that I don't have to create multiple operations. |
Beta Was this translation helpful? Give feedback.
EDIT :: Real answer is in the comment thread below. TL;DR: issue with CLI vs script.
In true fashion, I was able to get it sorta working in my very next test...
This fails:
But this works:
This also fails:
The
brps =
assignment works but the followingrepo =
assignment fails with:Would be interested in thoughts on h…