Replies: 3 comments 3 replies
-
I think I was able to confirm that At this point I suggest you reach out to support at https://support.github.com/contact, you can reference this issue. This might be a legit bug, and if not they will at least be able to explain the current behavior. As an alternative to your problem, you can use GraphQL const { view: { repositories: { nodes: repos } } } = await octokit.graphql(`{
viewer {
repositories(first: 100) {
nodes {
name
watchers(first: 1) {
totalCount
}
}
}
}
}`)
console.log(repos) The challenge here is that you can only get the first 100, after that you need to paginate the GraphQL query, which is a bit more complicated than with the REST API. I can give you some pointers if you need them |
Beta Was this translation helpful? Give feedback.
-
@gr2m I tried your example from 23 july last year and get an undefined. This is what I have, can you help: const graphqlAuth = graphql.defaults({headers: { authorization: 'token ' + process.env.ghtoken, },});});
const { repos } = await graphqlAuth(`{repositoryOwner(login: "tik9"){repositories(first: 2) {nodes {name watchers(first: 2) {totalCount}}}}}`)
console.log(repos) |
Beta Was this translation helpful? Give feedback.
-
your code is incorrect, you are destructing const { view: { repositories: { nodes: repos } } } = await ... |
Beta Was this translation helpful? Give feedback.
-
I want to get the repository watchers count without having to call the
listWatchersForRepo
method. I'm using thelistReposAccessibleToInstallation
to get all repositories and I was expecting to get the watchers count from thewatchers
orwatchers_count
field. However this value doesn't seem to be correct. I've also was trying to use thesubscribers_count
field but it isn't available. If I use the github API directly I can see the correct count insubscribers_count
.I'm using the following dependencies:
Beta Was this translation helpful? Give feedback.
All reactions