-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add new Discussions plugin #430
Conversation
Co-authored-by: Nixinova <nixinova@gmail.com>
do { | ||
console.debug(`metrics/compute/${login}/discussions > retrieving discussions after ${cursor}`) | ||
const {user:{repositoryDiscussions:{edges = [], nodes = []} = {}}} = await graphql(queries.discussions.categories({login, after:cursor ? `after: "${cursor}"` : ""})) | ||
cursor = edges?.[edges?.length - 1]?.cursor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super minor nitpick, but I think
edges?.[edges?.length - 1]
has a slightly redundant check. If edges == null
, the expression inside the brackets shouldn't be evaluated.
For example
const foo = void 0;
foo?.[foo.bar] // undefined, doesn't throw error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think you're right 🙂
Eventually I'd like to move to Array.at
with edges.at(-1)?.cursor
which seems cleaner, but I'm not sure that both node used version and vercel's one currently support it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Array#at was added to Node literally yesterday.
Can discussions be moved to be under followup? Thats a more natural position than at the end. |
Yes it would makes more sense. |
Add new discussion plugin to display how many discussion user has started, and how many comments and answers provided.
Also track most posted categories