API v3 doesn’t provide such features, as for v4, a possible query would be like:
{
repositoryOwner(login: "haeungun") {
repositories(first: 10, isFork: true, ownerAffiliations: [OWNER]) {
totalCount
pageInfo {
endCursor
hasNextPage
}
nodes {
isFork
name
owner {
login
}
parent {
owner {
login
}
name
}
}
}
}
}
But it’s still not efficient enough, the caller needs to go over all the results to check if the target repo is the parent of any repo.
So is there any solution to check if the account/org has forked a repo in one shot? Just like star, watch checks in API v3.