diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b12a64..c8fd045 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,45 +1,29 @@ ## [0.3.5](https://github.com/EddieHubCommunity/good-first-issue-finder/compare/v0.3.4...v0.3.5) (2022-01-28) - ### Bug Fixes -* deployment ([#42](https://github.com/EddieHubCommunity/good-first-issue-finder/issues/42)) ([d2f28e8](https://github.com/EddieHubCommunity/good-first-issue-finder/commit/d2f28e8905b2607e56ad1c0bb5da8b168347257c)) - - +- deployment ([#42](https://github.com/EddieHubCommunity/good-first-issue-finder/issues/42)) ([d2f28e8](https://github.com/EddieHubCommunity/good-first-issue-finder/commit/d2f28e8905b2607e56ad1c0bb5da8b168347257c)) ## [0.3.4](https://github.com/EddieHubCommunity/good-first-issue-finder/compare/v0.3.3...v0.3.4) (2022-01-28) - ### Bug Fixes -* github token secret ([74501d5](https://github.com/EddieHubCommunity/good-first-issue-finder/commit/74501d5ed5fb9560267772e5b2754ece7983f9f5)) - - +- github token secret ([74501d5](https://github.com/EddieHubCommunity/good-first-issue-finder/commit/74501d5ed5fb9560267772e5b2754ece7983f9f5)) ## [0.3.3](https://github.com/EddieHubCommunity/good-first-issue-finder/compare/v0.3.2...v0.3.3) (2022-01-28) - ### Bug Fixes -* github token for sveltekit ([08468df](https://github.com/EddieHubCommunity/good-first-issue-finder/commit/08468dfcc16dafcd8e13ef5316f6636a1c773935)) - - +- github token for sveltekit ([08468df](https://github.com/EddieHubCommunity/good-first-issue-finder/commit/08468dfcc16dafcd8e13ef5316f6636a1c773935)) ## [0.3.2](https://github.com/EddieHubCommunity/good-first-issue-finder/compare/v0.3.1...v0.3.2) (2022-01-28) - ### Bug Fixes -* deployment port ([#39](https://github.com/EddieHubCommunity/good-first-issue-finder/issues/39)) ([043296a](https://github.com/EddieHubCommunity/good-first-issue-finder/commit/043296a9fea7c743d1ff437e8354dc4c4380666e)) - - +- deployment port ([#39](https://github.com/EddieHubCommunity/good-first-issue-finder/issues/39)) ([043296a](https://github.com/EddieHubCommunity/good-first-issue-finder/commit/043296a9fea7c743d1ff437e8354dc4c4380666e)) ## [0.3.1](https://github.com/EddieHubCommunity/good-first-issue-finder/compare/v0.3.0...v0.3.1) (2022-01-28) - ### Bug Fixes -* husky with docker file ([50c992a](https://github.com/EddieHubCommunity/good-first-issue-finder/commit/50c992a0f272a787063ecb72f9e404a51b46fec7)) - - - +- husky with docker file ([50c992a](https://github.com/EddieHubCommunity/good-first-issue-finder/commit/50c992a0f272a787063ecb72f9e404a51b46fec7)) diff --git a/package-lock.json b/package-lock.json index 1fb17ee..4b3c82a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "issue-finder", - "version": "0.3.4", + "version": "0.3.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "issue-finder", - "version": "0.3.4", + "version": "0.3.5", "dependencies": { "octokit": "^1.7.1" }, diff --git a/package.json b/package.json index 0b23220..2c8fc31 100644 --- a/package.json +++ b/package.json @@ -43,9 +43,9 @@ "octokit": "^1.7.1" }, "lint-staged": { - "*.{cjs,js,ts,css,scss,md,svelte}": [ + "*.{cjs,js,ts,css,scss,svelte}": [ "eslint --fix", "prettier --write --plugin-search-dir=. ." ] } -} \ No newline at end of file +} diff --git a/src/lib/components/issue-card.svelte b/src/lib/components/issue-card.svelte index a742de5..747519c 100644 --- a/src/lib/components/issue-card.svelte +++ b/src/lib/components/issue-card.svelte @@ -1,8 +1,8 @@ @@ -11,13 +11,13 @@ github {issue.title} - + open-in-gitpod diff --git a/src/lib/types/github.types.ts b/src/lib/types/github.types.ts index 3d0c6c5..9dfd116 100644 --- a/src/lib/types/github.types.ts +++ b/src/lib/types/github.types.ts @@ -1,80 +1,24 @@ -export type User = { +export type Owner = { login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; }; -export type Label = { - id: any; - node_id: string; - url: string; +export type Repository = { name: string; - color: string; - default: boolean; - description: string; -}; - -export type Reactions = { url: string; - total_count: number; - '+1': number; - '-1': number; - laugh: number; - hooray: number; - confused: number; - heart: number; - rocket: number; - eyes: number; + owner: Owner; }; -export type Item = { +export type Node = { url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - id: number; - node_id: string; - number: number; title: string; - user: User; - labels: Label[]; - state: string; - locked: boolean; - assignee?: any; - assignees: any[]; - milestone?: any; - comments: number; - created_at: Date; - updated_at: Date; - closed_at?: any; - author_association: string; - active_lock_reason?: any; - body: string; - reactions: Reactions; - timeline_url: string; - performed_via_github_app?: any; - score: number; + repository: Repository; +}; + +export type Edge = { + node: Node; }; -export type IssueResponse = { - total_count: number; - incomplete_results: boolean; - items: Item[]; +export type SearchResponse = { + issueCount: number; + edges: Edge[]; }; diff --git a/src/routes/api/get-issues.ts b/src/routes/api/get-issues.ts index df7359a..31ad411 100644 --- a/src/routes/api/get-issues.ts +++ b/src/routes/api/get-issues.ts @@ -5,11 +5,37 @@ export const get: RequestHandler = async () => { const token = process.env['VITE_TOKEN']; if (!token) return { status: 500, body: { message: 'please provide a token' } }; const octokit = new Octokit({ auth: token }); - const response = await octokit.request('GET /search/issues', { - q: 'is:issue is:open label:"good first issue" org:EddieHubCommunity no:assignee', - }); + const { search } = (await octokit.graphql( + `query EddieHubIssues($queryString: String! $skip: Int!) { + search(first: $skip, query: $queryString, type: ISSUE) { + issueCount + edges { + node { + ... on Issue { + url + title + repository { + name + url + owner { + login + } + } + } + } + } + } + }`, + { + queryString: 'is:open label:"good first issue" org:EddieHubCommunity no:assignee', + skip: 50, + }, + )) as any; + + console.log(JSON.stringify(search)); + return { status: 200, - body: response.data, + body: search, }; }; diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 59d72bf..d027351 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -8,7 +8,7 @@ const data = await res.json(); return { props: { - data: data as IssueResponse, + data: data as SearchResponse, }, }; } @@ -21,12 +21,12 @@
- {#each data.items as issue} - + {#each data.edges as node} + {/each}