- Added github:init to allow full import, as opposed to gitHub:sync which allows partial sync and therefore respecting Github API Limit quota. --------- Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
22 lines
533 B
TypeScript
22 lines
533 B
TypeScript
import { graphql } from '@octokit/graphql';
|
|
|
|
import { Repository } from '@/github/contributors/types';
|
|
|
|
export async function fetchAssignableUsers(
|
|
query: typeof graphql,
|
|
): Promise<Set<string>> {
|
|
const { repository } = await query<Repository>(`
|
|
query {
|
|
repository(owner: "twentyhq", name: "twenty") {
|
|
assignableUsers(first: 100) {
|
|
nodes {
|
|
login
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`);
|
|
|
|
return new Set(repository.assignableUsers.nodes.map((user) => user.login));
|
|
}
|