From 839f51511884bfef2d3402bcb1a9679cbbd40668 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Mon, 25 Aug 2025 15:13:19 +0530 Subject: [PATCH 01/25] upgrade apollo 3.14 -> 4 --- frontend/package.json | 3 +- frontend/pnpm-lock.yaml | 78 +++++++++++------------------------------ 2 files changed, 22 insertions(+), 59 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 04deec0a28..49d6a5063e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -15,7 +15,7 @@ "test:unit": "tsc --noEmit && NODE_OPTIONS='--experimental-vm-modules --no-warnings=DEP0040' jest" }, "dependencies": { - "@apollo/client": "^3.14.0", + "@apollo/client": "^4.0.0", "@fortawesome/fontawesome-svg-core": "^6.7.2", "@fortawesome/free-brands-svg-icons": "^6.7.2", "@fortawesome/free-regular-svg-icons": "^6.7.2", @@ -59,6 +59,7 @@ "react-dom": "^19.1.1", "react-icons": "^5.5.0", "react-router-dom": "^7.8.1", + "rxjs": "^7.8.2", "tailwind-merge": "^3.3.1", "tailwindcss-animate": "^1.0.7" }, diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 1e583949a4..578ecabbd8 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@apollo/client': - specifier: ^3.14.0 - version: 3.14.0(@types/react@19.1.10)(graphql@16.11.0)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + specifier: ^4.0.0 + version: 4.0.0(graphql@16.11.0)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(rxjs@7.8.2) '@fortawesome/fontawesome-svg-core': specifier: ^6.7.2 version: 6.7.2 @@ -140,6 +140,9 @@ importers: react-router-dom: specifier: ^7.8.1 version: 7.8.1(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + rxjs: + specifier: ^7.8.2 + version: 7.8.2 tailwind-merge: specifier: ^3.3.1 version: 3.3.1 @@ -296,13 +299,14 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@apollo/client@3.14.0': - resolution: {integrity: sha512-0YQKKRIxiMlIou+SekQqdCo0ZTHxOcES+K8vKB53cIDpwABNR0P0yRzPgsbgcj3zRJniD93S/ontsnZsCLZrxQ==} + '@apollo/client@4.0.0': + resolution: {integrity: sha512-VMJXFLAro7ZF8ckEyeP8Wvtez7G+7LAq/SHfk3JpyZbuODtBujaqFwMFlFOdXKC8eejzuS6DfvoaiUquAFWUZw==} peerDependencies: - graphql: ^15.0.0 || ^16.0.0 + graphql: ^16.0.0 graphql-ws: ^5.5.5 || ^6.0.3 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc + react: ^17.0.0 || ^18.0.0 || >=19.0.0-rc + react-dom: ^17.0.0 || ^18.0.0 || >=19.0.0-rc + rxjs: ^7.3.0 subscriptions-transport-ws: ^0.9.0 || ^0.11.0 peerDependenciesMeta: graphql-ws: @@ -5365,17 +5369,6 @@ packages: resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} engines: {node: '>= 0.4'} - rehackt@0.1.0: - resolution: {integrity: sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==} - peerDependencies: - '@types/react': '*' - react: '*' - peerDependenciesMeta: - '@types/react': - optional: true - react: - optional: true - requestidlecallback@0.3.0: resolution: {integrity: sha512-TWHFkT7S9p7IxLC5A1hYmAYQx2Eb9w1skrXmQ+dS1URyvR8tenMLl4lHbqEOUnpEYxNKpkVMXUgknVpBZWXXfQ==} @@ -5442,6 +5435,9 @@ packages: run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + rxjs@7.8.2: + resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==} + safe-array-concat@1.1.3: resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} engines: {node: '>=0.4'} @@ -5674,10 +5670,6 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - symbol-observable@4.0.0: - resolution: {integrity: sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==} - engines: {node: '>=0.10'} - symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} @@ -5792,10 +5784,6 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - ts-invariant@0.10.3: - resolution: {integrity: sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==} - engines: {node: '>=8'} - ts-jest@29.4.1: resolution: {integrity: sha512-SaeUtjfpg9Uqu8IbeDKtdaS0g8lS6FT6OzM3ezrDfErPJPHNDo/Ey+VFGP1bQIDfagYDLyRpd7O15XpG1Es2Uw==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} @@ -6129,12 +6117,6 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - zen-observable-ts@1.2.5: - resolution: {integrity: sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==} - - zen-observable@0.8.15: - resolution: {integrity: sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==} - snapshots: '@adobe/css-tools@4.4.4': {} @@ -6146,7 +6128,7 @@ snapshots: '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.30 - '@apollo/client@3.14.0(@types/react@19.1.10)(graphql@16.11.0)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': + '@apollo/client@4.0.0(graphql@16.11.0)(react-dom@19.1.1(react@19.1.1))(react@19.1.1)(rxjs@7.8.2)': dependencies: '@graphql-typed-document-node/core': 3.2.0(graphql@16.11.0) '@wry/caches': 1.0.1 @@ -6154,19 +6136,12 @@ snapshots: '@wry/trie': 0.5.0 graphql: 16.11.0 graphql-tag: 2.12.6(graphql@16.11.0) - hoist-non-react-statics: 3.3.2 optimism: 0.18.1 - prop-types: 15.8.1 - rehackt: 0.1.0(@types/react@19.1.10)(react@19.1.1) - symbol-observable: 4.0.0 - ts-invariant: 0.10.3 + rxjs: 7.8.2 tslib: 2.8.1 - zen-observable-ts: 1.2.5 optionalDependencies: react: 19.1.1 react-dom: 19.1.1(react@19.1.1) - transitivePeerDependencies: - - '@types/react' '@asamuzakjp/css-color@3.2.0': dependencies: @@ -12473,11 +12448,6 @@ snapshots: gopd: 1.2.0 set-function-name: 2.0.2 - rehackt@0.1.0(@types/react@19.1.10)(react@19.1.1): - optionalDependencies: - '@types/react': 19.1.10 - react: 19.1.1 - requestidlecallback@0.3.0: {} require-directory@2.1.1: {} @@ -12558,6 +12528,10 @@ snapshots: dependencies: queue-microtask: 1.2.3 + rxjs@7.8.2: + dependencies: + tslib: 2.8.1 + safe-array-concat@1.1.3: dependencies: call-bind: 1.0.8 @@ -12853,8 +12827,6 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - symbol-observable@4.0.0: {} - symbol-tree@3.2.4: {} synckit@0.11.11: @@ -12980,10 +12952,6 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-invariant@0.10.3: - dependencies: - tslib: 2.8.1 - ts-jest@29.4.1(@babel/core@7.28.3)(@jest/transform@29.7.0)(@jest/types@30.0.5)(babel-jest@29.7.0(@babel/core@7.28.3))(jest-util@30.0.5)(jest@29.7.0(@types/node@22.17.2)(ts-node@10.9.2(@swc/core@1.13.4(@swc/helpers@0.5.17))(@types/node@22.17.2)(typescript@5.8.3)))(typescript@5.8.3): dependencies: bs-logger: 0.2.6 @@ -13365,9 +13333,3 @@ snapshots: yn@3.1.1: {} yocto-queue@0.1.0: {} - - zen-observable-ts@1.2.5: - dependencies: - zen-observable: 0.8.15 - - zen-observable@0.8.15: {} From 5e68e0927c9445187a9f16a0a447eb04b9d356ee Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Mon, 25 Aug 2025 15:13:38 +0530 Subject: [PATCH 02/25] run initial apollo client codemod --- frontend/src/app/about/page.tsx | 4 +- .../src/app/chapters/[chapterKey]/page.tsx | 4 +- .../app/committees/[committeeKey]/page.tsx | 4 +- frontend/src/app/members/[memberKey]/page.tsx | 4 +- .../[programKey]/modules/[moduleKey]/page.tsx | 5 +-- .../mentorship/programs/[programKey]/page.tsx | 5 +-- frontend/src/app/my/mentorship/page.tsx | 5 +-- .../programs/[programKey]/edit/page.tsx | 4 +- .../modules/[moduleKey]/edit/page.tsx | 5 +-- .../[programKey]/modules/[moduleKey]/page.tsx | 5 +-- .../[programKey]/modules/create/page.tsx | 5 +-- .../mentorship/programs/[programKey]/page.tsx | 5 +-- .../my/mentorship/programs/create/page.tsx | 5 +-- .../organizations/[organizationKey]/page.tsx | 4 +- .../repositories/[repositoryKey]/page.tsx | 5 +-- frontend/src/app/page.tsx | 4 +- .../src/app/projects/[projectKey]/page.tsx | 4 +- .../dashboard/metrics/[projectKey]/page.tsx | 5 +-- .../app/projects/dashboard/metrics/page.tsx | 5 +-- frontend/src/app/projects/dashboard/page.tsx | 4 +- frontend/src/app/settings/api-keys/page.tsx | 5 +-- frontend/src/app/snapshots/[id]/page.tsx | 4 +- frontend/src/app/snapshots/page.tsx | 4 +- frontend/src/components/ModuleForm.tsx | 5 +-- frontend/src/hooks/useDjangoSession.ts | 2 +- frontend/src/hooks/useLogout.ts | 2 +- frontend/src/server/apolloClient.ts | 41 +++++++++++++++++-- frontend/src/utils/helpers/apolloClient.ts | 41 +++++++++++++++++-- frontend/src/wrappers/provider.tsx | 5 +-- 29 files changed, 128 insertions(+), 72 deletions(-) diff --git a/frontend/src/app/about/page.tsx b/frontend/src/app/about/page.tsx index f363e55f06..82c211568a 100644 --- a/frontend/src/app/about/page.tsx +++ b/frontend/src/app/about/page.tsx @@ -1,5 +1,5 @@ -'use client' -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import { faCircleCheck, faClock, diff --git a/frontend/src/app/chapters/[chapterKey]/page.tsx b/frontend/src/app/chapters/[chapterKey]/page.tsx index d6a7f1a16c..8304198c13 100644 --- a/frontend/src/app/chapters/[chapterKey]/page.tsx +++ b/frontend/src/app/chapters/[chapterKey]/page.tsx @@ -1,5 +1,5 @@ -'use client' -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import Link from 'next/link' import { useParams } from 'next/navigation' import { useState, useEffect } from 'react' diff --git a/frontend/src/app/committees/[committeeKey]/page.tsx b/frontend/src/app/committees/[committeeKey]/page.tsx index 2450fcde97..30678e06a4 100644 --- a/frontend/src/app/committees/[committeeKey]/page.tsx +++ b/frontend/src/app/committees/[committeeKey]/page.tsx @@ -1,5 +1,5 @@ -'use client' -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import { faCode, faCodeFork, diff --git a/frontend/src/app/members/[memberKey]/page.tsx b/frontend/src/app/members/[memberKey]/page.tsx index 3ea4f24d54..278d6a4e7e 100644 --- a/frontend/src/app/members/[memberKey]/page.tsx +++ b/frontend/src/app/members/[memberKey]/page.tsx @@ -1,5 +1,5 @@ -'use client' -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import { faCodeMerge, faFolderOpen, diff --git a/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx b/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx index c2f4e2b1c6..772d18b3f1 100644 --- a/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx +++ b/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import upperFirst from 'lodash/upperFirst' import { useParams } from 'next/navigation' import { useEffect, useState } from 'react' diff --git a/frontend/src/app/mentorship/programs/[programKey]/page.tsx b/frontend/src/app/mentorship/programs/[programKey]/page.tsx index ccd7bbd687..82879c6993 100644 --- a/frontend/src/app/mentorship/programs/[programKey]/page.tsx +++ b/frontend/src/app/mentorship/programs/[programKey]/page.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import upperFirst from 'lodash/upperFirst' import { useParams, useSearchParams, useRouter } from 'next/navigation' import { useEffect, useState } from 'react' diff --git a/frontend/src/app/my/mentorship/page.tsx b/frontend/src/app/my/mentorship/page.tsx index 183a3a8ecb..482494b43c 100644 --- a/frontend/src/app/my/mentorship/page.tsx +++ b/frontend/src/app/my/mentorship/page.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import { faPlus, faGraduationCap } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { addToast } from '@heroui/toast' diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx index cdfcec0ca1..2f1b48d54f 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx @@ -1,5 +1,5 @@ -'use client' -import { useQuery, useMutation } from '@apollo/client' +'use client'; +import { useMutation, useQuery } from "@apollo/client/react"; import { addToast } from '@heroui/toast' import { useRouter, useParams } from 'next/navigation' import { useSession } from 'next-auth/react' diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/edit/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/edit/page.tsx index 679eeeb803..43714bbce3 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/edit/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/edit/page.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useMutation, useQuery } from '@apollo/client' +'use client'; +import { useMutation, useQuery } from "@apollo/client/react"; import { addToast } from '@heroui/toast' import { useParams, useRouter } from 'next/navigation' import { useSession } from 'next-auth/react' diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx index dc0a7356b9..e0b0917818 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import upperFirst from 'lodash/upperFirst' import { useParams } from 'next/navigation' import { useEffect, useState } from 'react' diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/modules/create/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/modules/create/page.tsx index 8cc96d6d5b..b7413f54c2 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/modules/create/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/modules/create/page.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useMutation, useQuery } from '@apollo/client' +'use client'; +import { useMutation, useQuery } from "@apollo/client/react"; import { addToast } from '@heroui/toast' import { useRouter, useParams } from 'next/navigation' import { useSession } from 'next-auth/react' diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx index a28ef94602..3177e84844 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useQuery, useMutation } from '@apollo/client' +'use client'; +import { useMutation, useQuery } from "@apollo/client/react"; import { addToast } from '@heroui/toast' import upperFirst from 'lodash/upperFirst' import { useParams, useSearchParams, useRouter } from 'next/navigation' diff --git a/frontend/src/app/my/mentorship/programs/create/page.tsx b/frontend/src/app/my/mentorship/programs/create/page.tsx index 3b3c0cbd37..385cd70c74 100644 --- a/frontend/src/app/my/mentorship/programs/create/page.tsx +++ b/frontend/src/app/my/mentorship/programs/create/page.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useMutation } from '@apollo/client' +'use client'; +import { useMutation } from "@apollo/client/react"; import { addToast } from '@heroui/toast' import { useRouter } from 'next/navigation' import { useSession } from 'next-auth/react' diff --git a/frontend/src/app/organizations/[organizationKey]/page.tsx b/frontend/src/app/organizations/[organizationKey]/page.tsx index 614585ca1d..2342caa830 100644 --- a/frontend/src/app/organizations/[organizationKey]/page.tsx +++ b/frontend/src/app/organizations/[organizationKey]/page.tsx @@ -1,5 +1,5 @@ -'use client' -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import { faCodeFork, faExclamationCircle, diff --git a/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/page.tsx b/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/page.tsx index 05aa7329d4..37b21eba58 100644 --- a/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/page.tsx +++ b/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/page.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import { faCodeCommit, faCodeFork, diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index 497314c0e3..c669f206d5 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -1,5 +1,5 @@ -'use client' -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import { IconProp } from '@fortawesome/fontawesome-svg-core' import { faBook, diff --git a/frontend/src/app/projects/[projectKey]/page.tsx b/frontend/src/app/projects/[projectKey]/page.tsx index aa5e88c852..3998b0c4fb 100644 --- a/frontend/src/app/projects/[projectKey]/page.tsx +++ b/frontend/src/app/projects/[projectKey]/page.tsx @@ -1,5 +1,5 @@ -'use client' -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import { faCodeFork, faExclamationCircle, diff --git a/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx b/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx index e64bebd0f2..4695ef66f7 100644 --- a/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx +++ b/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import { faPeopleGroup, faCodeFork, diff --git a/frontend/src/app/projects/dashboard/metrics/page.tsx b/frontend/src/app/projects/dashboard/metrics/page.tsx index 1bc90ea2f4..6eaa2a6478 100644 --- a/frontend/src/app/projects/dashboard/metrics/page.tsx +++ b/frontend/src/app/projects/dashboard/metrics/page.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import { faFilter } from '@fortawesome/free-solid-svg-icons' import { Pagination } from '@heroui/react' import { useSearchParams, useRouter } from 'next/navigation' diff --git a/frontend/src/app/projects/dashboard/page.tsx b/frontend/src/app/projects/dashboard/page.tsx index 6c0a15d0a5..3ebf42d8a1 100644 --- a/frontend/src/app/projects/dashboard/page.tsx +++ b/frontend/src/app/projects/dashboard/page.tsx @@ -1,5 +1,5 @@ -'use client' -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import type { IconProp } from '@fortawesome/fontawesome-svg-core' import { faCheck, diff --git a/frontend/src/app/settings/api-keys/page.tsx b/frontend/src/app/settings/api-keys/page.tsx index 950798b18b..9e98d97ee3 100644 --- a/frontend/src/app/settings/api-keys/page.tsx +++ b/frontend/src/app/settings/api-keys/page.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useMutation, useQuery } from '@apollo/client' +'use client'; +import { useMutation, useQuery } from "@apollo/client/react"; import { faSpinner, faKey, diff --git a/frontend/src/app/snapshots/[id]/page.tsx b/frontend/src/app/snapshots/[id]/page.tsx index 02bfe38e45..0c5bd9d7ba 100644 --- a/frontend/src/app/snapshots/[id]/page.tsx +++ b/frontend/src/app/snapshots/[id]/page.tsx @@ -1,5 +1,5 @@ -'use client' -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import { faCalendar } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { useRouter, useParams } from 'next/navigation' diff --git a/frontend/src/app/snapshots/page.tsx b/frontend/src/app/snapshots/page.tsx index d9d4bfc548..5e40b644cc 100644 --- a/frontend/src/app/snapshots/page.tsx +++ b/frontend/src/app/snapshots/page.tsx @@ -1,5 +1,5 @@ -'use client' -import { useQuery } from '@apollo/client' +'use client'; +import { useQuery } from "@apollo/client/react"; import { addToast } from '@heroui/toast' import { useRouter } from 'next/navigation' import React, { useState, useEffect } from 'react' diff --git a/frontend/src/components/ModuleForm.tsx b/frontend/src/components/ModuleForm.tsx index 27da71d3f7..1c2ac40090 100644 --- a/frontend/src/components/ModuleForm.tsx +++ b/frontend/src/components/ModuleForm.tsx @@ -1,6 +1,5 @@ -'use client' - -import { useApolloClient } from '@apollo/client' +'use client'; +import { useApolloClient } from "@apollo/client/react"; import clsx from 'clsx' import debounce from 'lodash/debounce' import { useRouter } from 'next/navigation' diff --git a/frontend/src/hooks/useDjangoSession.ts b/frontend/src/hooks/useDjangoSession.ts index b61efd2709..3a169ac482 100644 --- a/frontend/src/hooks/useDjangoSession.ts +++ b/frontend/src/hooks/useDjangoSession.ts @@ -1,4 +1,4 @@ -import { useMutation } from '@apollo/client' +import { useMutation } from "@apollo/client/react"; import { addToast } from '@heroui/toast' import { useSession, signOut } from 'next-auth/react' import { useEffect, useState } from 'react' diff --git a/frontend/src/hooks/useLogout.ts b/frontend/src/hooks/useLogout.ts index b51fe52bcf..fe0d6c631f 100644 --- a/frontend/src/hooks/useLogout.ts +++ b/frontend/src/hooks/useLogout.ts @@ -1,4 +1,4 @@ -import { useMutation } from '@apollo/client' +import { useMutation } from "@apollo/client/react"; import { signOut } from 'next-auth/react' import { useState } from 'react' import { LOGOUT_DJANGO_MUTATION } from 'server/queries/authQueries' diff --git a/frontend/src/server/apolloClient.ts b/frontend/src/server/apolloClient.ts index 647eecfad1..c96f64636f 100644 --- a/frontend/src/server/apolloClient.ts +++ b/frontend/src/server/apolloClient.ts @@ -1,4 +1,6 @@ -import { ApolloClient, InMemoryCache, createHttpLink } from '@apollo/client' +import { ApolloClient, InMemoryCache, HttpLink } from '@apollo/client' +import { Defer20220824Handler } from "@apollo/client/incremental"; +import { LocalState } from "@apollo/client/local-state"; import { setContext } from '@apollo/client/link/context' import { cookies } from 'next/headers' import { fetchCsrfTokenServer } from 'server/fetchCsrfTokenServer' @@ -16,7 +18,7 @@ async function createApolloClient() { }, } }) - const httpLink = createHttpLink({ + const httpLink = new HttpLink({ credentials: 'same-origin', uri: process.env.NEXT_SERVER_GRAPHQL_URL, }) @@ -25,7 +27,21 @@ async function createApolloClient() { cache: new InMemoryCache().restore(globalThis.__APOLLO_STATE__ ?? {}), link: authLink.concat(httpLink), ssrMode: true, - }) + + /* + Inserted by Apollo Client 3->4 migration codemod. + If you are not using the `@client` directive in your application, + you can safely remove this option. + */ + localState: new LocalState({}), + + /* + Inserted by Apollo Client 3->4 migration codemod. + If you are not using the `@defer` directive in your application, + you can safely remove this option. + */ + incrementalHandler: new Defer20220824Handler() + }); } // This is a no-op Apollo client for end-to-end tests. @@ -42,3 +58,22 @@ export const getCsrfTokenOnServer = async () => { return csrfCookie ? csrfCookie.value : await fetchCsrfTokenServer() } + +/* +Start: Inserted by Apollo Client 3->4 migration codemod. +Copy the contents of this block into a `.d.ts` file in your project to enable correct response types in your custom links. +If you do not use the `@defer` directive in your application, you can safely remove this block. +*/ + + +import "@apollo/client"; +import { Defer20220824Handler } from "@apollo/client/incremental"; + +declare module "@apollo/client" { + export interface TypeOverrides extends Defer20220824Handler.TypeOverrides {} +} + +/* +End: Inserted by Apollo Client 3->4 migration codemod. +*/ + diff --git a/frontend/src/utils/helpers/apolloClient.ts b/frontend/src/utils/helpers/apolloClient.ts index d35b0231e1..6b10adfee8 100644 --- a/frontend/src/utils/helpers/apolloClient.ts +++ b/frontend/src/utils/helpers/apolloClient.ts @@ -1,4 +1,6 @@ -import { ApolloClient, createHttpLink, InMemoryCache } from '@apollo/client' +import { ApolloClient, InMemoryCache, HttpLink } from '@apollo/client' +import { Defer20220824Handler } from "@apollo/client/incremental"; +import { LocalState } from "@apollo/client/local-state"; import { setContext } from '@apollo/client/link/context' import { AppError, handleAppError } from 'app/global-error' import { GRAPHQL_URL } from 'utils/credentials' @@ -10,7 +12,7 @@ const createApolloClient = () => { return null } - const httpLink = createHttpLink({ + const httpLink = new HttpLink({ credentials: 'include', uri: GRAPHQL_URL, }) @@ -29,8 +31,41 @@ const createApolloClient = () => { return new ApolloClient({ cache: new InMemoryCache(), link: authLink.concat(httpLink), - }) + + /* + Inserted by Apollo Client 3->4 migration codemod. + If you are not using the `@client` directive in your application, + you can safely remove this option. + */ + localState: new LocalState({}), + + /* + Inserted by Apollo Client 3->4 migration codemod. + If you are not using the `@defer` directive in your application, + you can safely remove this option. + */ + incrementalHandler: new Defer20220824Handler() + }); } const apolloClient = createApolloClient() export default apolloClient + +/* +Start: Inserted by Apollo Client 3->4 migration codemod. +Copy the contents of this block into a `.d.ts` file in your project to enable correct response types in your custom links. +If you do not use the `@defer` directive in your application, you can safely remove this block. +*/ + + +import "@apollo/client"; +import { Defer20220824Handler } from "@apollo/client/incremental"; + +declare module "@apollo/client" { + export interface TypeOverrides extends Defer20220824Handler.TypeOverrides {} +} + +/* +End: Inserted by Apollo Client 3->4 migration codemod. +*/ + diff --git a/frontend/src/wrappers/provider.tsx b/frontend/src/wrappers/provider.tsx index 556196e47b..6a54c03bd6 100644 --- a/frontend/src/wrappers/provider.tsx +++ b/frontend/src/wrappers/provider.tsx @@ -1,6 +1,5 @@ -'use client' - -import { ApolloProvider } from '@apollo/client' +'use client'; +import { ApolloProvider } from "@apollo/client/react"; import { HeroUIProvider, ToastProvider } from '@heroui/react' import { useDjangoSession } from 'hooks/useDjangoSession' import { SessionProvider } from 'next-auth/react' From 6b2e8a4f840520b03e800433dfc3521d7b3b7f9b Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Mon, 25 Aug 2025 15:21:00 +0530 Subject: [PATCH 03/25] remove @client and @defer codemod codeblocks --- frontend/src/server/apolloClient.ts | 35 ---------------------- frontend/src/utils/helpers/apolloClient.ts | 35 ---------------------- 2 files changed, 70 deletions(-) diff --git a/frontend/src/server/apolloClient.ts b/frontend/src/server/apolloClient.ts index c96f64636f..48cbddcb13 100644 --- a/frontend/src/server/apolloClient.ts +++ b/frontend/src/server/apolloClient.ts @@ -1,6 +1,4 @@ import { ApolloClient, InMemoryCache, HttpLink } from '@apollo/client' -import { Defer20220824Handler } from "@apollo/client/incremental"; -import { LocalState } from "@apollo/client/local-state"; import { setContext } from '@apollo/client/link/context' import { cookies } from 'next/headers' import { fetchCsrfTokenServer } from 'server/fetchCsrfTokenServer' @@ -27,20 +25,6 @@ async function createApolloClient() { cache: new InMemoryCache().restore(globalThis.__APOLLO_STATE__ ?? {}), link: authLink.concat(httpLink), ssrMode: true, - - /* - Inserted by Apollo Client 3->4 migration codemod. - If you are not using the `@client` directive in your application, - you can safely remove this option. - */ - localState: new LocalState({}), - - /* - Inserted by Apollo Client 3->4 migration codemod. - If you are not using the `@defer` directive in your application, - you can safely remove this option. - */ - incrementalHandler: new Defer20220824Handler() }); } @@ -58,22 +42,3 @@ export const getCsrfTokenOnServer = async () => { return csrfCookie ? csrfCookie.value : await fetchCsrfTokenServer() } - -/* -Start: Inserted by Apollo Client 3->4 migration codemod. -Copy the contents of this block into a `.d.ts` file in your project to enable correct response types in your custom links. -If you do not use the `@defer` directive in your application, you can safely remove this block. -*/ - - -import "@apollo/client"; -import { Defer20220824Handler } from "@apollo/client/incremental"; - -declare module "@apollo/client" { - export interface TypeOverrides extends Defer20220824Handler.TypeOverrides {} -} - -/* -End: Inserted by Apollo Client 3->4 migration codemod. -*/ - diff --git a/frontend/src/utils/helpers/apolloClient.ts b/frontend/src/utils/helpers/apolloClient.ts index 6b10adfee8..8395db2cf2 100644 --- a/frontend/src/utils/helpers/apolloClient.ts +++ b/frontend/src/utils/helpers/apolloClient.ts @@ -1,6 +1,4 @@ import { ApolloClient, InMemoryCache, HttpLink } from '@apollo/client' -import { Defer20220824Handler } from "@apollo/client/incremental"; -import { LocalState } from "@apollo/client/local-state"; import { setContext } from '@apollo/client/link/context' import { AppError, handleAppError } from 'app/global-error' import { GRAPHQL_URL } from 'utils/credentials' @@ -31,41 +29,8 @@ const createApolloClient = () => { return new ApolloClient({ cache: new InMemoryCache(), link: authLink.concat(httpLink), - - /* - Inserted by Apollo Client 3->4 migration codemod. - If you are not using the `@client` directive in your application, - you can safely remove this option. - */ - localState: new LocalState({}), - - /* - Inserted by Apollo Client 3->4 migration codemod. - If you are not using the `@defer` directive in your application, - you can safely remove this option. - */ - incrementalHandler: new Defer20220824Handler() }); } const apolloClient = createApolloClient() export default apolloClient - -/* -Start: Inserted by Apollo Client 3->4 migration codemod. -Copy the contents of this block into a `.d.ts` file in your project to enable correct response types in your custom links. -If you do not use the `@defer` directive in your application, you can safely remove this block. -*/ - - -import "@apollo/client"; -import { Defer20220824Handler } from "@apollo/client/incremental"; - -declare module "@apollo/client" { - export interface TypeOverrides extends Defer20220824Handler.TypeOverrides {} -} - -/* -End: Inserted by Apollo Client 3->4 migration codemod. -*/ - From b175fb9eaf4a2ac19c9153ea33d5311df7af9724 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Wed, 27 Aug 2025 22:33:02 +0530 Subject: [PATCH 04/25] format and lint code --- frontend/src/app/about/page.tsx | 4 ++-- frontend/src/app/chapters/[chapterKey]/page.tsx | 4 ++-- frontend/src/app/committees/[committeeKey]/page.tsx | 4 ++-- frontend/src/app/members/[memberKey]/page.tsx | 4 ++-- .../programs/[programKey]/modules/[moduleKey]/page.tsx | 4 ++-- frontend/src/app/mentorship/programs/[programKey]/page.tsx | 4 ++-- frontend/src/app/my/mentorship/page.tsx | 4 ++-- .../src/app/my/mentorship/programs/[programKey]/edit/page.tsx | 4 ++-- .../programs/[programKey]/modules/[moduleKey]/edit/page.tsx | 4 ++-- .../programs/[programKey]/modules/[moduleKey]/page.tsx | 4 ++-- .../mentorship/programs/[programKey]/modules/create/page.tsx | 4 ++-- frontend/src/app/my/mentorship/programs/[programKey]/page.tsx | 4 ++-- frontend/src/app/my/mentorship/programs/create/page.tsx | 4 ++-- frontend/src/app/organizations/[organizationKey]/page.tsx | 4 ++-- .../[organizationKey]/repositories/[repositoryKey]/page.tsx | 4 ++-- frontend/src/app/page.tsx | 4 ++-- frontend/src/app/projects/[projectKey]/page.tsx | 4 ++-- .../src/app/projects/dashboard/metrics/[projectKey]/page.tsx | 4 ++-- frontend/src/app/projects/dashboard/metrics/page.tsx | 4 ++-- frontend/src/app/projects/dashboard/page.tsx | 4 ++-- frontend/src/app/settings/api-keys/page.tsx | 4 ++-- frontend/src/app/snapshots/[id]/page.tsx | 4 ++-- frontend/src/app/snapshots/page.tsx | 4 ++-- frontend/src/components/ModuleForm.tsx | 4 ++-- frontend/src/hooks/useDjangoSession.ts | 2 +- frontend/src/hooks/useLogout.ts | 2 +- frontend/src/server/apolloClient.ts | 2 +- frontend/src/utils/helpers/apolloClient.ts | 2 +- frontend/src/wrappers/provider.tsx | 4 ++-- 29 files changed, 54 insertions(+), 54 deletions(-) diff --git a/frontend/src/app/about/page.tsx b/frontend/src/app/about/page.tsx index 82c211568a..4ed5cc81a9 100644 --- a/frontend/src/app/about/page.tsx +++ b/frontend/src/app/about/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import { faCircleCheck, faClock, diff --git a/frontend/src/app/chapters/[chapterKey]/page.tsx b/frontend/src/app/chapters/[chapterKey]/page.tsx index 8304198c13..5a2eff421e 100644 --- a/frontend/src/app/chapters/[chapterKey]/page.tsx +++ b/frontend/src/app/chapters/[chapterKey]/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import Link from 'next/link' import { useParams } from 'next/navigation' import { useState, useEffect } from 'react' diff --git a/frontend/src/app/committees/[committeeKey]/page.tsx b/frontend/src/app/committees/[committeeKey]/page.tsx index 30678e06a4..8e01479c98 100644 --- a/frontend/src/app/committees/[committeeKey]/page.tsx +++ b/frontend/src/app/committees/[committeeKey]/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import { faCode, faCodeFork, diff --git a/frontend/src/app/members/[memberKey]/page.tsx b/frontend/src/app/members/[memberKey]/page.tsx index 278d6a4e7e..33fcee21ef 100644 --- a/frontend/src/app/members/[memberKey]/page.tsx +++ b/frontend/src/app/members/[memberKey]/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import { faCodeMerge, faFolderOpen, diff --git a/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx b/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx index 772d18b3f1..c6a9b51d3c 100644 --- a/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx +++ b/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import upperFirst from 'lodash/upperFirst' import { useParams } from 'next/navigation' import { useEffect, useState } from 'react' diff --git a/frontend/src/app/mentorship/programs/[programKey]/page.tsx b/frontend/src/app/mentorship/programs/[programKey]/page.tsx index 82879c6993..3c245d9648 100644 --- a/frontend/src/app/mentorship/programs/[programKey]/page.tsx +++ b/frontend/src/app/mentorship/programs/[programKey]/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import upperFirst from 'lodash/upperFirst' import { useParams, useSearchParams, useRouter } from 'next/navigation' import { useEffect, useState } from 'react' diff --git a/frontend/src/app/my/mentorship/page.tsx b/frontend/src/app/my/mentorship/page.tsx index 482494b43c..96d71e98b1 100644 --- a/frontend/src/app/my/mentorship/page.tsx +++ b/frontend/src/app/my/mentorship/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import { faPlus, faGraduationCap } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { addToast } from '@heroui/toast' diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx index 2f1b48d54f..0f027209eb 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useMutation, useQuery } from "@apollo/client/react"; +'use client' +import { useMutation, useQuery } from '@apollo/client/react' import { addToast } from '@heroui/toast' import { useRouter, useParams } from 'next/navigation' import { useSession } from 'next-auth/react' diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/edit/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/edit/page.tsx index 43714bbce3..7e5e5ba37b 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/edit/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/edit/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useMutation, useQuery } from "@apollo/client/react"; +'use client' +import { useMutation, useQuery } from '@apollo/client/react' import { addToast } from '@heroui/toast' import { useParams, useRouter } from 'next/navigation' import { useSession } from 'next-auth/react' diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx index e0b0917818..587ce39468 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import upperFirst from 'lodash/upperFirst' import { useParams } from 'next/navigation' import { useEffect, useState } from 'react' diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/modules/create/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/modules/create/page.tsx index b7413f54c2..d9da37009f 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/modules/create/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/modules/create/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useMutation, useQuery } from "@apollo/client/react"; +'use client' +import { useMutation, useQuery } from '@apollo/client/react' import { addToast } from '@heroui/toast' import { useRouter, useParams } from 'next/navigation' import { useSession } from 'next-auth/react' diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx index 3177e84844..4890b947f3 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useMutation, useQuery } from "@apollo/client/react"; +'use client' +import { useMutation, useQuery } from '@apollo/client/react' import { addToast } from '@heroui/toast' import upperFirst from 'lodash/upperFirst' import { useParams, useSearchParams, useRouter } from 'next/navigation' diff --git a/frontend/src/app/my/mentorship/programs/create/page.tsx b/frontend/src/app/my/mentorship/programs/create/page.tsx index 385cd70c74..31225af1af 100644 --- a/frontend/src/app/my/mentorship/programs/create/page.tsx +++ b/frontend/src/app/my/mentorship/programs/create/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useMutation } from "@apollo/client/react"; +'use client' +import { useMutation } from '@apollo/client/react' import { addToast } from '@heroui/toast' import { useRouter } from 'next/navigation' import { useSession } from 'next-auth/react' diff --git a/frontend/src/app/organizations/[organizationKey]/page.tsx b/frontend/src/app/organizations/[organizationKey]/page.tsx index 2342caa830..220d5fc39e 100644 --- a/frontend/src/app/organizations/[organizationKey]/page.tsx +++ b/frontend/src/app/organizations/[organizationKey]/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import { faCodeFork, faExclamationCircle, diff --git a/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/page.tsx b/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/page.tsx index 37b21eba58..ea9816a089 100644 --- a/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/page.tsx +++ b/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import { faCodeCommit, faCodeFork, diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index c669f206d5..01660484d4 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import { IconProp } from '@fortawesome/fontawesome-svg-core' import { faBook, diff --git a/frontend/src/app/projects/[projectKey]/page.tsx b/frontend/src/app/projects/[projectKey]/page.tsx index 3998b0c4fb..4fd3b572d8 100644 --- a/frontend/src/app/projects/[projectKey]/page.tsx +++ b/frontend/src/app/projects/[projectKey]/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import { faCodeFork, faExclamationCircle, diff --git a/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx b/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx index 4695ef66f7..fb0bfe0e47 100644 --- a/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx +++ b/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import { faPeopleGroup, faCodeFork, diff --git a/frontend/src/app/projects/dashboard/metrics/page.tsx b/frontend/src/app/projects/dashboard/metrics/page.tsx index 6eaa2a6478..56d2708c18 100644 --- a/frontend/src/app/projects/dashboard/metrics/page.tsx +++ b/frontend/src/app/projects/dashboard/metrics/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import { faFilter } from '@fortawesome/free-solid-svg-icons' import { Pagination } from '@heroui/react' import { useSearchParams, useRouter } from 'next/navigation' diff --git a/frontend/src/app/projects/dashboard/page.tsx b/frontend/src/app/projects/dashboard/page.tsx index 3ebf42d8a1..e5e2941187 100644 --- a/frontend/src/app/projects/dashboard/page.tsx +++ b/frontend/src/app/projects/dashboard/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import type { IconProp } from '@fortawesome/fontawesome-svg-core' import { faCheck, diff --git a/frontend/src/app/settings/api-keys/page.tsx b/frontend/src/app/settings/api-keys/page.tsx index 9e98d97ee3..ba125cf3cb 100644 --- a/frontend/src/app/settings/api-keys/page.tsx +++ b/frontend/src/app/settings/api-keys/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useMutation, useQuery } from "@apollo/client/react"; +'use client' +import { useMutation, useQuery } from '@apollo/client/react' import { faSpinner, faKey, diff --git a/frontend/src/app/snapshots/[id]/page.tsx b/frontend/src/app/snapshots/[id]/page.tsx index 0c5bd9d7ba..fe57c7b6f7 100644 --- a/frontend/src/app/snapshots/[id]/page.tsx +++ b/frontend/src/app/snapshots/[id]/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import { faCalendar } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { useRouter, useParams } from 'next/navigation' diff --git a/frontend/src/app/snapshots/page.tsx b/frontend/src/app/snapshots/page.tsx index 5e40b644cc..777f8d39d9 100644 --- a/frontend/src/app/snapshots/page.tsx +++ b/frontend/src/app/snapshots/page.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useQuery } from "@apollo/client/react"; +'use client' +import { useQuery } from '@apollo/client/react' import { addToast } from '@heroui/toast' import { useRouter } from 'next/navigation' import React, { useState, useEffect } from 'react' diff --git a/frontend/src/components/ModuleForm.tsx b/frontend/src/components/ModuleForm.tsx index 1c2ac40090..67a7f61045 100644 --- a/frontend/src/components/ModuleForm.tsx +++ b/frontend/src/components/ModuleForm.tsx @@ -1,5 +1,5 @@ -'use client'; -import { useApolloClient } from "@apollo/client/react"; +'use client' +import { useApolloClient } from '@apollo/client/react' import clsx from 'clsx' import debounce from 'lodash/debounce' import { useRouter } from 'next/navigation' diff --git a/frontend/src/hooks/useDjangoSession.ts b/frontend/src/hooks/useDjangoSession.ts index 3a169ac482..50adabf2d4 100644 --- a/frontend/src/hooks/useDjangoSession.ts +++ b/frontend/src/hooks/useDjangoSession.ts @@ -1,4 +1,4 @@ -import { useMutation } from "@apollo/client/react"; +import { useMutation } from '@apollo/client/react' import { addToast } from '@heroui/toast' import { useSession, signOut } from 'next-auth/react' import { useEffect, useState } from 'react' diff --git a/frontend/src/hooks/useLogout.ts b/frontend/src/hooks/useLogout.ts index fe0d6c631f..7e8e52f68f 100644 --- a/frontend/src/hooks/useLogout.ts +++ b/frontend/src/hooks/useLogout.ts @@ -1,4 +1,4 @@ -import { useMutation } from "@apollo/client/react"; +import { useMutation } from '@apollo/client/react' import { signOut } from 'next-auth/react' import { useState } from 'react' import { LOGOUT_DJANGO_MUTATION } from 'server/queries/authQueries' diff --git a/frontend/src/server/apolloClient.ts b/frontend/src/server/apolloClient.ts index 48cbddcb13..ee490a7d1b 100644 --- a/frontend/src/server/apolloClient.ts +++ b/frontend/src/server/apolloClient.ts @@ -25,7 +25,7 @@ async function createApolloClient() { cache: new InMemoryCache().restore(globalThis.__APOLLO_STATE__ ?? {}), link: authLink.concat(httpLink), ssrMode: true, - }); + }) } // This is a no-op Apollo client for end-to-end tests. diff --git a/frontend/src/utils/helpers/apolloClient.ts b/frontend/src/utils/helpers/apolloClient.ts index 8395db2cf2..9a8205cebb 100644 --- a/frontend/src/utils/helpers/apolloClient.ts +++ b/frontend/src/utils/helpers/apolloClient.ts @@ -29,7 +29,7 @@ const createApolloClient = () => { return new ApolloClient({ cache: new InMemoryCache(), link: authLink.concat(httpLink), - }); + }) } const apolloClient = createApolloClient() diff --git a/frontend/src/wrappers/provider.tsx b/frontend/src/wrappers/provider.tsx index 6a54c03bd6..ef0590ab8d 100644 --- a/frontend/src/wrappers/provider.tsx +++ b/frontend/src/wrappers/provider.tsx @@ -1,5 +1,5 @@ -'use client'; -import { ApolloProvider } from "@apollo/client/react"; +'use client' +import { ApolloProvider } from '@apollo/client/react' import { HeroUIProvider, ToastProvider } from '@heroui/react' import { useDjangoSession } from 'hooks/useDjangoSession' import { SessionProvider } from 'next-auth/react' From b8a110c63b5dc940b9f7208f2e6a66baf9d36d67 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Thu, 4 Sep 2025 00:02:21 +0530 Subject: [PATCH 05/25] replace queries with typed-document-node --- frontend/src/app/about/page.tsx | 31 +++++++++------ .../src/app/chapters/[chapterKey]/page.tsx | 16 +++++--- .../app/committees/[committeeKey]/page.tsx | 10 +++-- frontend/src/app/members/[memberKey]/page.tsx | 26 ++++++------- .../[programKey]/modules/[moduleKey]/page.tsx | 18 +++++---- .../mentorship/programs/[programKey]/page.tsx | 16 ++++---- frontend/src/app/my/mentorship/page.tsx | 12 +++--- .../programs/[programKey]/edit/page.tsx | 8 ++-- .../[programKey]/modules/[moduleKey]/page.tsx | 18 +++++---- .../mentorship/programs/[programKey]/page.tsx | 19 +++++---- .../organizations/[organizationKey]/page.tsx | 6 +-- .../src/app/projects/[projectKey]/page.tsx | 12 +++--- .../dashboard/metrics/[projectKey]/page.tsx | 18 +++++---- .../app/projects/dashboard/metrics/page.tsx | 38 +++++++++++------- frontend/src/app/projects/dashboard/page.tsx | 10 +++-- frontend/src/app/settings/api-keys/page.tsx | 26 +++++++------ frontend/src/app/snapshots/[id]/page.tsx | 39 +++++++++++-------- frontend/src/app/snapshots/page.tsx | 17 +++++--- frontend/src/components/CardDetailsPage.tsx | 1 + frontend/src/components/ModuleForm.tsx | 4 +- frontend/src/hooks/useDjangoSession.ts | 4 +- frontend/src/server/queries/userQueries.ts | 2 + .../__generated__/userQueries.generated.ts | 4 +- 23 files changed, 203 insertions(+), 152 deletions(-) diff --git a/frontend/src/app/about/page.tsx b/frontend/src/app/about/page.tsx index 44811192e8..7fa811bb98 100644 --- a/frontend/src/app/about/page.tsx +++ b/frontend/src/app/about/page.tsx @@ -19,11 +19,16 @@ import { useRouter } from 'next/navigation' import { useEffect, useState } from 'react' import FontAwesomeIconWrapper from 'wrappers/FontAwesomeIconWrapper' import { ErrorDisplay, handleAppError } from 'app/global-error' -import { GET_PROJECT_METADATA, GET_TOP_CONTRIBUTORS } from 'server/queries/projectQueries' -import { GET_LEADER_DATA } from 'server/queries/userQueries' -import type { Contributor } from 'types/contributor' -import type { Project } from 'types/project' -import type { User } from 'types/user' +import { + GetProjectMetadataDocument, + GetProjectMetadataQuery, + GetTopContributorsDocument, + GetTopContributorsQuery, +} from 'types/__generated__/projectQueries.generated' +import { + GetLeaderDataDocument, + GetLeaderDataQuery, +} from 'types/__generated__/userQueries.generated' import { aboutText, technologies } from 'utils/aboutData' import AnchorTitle from 'components/AnchorTitle' import AnimatedCounter from 'components/AnimatedCounter' @@ -42,14 +47,14 @@ const projectKey = 'nest' const About = () => { const { data: projectMetadataResponse, error: projectMetadataRequestError } = useQuery( - GET_PROJECT_METADATA, + GetProjectMetadataDocument, { variables: { key: projectKey }, } ) const { data: topContributorsResponse, error: topContributorsRequestError } = useQuery( - GET_TOP_CONTRIBUTORS, + GetTopContributorsDocument, { variables: { excludedUsernames: Object.keys(leaders), @@ -60,8 +65,12 @@ const About = () => { } ) - const [projectMetadata, setProjectMetadata] = useState(null) - const [topContributors, setTopContributors] = useState([]) + const [projectMetadata, setProjectMetadata] = useState( + null + ) + const [topContributors, setTopContributors] = useState< + GetTopContributorsQuery['topContributors'] + >([]) useEffect(() => { if (projectMetadataResponse?.project) { @@ -247,7 +256,7 @@ const About = () => { } const LeaderData = ({ username }: { username: string }) => { - const { data, loading, error } = useQuery(GET_LEADER_DATA, { + const { data, loading, error } = useQuery(GetLeaderDataDocument, { variables: { key: username }, }) const router = useRouter() @@ -261,7 +270,7 @@ const LeaderData = ({ username }: { username: string }) => { return

No data available for {username}

} - const handleButtonClick = (user: User) => { + const handleButtonClick = (user: GetLeaderDataQuery['user']) => { router.push(`/members/${user.login}`) } diff --git a/frontend/src/app/chapters/[chapterKey]/page.tsx b/frontend/src/app/chapters/[chapterKey]/page.tsx index 5a2eff421e..54ccf8cff7 100644 --- a/frontend/src/app/chapters/[chapterKey]/page.tsx +++ b/frontend/src/app/chapters/[chapterKey]/page.tsx @@ -4,20 +4,24 @@ import Link from 'next/link' import { useParams } from 'next/navigation' import { useState, useEffect } from 'react' import { handleAppError, ErrorDisplay } from 'app/global-error' -import { GET_CHAPTER_DATA } from 'server/queries/chapterQueries' -import type { Chapter } from 'types/chapter' +import { + GetChapterDataDocument, + GetChapterDataQuery, +} from 'types/__generated__/chapterQueries.generated' import type { Contributor } from 'types/contributor' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' export default function ChapterDetailsPage() { - const { chapterKey } = useParams() - const [chapter, setChapter] = useState({} as Chapter) + const { chapterKey } = useParams<{ chapterKey: string }>() + const [chapter, setChapter] = useState( + {} as GetChapterDataQuery['chapter'] + ) const [topContributors, setTopContributors] = useState([]) const [isLoading, setIsLoading] = useState(true) - const { data, error: graphQLRequestError } = useQuery(GET_CHAPTER_DATA, { + const { data, error: graphQLRequestError } = useQuery(GetChapterDataDocument, { variables: { key: chapterKey }, }) @@ -63,7 +67,7 @@ export default function ChapterDetailsPage() { () - const [committee, setCommittee] = useState(null) + const [committee, setCommittee] = useState(null) const [topContributors, setTopContributors] = useState([]) const [isLoading, setIsLoading] = useState(true) - const { data, error: graphQLRequestError } = useQuery(GET_COMMITTEE_DATA, { + const { data, error: graphQLRequestError } = useQuery(GetCommitteeDataDocument, { variables: { key: committeeKey }, }) diff --git a/frontend/src/app/members/[memberKey]/page.tsx b/frontend/src/app/members/[memberKey]/page.tsx index 33fcee21ef..b57ded8057 100644 --- a/frontend/src/app/members/[memberKey]/page.tsx +++ b/frontend/src/app/members/[memberKey]/page.tsx @@ -12,26 +12,22 @@ import { useParams } from 'next/navigation' import { useTheme } from 'next-themes' import React, { useState, useEffect, useRef } from 'react' import { handleAppError, ErrorDisplay } from 'app/global-error' -import { GET_USER_DATA } from 'server/queries/userQueries' -import type { Issue } from 'types/issue' -import type { Milestone } from 'types/milestone' -import type { RepositoryCardProps } from 'types/project' -import type { PullRequest } from 'types/pullRequest' -import type { Release } from 'types/release' -import type { UserDetails } from 'types/user' +import { GetUserDataDocument, GetUserDataQuery } from 'types/__generated__/userQueries.generated' import { formatDate } from 'utils/dateFormatter' import { drawContributions, fetchHeatmapData, HeatmapData } from 'utils/helpers/githubHeatmap' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' const UserDetailsPage: React.FC = () => { - const { memberKey } = useParams() - const [user, setUser] = useState() - const [issues, setIssues] = useState([]) - const [topRepositories, setTopRepositories] = useState([]) - const [milestones, setMilestones] = useState([]) - const [pullRequests, setPullRequests] = useState([]) - const [releases, setReleases] = useState([]) + const { memberKey } = useParams<{ memberKey: string }>() + const [user, setUser] = useState() + const [issues, setIssues] = useState([]) + const [topRepositories, setTopRepositories] = useState< + GetUserDataQuery['topContributedRepositories'] + >([]) + const [milestones, setMilestones] = useState([]) + const [pullRequests, setPullRequests] = useState([]) + const [releases, setReleases] = useState([]) const [data, setData] = useState({} as HeatmapData) const [isLoading, setIsLoading] = useState(true) const [username, setUsername] = useState('') @@ -40,7 +36,7 @@ const UserDetailsPage: React.FC = () => { const canvasRef = useRef(null) const theme = 'blue' - const { data: graphQLData, error: graphQLRequestError } = useQuery(GET_USER_DATA, { + const { data: graphQLData, error: graphQLRequestError } = useQuery(GetUserDataDocument, { variables: { key: memberKey }, }) diff --git a/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx b/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx index c6a9b51d3c..fa6cd64485 100644 --- a/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx +++ b/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx @@ -4,20 +4,22 @@ import upperFirst from 'lodash/upperFirst' import { useParams } from 'next/navigation' import { useEffect, useState } from 'react' import { ErrorDisplay, handleAppError } from 'app/global-error' -import { GET_PROGRAM_ADMINS_AND_MODULES } from 'server/queries/moduleQueries' -import type { Module } from 'types/mentorship' +import { + GetProgramAdminsAndModulesDocument, + GetProgramAdminsAndModulesQuery, +} from 'types/__generated__/moduleQueries.generated' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' import { getSimpleDuration } from 'components/ModuleCard' const ModuleDetailsPage = () => { - const { programKey, moduleKey } = useParams() - const [module, setModule] = useState(null) + const { programKey, moduleKey } = useParams<{ programKey: string; moduleKey: string }>() + const [module, setModule] = useState(null) const [admins, setAdmins] = useState(null) const [isLoading, setIsLoading] = useState(true) - const { data, error } = useQuery(GET_PROGRAM_ADMINS_AND_MODULES, { + const { data, error } = useQuery(GetProgramAdminsAndModulesDocument, { variables: { programKey, moduleKey, @@ -49,11 +51,11 @@ const ModuleDetailsPage = () => { const moduleDetails = [ { label: 'Experience Level', value: upperFirst(module.experienceLevel) }, - { label: 'Start Date', value: formatDate(module.startedAt) }, - { label: 'End Date', value: formatDate(module.endedAt) }, + { label: 'Start Date', value: formatDate(module.startedAt as string) }, + { label: 'End Date', value: formatDate(module.endedAt as string) }, { label: 'Duration', - value: getSimpleDuration(module.startedAt, module.endedAt), + value: getSimpleDuration(module.startedAt as string, module.endedAt as string), }, ] diff --git a/frontend/src/app/mentorship/programs/[programKey]/page.tsx b/frontend/src/app/mentorship/programs/[programKey]/page.tsx index 3c245d9648..4c94f71412 100644 --- a/frontend/src/app/mentorship/programs/[programKey]/page.tsx +++ b/frontend/src/app/mentorship/programs/[programKey]/page.tsx @@ -4,8 +4,10 @@ import upperFirst from 'lodash/upperFirst' import { useParams, useSearchParams, useRouter } from 'next/navigation' import { useEffect, useState } from 'react' import { ErrorDisplay } from 'app/global-error' -import { GET_PROGRAM_AND_MODULES } from 'server/queries/programsQueries' -import type { Module, Program } from 'types/mentorship' +import { + GetProgramAndModulesDocument, + GetProgramAndModulesQuery, +} from 'types/__generated__/programsQueries.generated' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' @@ -19,14 +21,14 @@ const ProgramDetailsPage = () => { data, refetch, loading: isQueryLoading, - } = useQuery(GET_PROGRAM_AND_MODULES, { + } = useQuery(GetProgramAndModulesDocument, { variables: { programKey }, skip: !programKey, notifyOnNetworkStatusChange: true, }) - const [program, setProgram] = useState(null) - const [modules, setModules] = useState([]) + const [program, setProgram] = useState(null) + const [modules, setModules] = useState([]) const [isRefetching, setIsRefetching] = useState(false) const isLoading = isQueryLoading || isRefetching @@ -70,8 +72,8 @@ const ProgramDetailsPage = () => { const programDetails = [ { label: 'Status', value: upperFirst(program.status) }, - { label: 'Start Date', value: formatDate(program.startedAt) }, - { label: 'End Date', value: formatDate(program.endedAt) }, + { label: 'Start Date', value: formatDate(program.startedAt as string) }, + { label: 'End Date', value: formatDate(program.endedAt as string) }, { label: 'Mentees Limit', value: String(program.menteesLimit) }, { label: 'Experience Levels', diff --git a/frontend/src/app/my/mentorship/page.tsx b/frontend/src/app/my/mentorship/page.tsx index 96d71e98b1..d8fb5e235f 100644 --- a/frontend/src/app/my/mentorship/page.tsx +++ b/frontend/src/app/my/mentorship/page.tsx @@ -8,9 +8,11 @@ import { useRouter, useSearchParams } from 'next/navigation' import { useSession } from 'next-auth/react' import React, { useEffect, useMemo, useState } from 'react' -import { GET_MY_PROGRAMS } from 'server/queries/programsQueries' +import { + GetMyProgramsDocument, + GetMyProgramsQuery, +} from 'types/__generated__/programsQueries.generated' import type { ExtendedSession } from 'types/auth' -import type { Program } from 'types/mentorship' import ActionButton from 'components/ActionButton' import LoadingSpinner from 'components/LoadingSpinner' @@ -29,7 +31,7 @@ const MyMentorshipPage: React.FC = () => { const [searchQuery, setSearchQuery] = useState(initialQuery) const [debouncedQuery, setDebouncedQuery] = useState(initialQuery) const [page, setPage] = useState(initialPage) - const [programs, setPrograms] = useState([]) + const [programs, setPrograms] = useState([]) const [totalPages, setTotalPages] = useState(1) const debounceSearch = useMemo(() => debounce((q) => setDebouncedQuery(q), 400), []) @@ -53,7 +55,7 @@ const MyMentorshipPage: React.FC = () => { data: programData, loading: loadingPrograms, error, - } = useQuery(GET_MY_PROGRAMS, { + } = useQuery(GetMyProgramsDocument, { variables: { search: debouncedQuery, page, limit: 24 }, fetchPolicy: 'cache-and-network', errorPolicy: 'all', @@ -138,7 +140,7 @@ const MyMentorshipPage: React.FC = () => { diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx index 0f027209eb..c5f341b92f 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx @@ -7,7 +7,7 @@ import type React from 'react' import { useState, useEffect } from 'react' import { ErrorDisplay, handleAppError } from 'app/global-error' import { UPDATE_PROGRAM } from 'server/mutations/programsMutations' -import { GET_PROGRAM_DETAILS } from 'server/queries/programsQueries' +import { GetProgramDetailsDocument } from 'types/__generated__/programsQueries.generated' import type { ExtendedSession } from 'types/auth' import { formatDateForInput } from 'utils/dateFormatter' import { parseCommaSeparated } from 'utils/parser' @@ -23,7 +23,7 @@ const EditProgramPage = () => { data, error, loading: queryLoading, - } = useQuery(GET_PROGRAM_DETAILS, { + } = useQuery(GetProgramDetailsDocument, { variables: { programKey }, skip: !programKey, fetchPolicy: 'network-only', @@ -74,8 +74,8 @@ const EditProgramPage = () => { name: program.name || '', description: program.description || '', menteesLimit: program.menteesLimit ?? 5, - startedAt: formatDateForInput(program.startedAt), - endedAt: formatDateForInput(program.endedAt), + startedAt: formatDateForInput(program.startedAt as string), + endedAt: formatDateForInput(program.endedAt as string), tags: (program.tags || []).join(', '), domains: (program.domains || []).join(', '), adminLogins: (program.admins || []) diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx index 587ce39468..e24940fa2a 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx @@ -4,20 +4,22 @@ import upperFirst from 'lodash/upperFirst' import { useParams } from 'next/navigation' import { useEffect, useState } from 'react' import { ErrorDisplay, handleAppError } from 'app/global-error' -import { GET_PROGRAM_ADMINS_AND_MODULES } from 'server/queries/moduleQueries' -import type { Module } from 'types/mentorship' +import { + GetProgramAdminsAndModulesDocument, + GetProgramAdminsAndModulesQuery, +} from 'types/__generated__/moduleQueries.generated' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' import { getSimpleDuration } from 'components/ModuleCard' const ModuleDetailsPage = () => { - const { programKey, moduleKey } = useParams() - const [module, setModule] = useState(null) + const { programKey, moduleKey } = useParams<{ programKey: string; moduleKey: string }>() + const [module, setModule] = useState(null) const [admins, setAdmins] = useState(null) const [isLoading, setIsLoading] = useState(true) - const { data, error } = useQuery(GET_PROGRAM_ADMINS_AND_MODULES, { + const { data, error } = useQuery(GetProgramAdminsAndModulesDocument, { variables: { programKey, moduleKey, @@ -49,11 +51,11 @@ const ModuleDetailsPage = () => { const moduleDetails = [ { label: 'Experience Level', value: upperFirst(module.experienceLevel) }, - { label: 'Start Date', value: formatDate(module.startedAt) }, - { label: 'End Date', value: formatDate(module.endedAt) }, + { label: 'Start Date', value: formatDate(module.startedAt as string) }, + { label: 'End Date', value: formatDate(module.endedAt as string) }, { label: 'Duration', - value: getSimpleDuration(module.startedAt, module.endedAt), + value: getSimpleDuration(module.startedAt as string, module.endedAt as string), }, ] diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx index 4890b947f3..a7eb8329cc 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx @@ -7,9 +7,11 @@ import { useSession } from 'next-auth/react' import { useEffect, useMemo, useState } from 'react' import { ErrorDisplay, handleAppError } from 'app/global-error' import { UPDATE_PROGRAM_STATUS_MUTATION } from 'server/mutations/programsMutations' -import { GET_PROGRAM_AND_MODULES } from 'server/queries/programsQueries' +import { + GetProgramAndModulesDocument, + GetProgramAndModulesQuery, +} from 'types/__generated__/programsQueries.generated' import type { ExtendedSession } from 'types/auth' -import type { Module, Program } from 'types/mentorship' import { ProgramStatusEnum } from 'types/mentorship' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' @@ -24,10 +26,11 @@ const ProgramDetailsPage = () => { const { data: session } = useSession() const username = (session as ExtendedSession)?.user?.login - const [program, setProgram] = useState(null) - const [modules, setModules] = useState([]) + const [program, setProgram] = useState(null) + const [modules, setModules] = useState([]) const [isRefetching, setIsRefetching] = useState(false) + // TODO: update type const [updateProgram] = useMutation(UPDATE_PROGRAM_STATUS_MUTATION, { onError: handleAppError, }) @@ -36,7 +39,7 @@ const ProgramDetailsPage = () => { data, refetch, loading: isQueryLoading, - } = useQuery(GET_PROGRAM_AND_MODULES, { + } = useQuery(GetProgramAndModulesDocument, { variables: { programKey }, skip: !programKey, notifyOnNetworkStatusChange: true, @@ -75,7 +78,7 @@ const ProgramDetailsPage = () => { status: newStatus, }, }, - refetchQueries: [{ query: GET_PROGRAM_AND_MODULES, variables: { programKey } }], + refetchQueries: [{ query: GetProgramAndModulesDocument, variables: { programKey } }], }) addToast({ @@ -128,8 +131,8 @@ const ProgramDetailsPage = () => { const programDetails = [ { label: 'Status', value: upperFirst(program.status) }, - { label: 'Start Date', value: formatDate(program.startedAt) }, - { label: 'End Date', value: formatDate(program.endedAt) }, + { label: 'Start Date', value: formatDate(program.startedAt as string) }, + { label: 'End Date', value: formatDate(program.endedAt as string) }, { label: 'Mentees Limit', value: String(program.menteesLimit) }, { label: 'Experience Levels', diff --git a/frontend/src/app/organizations/[organizationKey]/page.tsx b/frontend/src/app/organizations/[organizationKey]/page.tsx index 220d5fc39e..1541f91d95 100644 --- a/frontend/src/app/organizations/[organizationKey]/page.tsx +++ b/frontend/src/app/organizations/[organizationKey]/page.tsx @@ -11,12 +11,12 @@ import Link from 'next/link' import { useParams } from 'next/navigation' import { useState, useEffect } from 'react' import { handleAppError, ErrorDisplay } from 'app/global-error' -import { GET_ORGANIZATION_DATA } from 'server/queries/organizationQueries' +import { GetOrganizationDataDocument } from 'types/__generated__/organizationQueries.generated' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' const OrganizationDetailsPage = () => { - const { organizationKey } = useParams() + const { organizationKey } = useParams<{ organizationKey: string }>() const [organization, setOrganization] = useState(null) const [issues, setIssues] = useState(null) const [milestones, setMilestones] = useState(null) @@ -25,7 +25,7 @@ const OrganizationDetailsPage = () => { const [repositories, setRepositories] = useState(null) const [topContributors, setTopContributors] = useState(null) const [isLoading, setIsLoading] = useState(true) - const { data: graphQLData, error: graphQLRequestError } = useQuery(GET_ORGANIZATION_DATA, { + const { data: graphQLData, error: graphQLRequestError } = useQuery(GetOrganizationDataDocument, { variables: { login: organizationKey }, }) diff --git a/frontend/src/app/projects/[projectKey]/page.tsx b/frontend/src/app/projects/[projectKey]/page.tsx index 4fd3b572d8..e9e7fff489 100644 --- a/frontend/src/app/projects/[projectKey]/page.tsx +++ b/frontend/src/app/projects/[projectKey]/page.tsx @@ -12,18 +12,16 @@ import Link from 'next/link' import { useParams } from 'next/navigation' import { useState, useEffect } from 'react' import { ErrorDisplay, handleAppError } from 'app/global-error' -import { GET_PROJECT_DATA } from 'server/queries/projectQueries' -import type { Contributor } from 'types/contributor' -import type { Project } from 'types/project' +import { GetProjectDocument, GetProjectQuery } from 'types/__generated__/projectQueries.generated' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' const ProjectDetailsPage = () => { - const { projectKey } = useParams() + const { projectKey } = useParams<{ projectKey: string }>() const [isLoading, setIsLoading] = useState(true) - const [project, setProject] = useState(null) - const [topContributors, setTopContributors] = useState([]) - const { data, error: graphQLRequestError } = useQuery(GET_PROJECT_DATA, { + const [project, setProject] = useState(null) + const [topContributors, setTopContributors] = useState([]) + const { data, error: graphQLRequestError } = useQuery(GetProjectDocument, { variables: { key: projectKey }, }) useEffect(() => { diff --git a/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx b/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx index fb0bfe0e47..35caa7291c 100644 --- a/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx +++ b/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx @@ -14,8 +14,10 @@ import { import { useParams } from 'next/navigation' import { FC, useState, useEffect } from 'react' import { handleAppError } from 'app/global-error' -import { GET_PROJECT_HEALTH_METRICS_DETAILS } from 'server/queries/projectsHealthDashboardQueries' -import { HealthMetricsProps } from 'types/healthMetrics' +import { + GetProjectHealthMetricsDetailsDocument, + GetProjectHealthMetricsDetailsQuery, +} from 'types/__generated__/projectsHealthDashboardQueries.generated' import BarChart from 'components/BarChart' import GeneralCompliantComponent from 'components/GeneralCompliantComponent' import LineChart from 'components/LineChart' @@ -24,14 +26,16 @@ import MetricsPDFButton from 'components/MetricsPDFButton' import MetricsScoreCircle from 'components/MetricsScoreCircle' const ProjectHealthMetricsDetails: FC = () => { - const { projectKey } = useParams() - const [metricsList, setMetricsList] = useState() - const [metricsLatest, setMetricsLatest] = useState() + const { projectKey } = useParams<{ projectKey: string }>() + const [metricsList, setMetricsList] = + useState() + const [metricsLatest, setMetricsLatest] = + useState() const { loading, error: graphqlError, data, - } = useQuery(GET_PROJECT_HEALTH_METRICS_DETAILS, { + } = useQuery(GetProjectHealthMetricsDetailsDocument, { variables: { projectKey }, }) @@ -53,7 +57,7 @@ const ProjectHealthMetricsDetails: FC = () => { const labels = metricsList?.map((m) => - new Date(m.createdAt).toLocaleString('default', { + new Date(m.createdAt as string).toLocaleString('default', { month: 'short', day: 'numeric', }) diff --git a/frontend/src/app/projects/dashboard/metrics/page.tsx b/frontend/src/app/projects/dashboard/metrics/page.tsx index ff7a94ed7c..20015ca6be 100644 --- a/frontend/src/app/projects/dashboard/metrics/page.tsx +++ b/frontend/src/app/projects/dashboard/metrics/page.tsx @@ -5,9 +5,12 @@ import { Pagination } from '@heroui/react' import { useSearchParams, useRouter } from 'next/navigation' import { FC, useState, useEffect } from 'react' import { handleAppError } from 'app/global-error' -import { GET_PROJECT_HEALTH_METRICS_LIST } from 'server/queries/projectsHealthDashboardQueries' +import { Ordering } from 'types/__generated__/graphql' +import { + GetProjectHealthMetricsDocument, + GetProjectHealthMetricsQuery, +} from 'types/__generated__/projectsHealthDashboardQueries.generated' import { DropDownSectionProps } from 'types/DropDownSectionProps' -import { HealthMetricsProps } from 'types/healthMetrics' import { getKeysLabels } from 'utils/getKeysLabels' import LoadingSpinner from 'components/LoadingSpinner' import MetricsCard from 'components/MetricsCard' @@ -53,11 +56,11 @@ const MetricsPage: FC = () => { let currentFilters = {} let currentOrdering = { - score: 'DESC', + score: Ordering.Desc, } const healthFilter = searchParams.get('health') const levelFilter = searchParams.get('level') - const orderingParam = searchParams.get('order') + const orderingParam = searchParams.get('order') as Ordering const currentFilterKeys = [] if (healthFilter) { currentFilters = { @@ -74,34 +77,38 @@ const MetricsPage: FC = () => { } if (orderingParam) { currentOrdering = { - score: orderingParam.toUpperCase(), + score: orderingParam, } } - const [metrics, setMetrics] = useState([]) - const [metricsLength, setMetricsLength] = useState(0) + const [metrics, setMetrics] = useState([]) + const [metricsLength, setMetricsLength] = + useState(0) const [pagination, setPagination] = useState({ offset: 0, limit: PAGINATION_LIMIT }) const [filters, setFilters] = useState(currentFilters) const [ordering, setOrdering] = useState( currentOrdering || { - score: 'DESC', + score: Ordering.Desc, } ) const [activeFilters, setActiveFilters] = useState(currentFilterKeys) - const [activeOrdering, setActiveOrdering] = useState(orderingParam ? [orderingParam] : ['desc']) + const [activeOrdering, setActiveOrdering] = useState( + orderingParam ? [orderingParam] : [Ordering.Desc] + ) const { data, error: graphQLRequestError, loading, fetchMore, - } = useQuery(GET_PROJECT_HEALTH_METRICS_LIST, { + } = useQuery(GetProjectHealthMetricsDocument, { variables: { filters, pagination: { offset: 0, limit: PAGINATION_LIMIT }, ordering: [ ordering, { - ['project_Name']: 'ASC', + // eslint-disable-next-line @typescript-eslint/naming-convention + project_Name: Ordering.Asc, }, ], }, @@ -202,13 +209,13 @@ const MetricsPage: FC = () => { selectionMode="single" selectedKeys={activeOrdering} selectedLabels={getKeysLabels(orderingSections, activeOrdering)} - onAction={(key: string) => { + onAction={(key: Ordering) => { // Reset pagination to the first page when changing ordering setPagination({ offset: 0, limit: PAGINATION_LIMIT }) const newParams = new URLSearchParams(searchParams.toString()) newParams.set('order', key) setOrdering({ - score: key.toUpperCase(), + score: key, }) setActiveOrdering([key]) router.replace(`/projects/dashboard/metrics?${newParams.toString()}`) @@ -234,7 +241,7 @@ const MetricsPage: FC = () => { No metrics found. Try adjusting your filters. ) : ( - metrics.map((metric) => ) + metrics.map((metric) => ) //TODO: update types )}
@@ -253,7 +260,8 @@ const MetricsPage: FC = () => { ordering: [ ordering, { - ['project_Name']: 'ASC', + // eslint-disable-next-line @typescript-eslint/naming-convention + project_Name: Ordering.Asc, }, ], }, diff --git a/frontend/src/app/projects/dashboard/page.tsx b/frontend/src/app/projects/dashboard/page.tsx index e5e2941187..3b800f22b9 100644 --- a/frontend/src/app/projects/dashboard/page.tsx +++ b/frontend/src/app/projects/dashboard/page.tsx @@ -15,8 +15,10 @@ import { import millify from 'millify' import { useState, useEffect, FC } from 'react' import { handleAppError } from 'app/global-error' -import { GET_PROJECT_HEALTH_STATS } from 'server/queries/projectsHealthDashboardQueries' -import type { ProjectHealthStats } from 'types/projectHealthStats' +import { + GetProjectHealthStatsDocument, + GetProjectHealthStatsQuery, +} from 'types/__generated__/projectsHealthDashboardQueries.generated' import DashboardCard from 'components/DashboardCard' import DonutBarChart from 'components/DonutBarChart' import LineChart from 'components/LineChart' @@ -25,9 +27,9 @@ import MetricsPDFButton from 'components/MetricsPDFButton' import ProjectTypeDashboardCard from 'components/ProjectTypeDashboardCard' const ProjectsDashboardPage: FC = () => { - const [stats, setStats] = useState() + const [stats, setStats] = useState() const [isLoading, setIsLoading] = useState(true) - const { data, error: graphQLRequestError } = useQuery(GET_PROJECT_HEALTH_STATS) + const { data, error: graphQLRequestError } = useQuery(GetProjectHealthStatsDocument) useEffect(() => { if (data) { diff --git a/frontend/src/app/settings/api-keys/page.tsx b/frontend/src/app/settings/api-keys/page.tsx index 1f13cbb84a..2dc732d9ad 100644 --- a/frontend/src/app/settings/api-keys/page.tsx +++ b/frontend/src/app/settings/api-keys/page.tsx @@ -17,8 +17,12 @@ import { Input } from '@heroui/react' import { addToast } from '@heroui/toast' import { format, addDays } from 'date-fns' import { useState } from 'react' -import { CREATE_API_KEY, GET_API_KEYS, REVOKE_API_KEY } from 'server/queries/apiKeyQueries' -import type { ApiKey } from 'types/apiKey' +import { + CreateApiKeyDocument, + GetApiKeysDocument, + GetApiKeysQuery, + RevokeApiKeyDocument, +} from 'types/__generated__/apiKeyQueries.generated' import SecondaryCard from 'components/SecondaryCard' import { ApiKeysSkeleton } from 'components/skeletons/ApiKeySkelton' @@ -30,14 +34,14 @@ export default function Page() { const [newKeyExpiry, setNewKeyExpiry] = useState('') const [showNewKey, setShowNewKey] = useState(false) const [newlyCreatedKey, setNewlyCreatedKey] = useState(null) - const [keyToRevoke, setKeyToRevoke] = useState(null) + const [keyToRevoke, setKeyToRevoke] = useState(null) - const { loading, error, data, refetch } = useQuery(GET_API_KEYS, { + const { loading, error, data, refetch } = useQuery(GetApiKeysDocument, { notifyOnNetworkStatusChange: true, errorPolicy: 'all', }) - const [createApiKey, { loading: createLoading }] = useMutation(CREATE_API_KEY, { + const [createApiKey, { loading: createLoading }] = useMutation(CreateApiKeyDocument, { onCompleted: (data) => { const result = data.createApiKey if (!result?.ok) { @@ -61,7 +65,7 @@ export default function Page() { }, }) - const [revokeApiKey] = useMutation(REVOKE_API_KEY, { + const [revokeApiKey] = useMutation(RevokeApiKeyDocument, { onCompleted: () => { addToast({ title: 'Success', description: 'API key revoked', color: 'success' }) refetch() @@ -235,16 +239,16 @@ export default function Page() { - {data.apiKeys.map((key: ApiKey) => ( + {data.apiKeys.map((key: GetApiKeysQuery['apiKeys'][0]) => ( {key.name} - {key.uuid} - {format(new Date(key.createdAt), 'PP')} + {key.uuid as string} + {format(new Date(key.createdAt as string), 'PP')} - {key.expiresAt ? format(new Date(key.expiresAt), 'PP') : 'Never'} + {key.expiresAt ? format(new Date(key.expiresAt as string), 'PP') : 'Never'}
@@ -135,27 +137,30 @@ const SnapshotDetailsPage: React.FC = () => {
+ {' '} + // TODO: update type {snapshot.newChapters.filter((chapter) => chapter.isActive).map(renderChapterCard)}
)} - {snapshot.newProjects && snapshot.newProjects.length > 0 && ( -
-

- New Projects -

-
- {snapshot.newProjects.filter((project) => project.isActive).map(renderProjectCard)} + {snapshot.newProjects && + snapshot.newProjects.length > 0 && ( // TODO: update type +
+

+ New Projects +

+
+ {snapshot.newProjects.filter((project) => project.isActive).map(renderProjectCard)} +
-
- )} + )} {snapshot.newReleases && snapshot.newReleases.length > 0 && (
@@ -182,7 +187,7 @@ const SnapshotDetailsPage: React.FC = () => {
- Released: {formatDate(release.publishedAt)} + Released: {formatDate(release.publishedAt as string)}
diff --git a/frontend/src/app/snapshots/page.tsx b/frontend/src/app/snapshots/page.tsx index 3ccaa6f763..6841debcd2 100644 --- a/frontend/src/app/snapshots/page.tsx +++ b/frontend/src/app/snapshots/page.tsx @@ -4,16 +4,19 @@ import { addToast } from '@heroui/toast' import { useRouter } from 'next/navigation' import React, { useState, useEffect } from 'react' import FontAwesomeIconWrapper from 'wrappers/FontAwesomeIconWrapper' -import { GET_COMMUNITY_SNAPSHOTS } from 'server/queries/snapshotQueries' +import { + GetCommunitySnapshotsDocument, + GetCommunitySnapshotsQuery, +} from 'types/__generated__/snapshotQueries.generated' import type { Snapshot } from 'types/snapshot' import LoadingSpinner from 'components/LoadingSpinner' import SnapshotCard from 'components/SnapshotCard' const SnapshotsPage: React.FC = () => { - const [snapshots, setSnapshots] = useState(null) + const [snapshots, setSnapshots] = useState(null) const [isLoading, setIsLoading] = useState(true) - const { data: graphQLData, error: graphQLRequestError } = useQuery(GET_COMMUNITY_SNAPSHOTS) + const { data: graphQLData, error: graphQLRequestError } = useQuery(GetCommunitySnapshotsDocument) useEffect(() => { if (graphQLData) { @@ -68,9 +71,11 @@ const SnapshotsPage: React.FC = () => { {!snapshots?.length ? (
No Snapshots found
) : ( - snapshots.map((snapshot: Snapshot) => ( -
{renderSnapshotCard(snapshot)}
- )) + snapshots.map( + ( + snapshot: GetCommunitySnapshotsQuery['snapshots'][0] // TODO: update type + ) =>
{renderSnapshotCard(snapshot)}
+ ) )} diff --git a/frontend/src/components/CardDetailsPage.tsx b/frontend/src/components/CardDetailsPage.tsx index 0e288b327b..3990d0d4ad 100644 --- a/frontend/src/components/CardDetailsPage.tsx +++ b/frontend/src/components/CardDetailsPage.tsx @@ -35,6 +35,7 @@ import SponsorCard from 'components/SponsorCard' import ToggleableList from 'components/ToggleableList' import TopContributorsList from 'components/TopContributorsList' +// TODO: update types const DetailsCard = ({ description, details, diff --git a/frontend/src/components/ModuleForm.tsx b/frontend/src/components/ModuleForm.tsx index d8291983c8..52390b4688 100644 --- a/frontend/src/components/ModuleForm.tsx +++ b/frontend/src/components/ModuleForm.tsx @@ -5,7 +5,7 @@ import debounce from 'lodash/debounce' import { useRouter } from 'next/navigation' import type React from 'react' import { useState, useEffect, useCallback, useRef } from 'react' -import { SEARCH_PROJECTS } from 'server/queries/projectQueries' +import { SearchProjectNamesDocument } from 'types/__generated__/projectQueries.generated' interface ModuleFormProps { formData: { @@ -271,7 +271,7 @@ export const ProjectSelector = ({ value, defaultName, onProjectChange }: Project try { const { data } = await client.query({ - query: SEARCH_PROJECTS, + query: SearchProjectNamesDocument, variables: { query }, }) diff --git a/frontend/src/hooks/useDjangoSession.ts b/frontend/src/hooks/useDjangoSession.ts index 50adabf2d4..9a26c0905a 100644 --- a/frontend/src/hooks/useDjangoSession.ts +++ b/frontend/src/hooks/useDjangoSession.ts @@ -2,7 +2,7 @@ import { useMutation } from '@apollo/client/react' import { addToast } from '@heroui/toast' import { useSession, signOut } from 'next-auth/react' import { useEffect, useState } from 'react' -import { SYNC_DJANGO_SESSION_MUTATION } from 'server/queries/authQueries' +import { SyncDjangoSessionDocument } from 'types/__generated__/authQueries.generated' import { ExtendedSession } from 'types/auth' const SYNC_STATUS_KEY = 'django_session_synced' @@ -13,7 +13,7 @@ export const useDjangoSession: () => { status: string } = () => { const { data: session, status, update } = useSession() - const [syncSession, { loading }] = useMutation(SYNC_DJANGO_SESSION_MUTATION) + const [syncSession, { loading }] = useMutation(SyncDjangoSessionDocument) const [isSyncing, setIsSyncing] = useState(false) useEffect(() => { diff --git a/frontend/src/server/queries/userQueries.ts b/frontend/src/server/queries/userQueries.ts index dd9c24cb76..5bf0573638 100644 --- a/frontend/src/server/queries/userQueries.ts +++ b/frontend/src/server/queries/userQueries.ts @@ -5,6 +5,8 @@ export const GET_LEADER_DATA = gql` user(login: $key) { id avatarUrl + company + location login name } diff --git a/frontend/src/types/__generated__/userQueries.generated.ts b/frontend/src/types/__generated__/userQueries.generated.ts index 5455b2eae6..6d50491dfc 100644 --- a/frontend/src/types/__generated__/userQueries.generated.ts +++ b/frontend/src/types/__generated__/userQueries.generated.ts @@ -6,7 +6,7 @@ export type GetLeaderDataQueryVariables = Types.Exact<{ }>; -export type GetLeaderDataQuery = { user: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }; +export type GetLeaderDataQuery = { user: { __typename: 'UserNode', id: string, avatarUrl: string, company: string, location: string, login: string, name: string } | null }; export type GetUserDataQueryVariables = Types.Exact<{ key: Types.Scalars['String']['input']; @@ -23,6 +23,6 @@ export type GetUserMetadataQueryVariables = Types.Exact<{ export type GetUserMetadataQuery = { user: { __typename: 'UserNode', id: string, bio: string, login: string, name: string } | null }; -export const GetLeaderDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaderData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const GetLeaderDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaderData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const GetUserDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetUserData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"recentIssues"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"closedIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentPullRequests"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentReleases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isPreRelease"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"tagName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"topContributedRepositories"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"organization"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"login"}}]}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"subscribersCount"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"bio"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"contributionsCount"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"followersCount"}},{"kind":"Field","name":{"kind":"Name","value":"followingCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"publicRepositoriesCount"}},{"kind":"Field","name":{"kind":"Name","value":"releasesCount"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const GetUserMetadataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetUserMetadata"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"bio"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file From e50807ca7b8357720532932153f2fd4dbc8ce9bf Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Sun, 21 Sep 2025 14:59:07 +0530 Subject: [PATCH 06/25] revert type changes --- frontend/src/app/about/page.tsx | 12 +++----- .../src/app/chapters/[chapterKey]/page.tsx | 12 +++----- .../app/committees/[committeeKey]/page.tsx | 8 ++--- frontend/src/app/members/[memberKey]/page.tsx | 22 ++++++++------ .../[programKey]/modules/[moduleKey]/page.tsx | 8 ++--- .../mentorship/programs/[programKey]/page.tsx | 10 +++---- frontend/src/app/my/mentorship/page.tsx | 10 +++---- .../[programKey]/modules/[moduleKey]/page.tsx | 8 ++--- .../mentorship/programs/[programKey]/page.tsx | 12 +++----- .../src/app/projects/[projectKey]/page.tsx | 8 +++-- .../dashboard/metrics/[projectKey]/page.tsx | 12 +++----- .../app/projects/dashboard/metrics/page.tsx | 13 ++++---- frontend/src/app/projects/dashboard/page.tsx | 8 ++--- frontend/src/app/settings/api-keys/page.tsx | 6 ++-- frontend/src/app/snapshots/[id]/page.tsx | 30 ++++++++----------- frontend/src/app/snapshots/page.tsx | 15 ++++------ frontend/src/components/CardDetailsPage.tsx | 1 - 17 files changed, 80 insertions(+), 115 deletions(-) diff --git a/frontend/src/app/about/page.tsx b/frontend/src/app/about/page.tsx index 7fa811bb98..20e0fd3706 100644 --- a/frontend/src/app/about/page.tsx +++ b/frontend/src/app/about/page.tsx @@ -21,14 +21,14 @@ import FontAwesomeIconWrapper from 'wrappers/FontAwesomeIconWrapper' import { ErrorDisplay, handleAppError } from 'app/global-error' import { GetProjectMetadataDocument, - GetProjectMetadataQuery, GetTopContributorsDocument, - GetTopContributorsQuery, } from 'types/__generated__/projectQueries.generated' import { GetLeaderDataDocument, GetLeaderDataQuery, } from 'types/__generated__/userQueries.generated' +import { Contributor } from 'types/contributor' +import { Project } from 'types/project' import { aboutText, technologies } from 'utils/aboutData' import AnchorTitle from 'components/AnchorTitle' import AnimatedCounter from 'components/AnimatedCounter' @@ -65,12 +65,8 @@ const About = () => { } ) - const [projectMetadata, setProjectMetadata] = useState( - null - ) - const [topContributors, setTopContributors] = useState< - GetTopContributorsQuery['topContributors'] - >([]) + const [projectMetadata, setProjectMetadata] = useState(null) + const [topContributors, setTopContributors] = useState([]) useEffect(() => { if (projectMetadataResponse?.project) { diff --git a/frontend/src/app/chapters/[chapterKey]/page.tsx b/frontend/src/app/chapters/[chapterKey]/page.tsx index 54ccf8cff7..9c004a3779 100644 --- a/frontend/src/app/chapters/[chapterKey]/page.tsx +++ b/frontend/src/app/chapters/[chapterKey]/page.tsx @@ -4,10 +4,8 @@ import Link from 'next/link' import { useParams } from 'next/navigation' import { useState, useEffect } from 'react' import { handleAppError, ErrorDisplay } from 'app/global-error' -import { - GetChapterDataDocument, - GetChapterDataQuery, -} from 'types/__generated__/chapterQueries.generated' +import { GetChapterDataDocument } from 'types/__generated__/chapterQueries.generated' +import { Chapter } from 'types/chapter' import type { Contributor } from 'types/contributor' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' @@ -15,9 +13,7 @@ import LoadingSpinner from 'components/LoadingSpinner' export default function ChapterDetailsPage() { const { chapterKey } = useParams<{ chapterKey: string }>() - const [chapter, setChapter] = useState( - {} as GetChapterDataQuery['chapter'] - ) + const [chapter, setChapter] = useState({} as Chapter) const [topContributors, setTopContributors] = useState([]) const [isLoading, setIsLoading] = useState(true) @@ -67,7 +63,7 @@ export default function ChapterDetailsPage() { () - const [committee, setCommittee] = useState(null) + const [committee, setCommittee] = useState(null) const [topContributors, setTopContributors] = useState([]) const [isLoading, setIsLoading] = useState(true) diff --git a/frontend/src/app/members/[memberKey]/page.tsx b/frontend/src/app/members/[memberKey]/page.tsx index 458033feac..08b7ea6bd0 100644 --- a/frontend/src/app/members/[memberKey]/page.tsx +++ b/frontend/src/app/members/[memberKey]/page.tsx @@ -12,7 +12,13 @@ import { useParams } from 'next/navigation' import { useTheme } from 'next-themes' import React, { useState, useEffect, useRef } from 'react' import { handleAppError, ErrorDisplay } from 'app/global-error' -import { GetUserDataDocument, GetUserDataQuery } from 'types/__generated__/userQueries.generated' +import { GetUserDataDocument } from 'types/__generated__/userQueries.generated' +import type { Issue } from 'types/issue' +import type { Milestone } from 'types/milestone' +import type { RepositoryCardProps } from 'types/project' +import type { PullRequest } from 'types/pullRequest' +import type { Release } from 'types/release' +import type { UserDetails } from 'types/user' import { formatDate } from 'utils/dateFormatter' import { drawContributions, fetchHeatmapData, HeatmapData } from 'utils/helpers/githubHeatmap' import DetailsCard from 'components/CardDetailsPage' @@ -20,14 +26,12 @@ import LoadingSpinner from 'components/LoadingSpinner' const UserDetailsPage: React.FC = () => { const { memberKey } = useParams<{ memberKey: string }>() - const [user, setUser] = useState() - const [issues, setIssues] = useState([]) - const [topRepositories, setTopRepositories] = useState< - GetUserDataQuery['topContributedRepositories'] - >([]) - const [milestones, setMilestones] = useState([]) - const [pullRequests, setPullRequests] = useState([]) - const [releases, setReleases] = useState([]) + const [user, setUser] = useState() + const [issues, setIssues] = useState([]) + const [topRepositories, setTopRepositories] = useState([]) + const [milestones, setMilestones] = useState([]) + const [pullRequests, setPullRequests] = useState([]) + const [releases, setReleases] = useState([]) const [data, setData] = useState({} as HeatmapData) const [isLoading, setIsLoading] = useState(true) const [username, setUsername] = useState('') diff --git a/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx b/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx index fa6cd64485..f756671470 100644 --- a/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx +++ b/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx @@ -1,13 +1,11 @@ 'use client' +import Module from 'module' import { useQuery } from '@apollo/client/react' import upperFirst from 'lodash/upperFirst' import { useParams } from 'next/navigation' import { useEffect, useState } from 'react' import { ErrorDisplay, handleAppError } from 'app/global-error' -import { - GetProgramAdminsAndModulesDocument, - GetProgramAdminsAndModulesQuery, -} from 'types/__generated__/moduleQueries.generated' +import { GetProgramAdminsAndModulesDocument } from 'types/__generated__/moduleQueries.generated' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' @@ -15,7 +13,7 @@ import { getSimpleDuration } from 'components/ModuleCard' const ModuleDetailsPage = () => { const { programKey, moduleKey } = useParams<{ programKey: string; moduleKey: string }>() - const [module, setModule] = useState(null) + const [module, setModule] = useState(null) const [admins, setAdmins] = useState(null) const [isLoading, setIsLoading] = useState(true) diff --git a/frontend/src/app/mentorship/programs/[programKey]/page.tsx b/frontend/src/app/mentorship/programs/[programKey]/page.tsx index 4c94f71412..fc56249ccd 100644 --- a/frontend/src/app/mentorship/programs/[programKey]/page.tsx +++ b/frontend/src/app/mentorship/programs/[programKey]/page.tsx @@ -4,10 +4,8 @@ import upperFirst from 'lodash/upperFirst' import { useParams, useSearchParams, useRouter } from 'next/navigation' import { useEffect, useState } from 'react' import { ErrorDisplay } from 'app/global-error' -import { - GetProgramAndModulesDocument, - GetProgramAndModulesQuery, -} from 'types/__generated__/programsQueries.generated' +import { GetProgramAndModulesDocument } from 'types/__generated__/programsQueries.generated' +import { Program, Module } from 'types/mentorship' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' @@ -27,8 +25,8 @@ const ProgramDetailsPage = () => { notifyOnNetworkStatusChange: true, }) - const [program, setProgram] = useState(null) - const [modules, setModules] = useState([]) + const [program, setProgram] = useState(null) + const [modules, setModules] = useState([]) const [isRefetching, setIsRefetching] = useState(false) const isLoading = isQueryLoading || isRefetching diff --git a/frontend/src/app/my/mentorship/page.tsx b/frontend/src/app/my/mentorship/page.tsx index d8fb5e235f..6cedaa73a6 100644 --- a/frontend/src/app/my/mentorship/page.tsx +++ b/frontend/src/app/my/mentorship/page.tsx @@ -8,12 +8,10 @@ import { useRouter, useSearchParams } from 'next/navigation' import { useSession } from 'next-auth/react' import React, { useEffect, useMemo, useState } from 'react' -import { - GetMyProgramsDocument, - GetMyProgramsQuery, -} from 'types/__generated__/programsQueries.generated' +import { GetMyProgramsDocument } from 'types/__generated__/programsQueries.generated' import type { ExtendedSession } from 'types/auth' +import { Program } from 'types/mentorship' import ActionButton from 'components/ActionButton' import LoadingSpinner from 'components/LoadingSpinner' import ProgramCard from 'components/ProgramCard' @@ -31,7 +29,7 @@ const MyMentorshipPage: React.FC = () => { const [searchQuery, setSearchQuery] = useState(initialQuery) const [debouncedQuery, setDebouncedQuery] = useState(initialQuery) const [page, setPage] = useState(initialPage) - const [programs, setPrograms] = useState([]) + const [programs, setPrograms] = useState([]) const [totalPages, setTotalPages] = useState(1) const debounceSearch = useMemo(() => debounce((q) => setDebouncedQuery(q), 400), []) @@ -140,7 +138,7 @@ const MyMentorshipPage: React.FC = () => { diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx index e24940fa2a..f55426e569 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx @@ -4,10 +4,8 @@ import upperFirst from 'lodash/upperFirst' import { useParams } from 'next/navigation' import { useEffect, useState } from 'react' import { ErrorDisplay, handleAppError } from 'app/global-error' -import { - GetProgramAdminsAndModulesDocument, - GetProgramAdminsAndModulesQuery, -} from 'types/__generated__/moduleQueries.generated' +import { GetProgramAdminsAndModulesDocument } from 'types/__generated__/moduleQueries.generated' +import { Module } from 'types/mentorship' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' @@ -15,7 +13,7 @@ import { getSimpleDuration } from 'components/ModuleCard' const ModuleDetailsPage = () => { const { programKey, moduleKey } = useParams<{ programKey: string; moduleKey: string }>() - const [module, setModule] = useState(null) + const [module, setModule] = useState(null) const [admins, setAdmins] = useState(null) const [isLoading, setIsLoading] = useState(true) diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx index a7eb8329cc..b4fdb5d97b 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx @@ -7,12 +7,9 @@ import { useSession } from 'next-auth/react' import { useEffect, useMemo, useState } from 'react' import { ErrorDisplay, handleAppError } from 'app/global-error' import { UPDATE_PROGRAM_STATUS_MUTATION } from 'server/mutations/programsMutations' -import { - GetProgramAndModulesDocument, - GetProgramAndModulesQuery, -} from 'types/__generated__/programsQueries.generated' +import { GetProgramAndModulesDocument } from 'types/__generated__/programsQueries.generated' import type { ExtendedSession } from 'types/auth' -import { ProgramStatusEnum } from 'types/mentorship' +import { Program, ProgramStatusEnum, Module } from 'types/mentorship' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' @@ -26,11 +23,10 @@ const ProgramDetailsPage = () => { const { data: session } = useSession() const username = (session as ExtendedSession)?.user?.login - const [program, setProgram] = useState(null) - const [modules, setModules] = useState([]) + const [program, setProgram] = useState(null) + const [modules, setModules] = useState([]) const [isRefetching, setIsRefetching] = useState(false) - // TODO: update type const [updateProgram] = useMutation(UPDATE_PROGRAM_STATUS_MUTATION, { onError: handleAppError, }) diff --git a/frontend/src/app/projects/[projectKey]/page.tsx b/frontend/src/app/projects/[projectKey]/page.tsx index e9e7fff489..17d1c65491 100644 --- a/frontend/src/app/projects/[projectKey]/page.tsx +++ b/frontend/src/app/projects/[projectKey]/page.tsx @@ -12,15 +12,17 @@ import Link from 'next/link' import { useParams } from 'next/navigation' import { useState, useEffect } from 'react' import { ErrorDisplay, handleAppError } from 'app/global-error' -import { GetProjectDocument, GetProjectQuery } from 'types/__generated__/projectQueries.generated' +import { GetProjectDocument } from 'types/__generated__/projectQueries.generated' +import { Contributor } from 'types/contributor' +import { Project } from 'types/project' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' const ProjectDetailsPage = () => { const { projectKey } = useParams<{ projectKey: string }>() const [isLoading, setIsLoading] = useState(true) - const [project, setProject] = useState(null) - const [topContributors, setTopContributors] = useState([]) + const [project, setProject] = useState(null) + const [topContributors, setTopContributors] = useState([]) const { data, error: graphQLRequestError } = useQuery(GetProjectDocument, { variables: { key: projectKey }, }) diff --git a/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx b/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx index 35caa7291c..1df0c0e55f 100644 --- a/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx +++ b/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx @@ -14,10 +14,8 @@ import { import { useParams } from 'next/navigation' import { FC, useState, useEffect } from 'react' import { handleAppError } from 'app/global-error' -import { - GetProjectHealthMetricsDetailsDocument, - GetProjectHealthMetricsDetailsQuery, -} from 'types/__generated__/projectsHealthDashboardQueries.generated' +import { GetProjectHealthMetricsDetailsDocument } from 'types/__generated__/projectsHealthDashboardQueries.generated' +import { HealthMetricsProps } from 'types/healthMetrics' import BarChart from 'components/BarChart' import GeneralCompliantComponent from 'components/GeneralCompliantComponent' import LineChart from 'components/LineChart' @@ -27,10 +25,8 @@ import MetricsScoreCircle from 'components/MetricsScoreCircle' const ProjectHealthMetricsDetails: FC = () => { const { projectKey } = useParams<{ projectKey: string }>() - const [metricsList, setMetricsList] = - useState() - const [metricsLatest, setMetricsLatest] = - useState() + const [metricsList, setMetricsList] = useState() + const [metricsLatest, setMetricsLatest] = useState() const { loading, error: graphqlError, diff --git a/frontend/src/app/projects/dashboard/metrics/page.tsx b/frontend/src/app/projects/dashboard/metrics/page.tsx index 20015ca6be..fff7f67915 100644 --- a/frontend/src/app/projects/dashboard/metrics/page.tsx +++ b/frontend/src/app/projects/dashboard/metrics/page.tsx @@ -6,11 +6,9 @@ import { useSearchParams, useRouter } from 'next/navigation' import { FC, useState, useEffect } from 'react' import { handleAppError } from 'app/global-error' import { Ordering } from 'types/__generated__/graphql' -import { - GetProjectHealthMetricsDocument, - GetProjectHealthMetricsQuery, -} from 'types/__generated__/projectsHealthDashboardQueries.generated' +import { GetProjectHealthMetricsDocument } from 'types/__generated__/projectsHealthDashboardQueries.generated' import { DropDownSectionProps } from 'types/DropDownSectionProps' +import { HealthMetricsProps } from 'types/healthMetrics' import { getKeysLabels } from 'utils/getKeysLabels' import LoadingSpinner from 'components/LoadingSpinner' import MetricsCard from 'components/MetricsCard' @@ -81,9 +79,8 @@ const MetricsPage: FC = () => { } } - const [metrics, setMetrics] = useState([]) - const [metricsLength, setMetricsLength] = - useState(0) + const [metrics, setMetrics] = useState([]) + const [metricsLength, setMetricsLength] = useState(0) const [pagination, setPagination] = useState({ offset: 0, limit: PAGINATION_LIMIT }) const [filters, setFilters] = useState(currentFilters) const [ordering, setOrdering] = useState( @@ -241,7 +238,7 @@ const MetricsPage: FC = () => { No metrics found. Try adjusting your filters. ) : ( - metrics.map((metric) => ) //TODO: update types + metrics.map((metric) => ) )}
diff --git a/frontend/src/app/projects/dashboard/page.tsx b/frontend/src/app/projects/dashboard/page.tsx index 3b800f22b9..7feb387226 100644 --- a/frontend/src/app/projects/dashboard/page.tsx +++ b/frontend/src/app/projects/dashboard/page.tsx @@ -15,10 +15,8 @@ import { import millify from 'millify' import { useState, useEffect, FC } from 'react' import { handleAppError } from 'app/global-error' -import { - GetProjectHealthStatsDocument, - GetProjectHealthStatsQuery, -} from 'types/__generated__/projectsHealthDashboardQueries.generated' +import { GetProjectHealthStatsDocument } from 'types/__generated__/projectsHealthDashboardQueries.generated' +import { ProjectHealthStats } from 'types/projectHealthStats' import DashboardCard from 'components/DashboardCard' import DonutBarChart from 'components/DonutBarChart' import LineChart from 'components/LineChart' @@ -27,7 +25,7 @@ import MetricsPDFButton from 'components/MetricsPDFButton' import ProjectTypeDashboardCard from 'components/ProjectTypeDashboardCard' const ProjectsDashboardPage: FC = () => { - const [stats, setStats] = useState() + const [stats, setStats] = useState() const [isLoading, setIsLoading] = useState(true) const { data, error: graphQLRequestError } = useQuery(GetProjectHealthStatsDocument) diff --git a/frontend/src/app/settings/api-keys/page.tsx b/frontend/src/app/settings/api-keys/page.tsx index 2dc732d9ad..5f119b37fd 100644 --- a/frontend/src/app/settings/api-keys/page.tsx +++ b/frontend/src/app/settings/api-keys/page.tsx @@ -20,9 +20,9 @@ import { useState } from 'react' import { CreateApiKeyDocument, GetApiKeysDocument, - GetApiKeysQuery, RevokeApiKeyDocument, } from 'types/__generated__/apiKeyQueries.generated' +import { ApiKey } from 'types/apiKey' import SecondaryCard from 'components/SecondaryCard' import { ApiKeysSkeleton } from 'components/skeletons/ApiKeySkelton' @@ -34,7 +34,7 @@ export default function Page() { const [newKeyExpiry, setNewKeyExpiry] = useState('') const [showNewKey, setShowNewKey] = useState(false) const [newlyCreatedKey, setNewlyCreatedKey] = useState(null) - const [keyToRevoke, setKeyToRevoke] = useState(null) + const [keyToRevoke, setKeyToRevoke] = useState(null) const { loading, error, data, refetch } = useQuery(GetApiKeysDocument, { notifyOnNetworkStatusChange: true, @@ -239,7 +239,7 @@ export default function Page() { - {data.apiKeys.map((key: GetApiKeysQuery['apiKeys'][0]) => ( + {data.apiKeys.map((key: ApiKey) => ( { const { id: snapshotKey } = useParams<{ id: string }>() - const [snapshot, setSnapshot] = useState(null) + const [snapshot, setSnapshot] = useState(null) const [isLoading, setIsLoading] = useState(true) const router = useRouter() @@ -138,30 +136,28 @@ const SnapshotDetailsPage: React.FC = () => {
{' '} - // TODO: update type {snapshot.newChapters.filter((chapter) => chapter.isActive).map(renderChapterCard)}
)} - {snapshot.newProjects && - snapshot.newProjects.length > 0 && ( // TODO: update type -
-

- New Projects -

-
- {snapshot.newProjects.filter((project) => project.isActive).map(renderProjectCard)} -
+ {snapshot.newProjects && snapshot.newProjects.length > 0 && ( +
+

+ New Projects +

+
+ {snapshot.newProjects.filter((project) => project.isActive).map(renderProjectCard)}
- )} +
+ )} {snapshot.newReleases && snapshot.newReleases.length > 0 && (
diff --git a/frontend/src/app/snapshots/page.tsx b/frontend/src/app/snapshots/page.tsx index 6841debcd2..724397e543 100644 --- a/frontend/src/app/snapshots/page.tsx +++ b/frontend/src/app/snapshots/page.tsx @@ -4,16 +4,13 @@ import { addToast } from '@heroui/toast' import { useRouter } from 'next/navigation' import React, { useState, useEffect } from 'react' import FontAwesomeIconWrapper from 'wrappers/FontAwesomeIconWrapper' -import { - GetCommunitySnapshotsDocument, - GetCommunitySnapshotsQuery, -} from 'types/__generated__/snapshotQueries.generated' +import { GetCommunitySnapshotsDocument } from 'types/__generated__/snapshotQueries.generated' import type { Snapshot } from 'types/snapshot' import LoadingSpinner from 'components/LoadingSpinner' import SnapshotCard from 'components/SnapshotCard' const SnapshotsPage: React.FC = () => { - const [snapshots, setSnapshots] = useState(null) + const [snapshots, setSnapshots] = useState(null) const [isLoading, setIsLoading] = useState(true) const { data: graphQLData, error: graphQLRequestError } = useQuery(GetCommunitySnapshotsDocument) @@ -71,11 +68,9 @@ const SnapshotsPage: React.FC = () => { {!snapshots?.length ? (
No Snapshots found
) : ( - snapshots.map( - ( - snapshot: GetCommunitySnapshotsQuery['snapshots'][0] // TODO: update type - ) =>
{renderSnapshotCard(snapshot)}
- ) + snapshots.map((snapshot: Snapshot) => ( +
{renderSnapshotCard(snapshot)}
+ )) )}
diff --git a/frontend/src/components/CardDetailsPage.tsx b/frontend/src/components/CardDetailsPage.tsx index 330fd4a11f..5f872a0ed5 100644 --- a/frontend/src/components/CardDetailsPage.tsx +++ b/frontend/src/components/CardDetailsPage.tsx @@ -34,7 +34,6 @@ import SponsorCard from 'components/SponsorCard' import ToggleableList from 'components/ToggleableList' import TopContributorsList from 'components/TopContributorsList' -// TODO: update types const DetailsCard = ({ description, details, From 47068161e47eb630f5ab96b4be554582b8bfde60 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Sun, 21 Sep 2025 15:01:33 +0530 Subject: [PATCH 07/25] revert type changes --- frontend/src/app/about/page.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/about/page.tsx b/frontend/src/app/about/page.tsx index 20e0fd3706..910be4fc86 100644 --- a/frontend/src/app/about/page.tsx +++ b/frontend/src/app/about/page.tsx @@ -23,12 +23,10 @@ import { GetProjectMetadataDocument, GetTopContributorsDocument, } from 'types/__generated__/projectQueries.generated' -import { - GetLeaderDataDocument, - GetLeaderDataQuery, -} from 'types/__generated__/userQueries.generated' +import { GetLeaderDataDocument } from 'types/__generated__/userQueries.generated' import { Contributor } from 'types/contributor' import { Project } from 'types/project' +import { User } from 'types/user' import { aboutText, technologies } from 'utils/aboutData' import AnchorTitle from 'components/AnchorTitle' import AnimatedCounter from 'components/AnimatedCounter' @@ -266,7 +264,7 @@ const LeaderData = ({ username }: { username: string }) => { return

No data available for {username}

} - const handleButtonClick = (user: GetLeaderDataQuery['user']) => { + const handleButtonClick = (user: User) => { router.push(`/members/${user.login}`) } From 3e70433386a7f2c187ed67392024edeb307e744d Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Sun, 21 Sep 2025 17:01:29 +0530 Subject: [PATCH 08/25] Create and use fragments in About page --- frontend/src/app/about/page.tsx | 8 ++-- .../src/server/fragments/projectFragments.ts | 37 +++++++++++++++++++ .../src/server/fragments/userFragments.ts | 12 ++++++ frontend/src/server/queries/projectQueries.ts | 30 ++++----------- frontend/src/server/queries/userQueries.ts | 9 ++--- .../projectFragments.generated.ts | 11 ++++++ .../__generated__/projectQueries.generated.ts | 6 +-- .../__generated__/userFragments.generated.ts | 6 +++ .../__generated__/userQueries.generated.ts | 2 +- 9 files changed, 84 insertions(+), 37 deletions(-) create mode 100644 frontend/src/server/fragments/projectFragments.ts create mode 100644 frontend/src/server/fragments/userFragments.ts create mode 100644 frontend/src/types/__generated__/projectFragments.generated.ts create mode 100644 frontend/src/types/__generated__/userFragments.generated.ts diff --git a/frontend/src/app/about/page.tsx b/frontend/src/app/about/page.tsx index 910be4fc86..ebff173128 100644 --- a/frontend/src/app/about/page.tsx +++ b/frontend/src/app/about/page.tsx @@ -19,14 +19,14 @@ import { useRouter } from 'next/navigation' import { useEffect, useState } from 'react' import FontAwesomeIconWrapper from 'wrappers/FontAwesomeIconWrapper' import { ErrorDisplay, handleAppError } from 'app/global-error' +import { ProjectMetadataFieldsFragment } from 'types/__generated__/projectFragments.generated' import { GetProjectMetadataDocument, GetTopContributorsDocument, } from 'types/__generated__/projectQueries.generated' +import { LeaderFieldsFragment } from 'types/__generated__/userFragments.generated' import { GetLeaderDataDocument } from 'types/__generated__/userQueries.generated' import { Contributor } from 'types/contributor' -import { Project } from 'types/project' -import { User } from 'types/user' import { aboutText, technologies } from 'utils/aboutData' import AnchorTitle from 'components/AnchorTitle' import AnimatedCounter from 'components/AnimatedCounter' @@ -63,7 +63,7 @@ const About = () => { } ) - const [projectMetadata, setProjectMetadata] = useState(null) + const [projectMetadata, setProjectMetadata] = useState(null) const [topContributors, setTopContributors] = useState([]) useEffect(() => { @@ -264,7 +264,7 @@ const LeaderData = ({ username }: { username: string }) => { return

No data available for {username}

} - const handleButtonClick = (user: User) => { + const handleButtonClick = (user: LeaderFieldsFragment) => { router.push(`/members/${user.login}`) } diff --git a/frontend/src/server/fragments/projectFragments.ts b/frontend/src/server/fragments/projectFragments.ts new file mode 100644 index 0000000000..acc5c6721b --- /dev/null +++ b/frontend/src/server/fragments/projectFragments.ts @@ -0,0 +1,37 @@ +import { gql } from '@apollo/client' + +export const CONTRIBUTOR_FIELDS = gql` + fragment ContributorFields on RepositoryContributorNode { + id + avatarUrl + login + name + } +` + +export const MILESTONE_METADATA_FIELDS = gql` + fragment MilestoneMetadataFields on MilestoneNode { + id + title + url + body + progress + state + } +` + +export const PROJECT_METADATA_FIELDS = gql` + ${MILESTONE_METADATA_FIELDS} + fragment ProjectMetadataFields on ProjectNode { + id + contributorsCount + forksCount + issuesCount + name + starsCount + summary + recentMilestones(limit: 25) { + ...MilestoneMetadataFields + } + } +` diff --git a/frontend/src/server/fragments/userFragments.ts b/frontend/src/server/fragments/userFragments.ts new file mode 100644 index 0000000000..4018649b7f --- /dev/null +++ b/frontend/src/server/fragments/userFragments.ts @@ -0,0 +1,12 @@ +import { gql } from '@apollo/client' + +export const LEADER_FIELDS = gql` + fragment LeaderFields on UserNode { + id + avatarUrl + company + location + login + name + } +` diff --git a/frontend/src/server/queries/projectQueries.ts b/frontend/src/server/queries/projectQueries.ts index f6b3138030..b81eccd23d 100644 --- a/frontend/src/server/queries/projectQueries.ts +++ b/frontend/src/server/queries/projectQueries.ts @@ -1,6 +1,8 @@ import { gql } from '@apollo/client' +import { CONTRIBUTOR_FIELDS, PROJECT_METADATA_FIELDS } from 'server/fragments/projectFragments' export const GET_PROJECT_DATA = gql` + ${CONTRIBUTOR_FIELDS} query GetProject($key: String!) { project(key: $key) { id @@ -107,37 +109,22 @@ export const GET_PROJECT_DATA = gql` } } topContributors(project: $key) { - id - avatarUrl - login - name + ...ContributorFields } } ` export const GET_PROJECT_METADATA = gql` + ${PROJECT_METADATA_FIELDS} query GetProjectMetadata($key: String!) { project(key: $key) { - id - contributorsCount - forksCount - issuesCount - name - starsCount - summary - recentMilestones(limit: 25) { - id - title - url - body - progress - state - } + ...ProjectMetadataFields } } ` export const GET_TOP_CONTRIBUTORS = gql` + ${CONTRIBUTOR_FIELDS} query GetTopContributors( $excludedUsernames: [String!] $hasFullName: Boolean = false @@ -150,10 +137,7 @@ export const GET_TOP_CONTRIBUTORS = gql` limit: $limit project: $key ) { - id - avatarUrl - login - name + ...ContributorFields } } ` diff --git a/frontend/src/server/queries/userQueries.ts b/frontend/src/server/queries/userQueries.ts index 5bf0573638..5997d194d0 100644 --- a/frontend/src/server/queries/userQueries.ts +++ b/frontend/src/server/queries/userQueries.ts @@ -1,14 +1,11 @@ import { gql } from '@apollo/client' +import { LEADER_FIELDS } from 'server/fragments/userFragments' export const GET_LEADER_DATA = gql` + ${LEADER_FIELDS} query GetLeaderData($key: String!) { user(login: $key) { - id - avatarUrl - company - location - login - name + ...LeaderFields } } ` diff --git a/frontend/src/types/__generated__/projectFragments.generated.ts b/frontend/src/types/__generated__/projectFragments.generated.ts new file mode 100644 index 0000000000..192680510d --- /dev/null +++ b/frontend/src/types/__generated__/projectFragments.generated.ts @@ -0,0 +1,11 @@ +import * as Types from './graphql'; + +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type ContributorFieldsFragment = { __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }; + +export type MilestoneMetadataFieldsFragment = { __typename: 'MilestoneNode', id: string, title: string, url: string, body: string, progress: number, state: string }; + +export type ProjectMetadataFieldsFragment = { __typename: 'ProjectNode', id: string, contributorsCount: number, forksCount: number, issuesCount: number, name: string, starsCount: number, summary: string, recentMilestones: Array<{ __typename: 'MilestoneNode', id: string, title: string, url: string, body: string, progress: number, state: string }> }; + +export const ContributorFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ContributorFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RepositoryContributorNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; +export const ProjectMetadataFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ProjectNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"25"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MilestoneMetadataFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MilestoneMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MilestoneNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/frontend/src/types/__generated__/projectQueries.generated.ts b/frontend/src/types/__generated__/projectQueries.generated.ts index 587871fca9..04d09adec2 100644 --- a/frontend/src/types/__generated__/projectQueries.generated.ts +++ b/frontend/src/types/__generated__/projectQueries.generated.ts @@ -33,7 +33,7 @@ export type SearchProjectNamesQueryVariables = Types.Exact<{ export type SearchProjectNamesQuery = { searchProjects: Array<{ __typename: 'ProjectNode', id: string, name: string }> }; -export const GetProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"languages"}},{"kind":"Field","name":{"kind":"Name","value":"leaders"}},{"kind":"Field","name":{"kind":"Name","value":"level"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"healthMetricsList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"30"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"lastCommitDays"}},{"kind":"Field","name":{"kind":"Name","value":"lastCommitDaysRequirement"}},{"kind":"Field","name":{"kind":"Name","value":"lastReleaseDays"}},{"kind":"Field","name":{"kind":"Name","value":"lastReleaseDaysRequirement"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"openPullRequestsCount"}},{"kind":"Field","name":{"kind":"Name","value":"score"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"unassignedIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"unansweredIssuesCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentIssues"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentReleases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"tagName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repositories"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"organization"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"login"}}]}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"subscribersCount"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repositoriesCount"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"topics"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"closedIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentPullRequests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"project"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; -export const GetProjectMetadataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProjectMetadata"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"25"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetTopContributorsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTopContributors"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"excludedUsernames"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"hasFullName"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}},"defaultValue":{"kind":"BooleanValue","value":false}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"20"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"excludedUsernames"},"value":{"kind":"Variable","name":{"kind":"Name","value":"excludedUsernames"}}},{"kind":"Argument","name":{"kind":"Name","value":"hasFullName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"hasFullName"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"project"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const GetProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"languages"}},{"kind":"Field","name":{"kind":"Name","value":"leaders"}},{"kind":"Field","name":{"kind":"Name","value":"level"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"healthMetricsList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"30"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"lastCommitDays"}},{"kind":"Field","name":{"kind":"Name","value":"lastCommitDaysRequirement"}},{"kind":"Field","name":{"kind":"Name","value":"lastReleaseDays"}},{"kind":"Field","name":{"kind":"Name","value":"lastReleaseDaysRequirement"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"openPullRequestsCount"}},{"kind":"Field","name":{"kind":"Name","value":"score"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"unassignedIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"unansweredIssuesCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentIssues"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentReleases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"tagName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repositories"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"organization"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"login"}}]}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"subscribersCount"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repositoriesCount"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"topics"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"closedIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentPullRequests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"project"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ContributorFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ContributorFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RepositoryContributorNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; +export const GetProjectMetadataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProjectMetadata"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectMetadataFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MilestoneMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MilestoneNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ProjectNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"25"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MilestoneMetadataFields"}}]}}]}}]} as unknown as DocumentNode; +export const GetTopContributorsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTopContributors"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"excludedUsernames"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"hasFullName"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}},"defaultValue":{"kind":"BooleanValue","value":false}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"20"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"excludedUsernames"},"value":{"kind":"Variable","name":{"kind":"Name","value":"excludedUsernames"}}},{"kind":"Argument","name":{"kind":"Name","value":"hasFullName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"hasFullName"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"project"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ContributorFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ContributorFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RepositoryContributorNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; export const SearchProjectNamesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SearchProjectNames"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"query"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"searchProjects"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"query"},"value":{"kind":"Variable","name":{"kind":"Name","value":"query"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/frontend/src/types/__generated__/userFragments.generated.ts b/frontend/src/types/__generated__/userFragments.generated.ts new file mode 100644 index 0000000000..074b4d4dea --- /dev/null +++ b/frontend/src/types/__generated__/userFragments.generated.ts @@ -0,0 +1,6 @@ +import * as Types from './graphql'; + +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type LeaderFieldsFragment = { __typename: 'UserNode', id: string, avatarUrl: string, company: string, location: string, login: string, name: string }; + +export const LeaderFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LeaderFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"UserNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/frontend/src/types/__generated__/userQueries.generated.ts b/frontend/src/types/__generated__/userQueries.generated.ts index 6d50491dfc..78f3913c98 100644 --- a/frontend/src/types/__generated__/userQueries.generated.ts +++ b/frontend/src/types/__generated__/userQueries.generated.ts @@ -23,6 +23,6 @@ export type GetUserMetadataQueryVariables = Types.Exact<{ export type GetUserMetadataQuery = { user: { __typename: 'UserNode', id: string, bio: string, login: string, name: string } | null }; -export const GetLeaderDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaderData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const GetLeaderDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaderData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"LeaderFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LeaderFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"UserNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; export const GetUserDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetUserData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"recentIssues"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"closedIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentPullRequests"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentReleases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isPreRelease"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"tagName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"topContributedRepositories"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"organization"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"login"}}]}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"subscribersCount"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"bio"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"contributionsCount"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"followersCount"}},{"kind":"Field","name":{"kind":"Name","value":"followingCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"publicRepositoriesCount"}},{"kind":"Field","name":{"kind":"Name","value":"releasesCount"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const GetUserMetadataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetUserMetadata"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"bio"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file From 0637a8427c06bfb2943a36db8627ed5d25f0bea7 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Sun, 21 Sep 2025 22:03:13 +0530 Subject: [PATCH 09/25] Create and use fragments in Chapter pages --- .../src/app/chapters/[chapterKey]/page.tsx | 4 +-- frontend/src/app/chapters/page.tsx | 5 +-- frontend/src/components/ChapterMap.tsx | 29 +++++---------- frontend/src/components/ChapterMapWrapper.tsx | 5 +-- .../src/server/fragments/chapterFragments.ts | 35 +++++++++++++++++++ frontend/src/server/queries/chapterQueries.ts | 29 +++++---------- .../chapterFragments.generated.ts | 10 ++++++ .../__generated__/chapterQueries.generated.ts | 6 ++-- frontend/src/types/card.ts | 6 ++-- 9 files changed, 77 insertions(+), 52 deletions(-) create mode 100644 frontend/src/server/fragments/chapterFragments.ts create mode 100644 frontend/src/types/__generated__/chapterFragments.generated.ts diff --git a/frontend/src/app/chapters/[chapterKey]/page.tsx b/frontend/src/app/chapters/[chapterKey]/page.tsx index 9c004a3779..877ea3006a 100644 --- a/frontend/src/app/chapters/[chapterKey]/page.tsx +++ b/frontend/src/app/chapters/[chapterKey]/page.tsx @@ -4,8 +4,8 @@ import Link from 'next/link' import { useParams } from 'next/navigation' import { useState, useEffect } from 'react' import { handleAppError, ErrorDisplay } from 'app/global-error' +import { ChapterFieldsFragment } from 'types/__generated__/chapterFragments.generated' import { GetChapterDataDocument } from 'types/__generated__/chapterQueries.generated' -import { Chapter } from 'types/chapter' import type { Contributor } from 'types/contributor' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' @@ -13,7 +13,7 @@ import LoadingSpinner from 'components/LoadingSpinner' export default function ChapterDetailsPage() { const { chapterKey } = useParams<{ chapterKey: string }>() - const [chapter, setChapter] = useState({} as Chapter) + const [chapter, setChapter] = useState({} as ChapterFieldsFragment) const [topContributors, setTopContributors] = useState([]) const [isLoading, setIsLoading] = useState(true) diff --git a/frontend/src/app/chapters/page.tsx b/frontend/src/app/chapters/page.tsx index 15d93df6ea..238210ffb7 100644 --- a/frontend/src/app/chapters/page.tsx +++ b/frontend/src/app/chapters/page.tsx @@ -4,6 +4,7 @@ import { useRouter } from 'next/navigation' import { useEffect, useState } from 'react' import FontAwesomeIconWrapper from 'wrappers/FontAwesomeIconWrapper' import { fetchAlgoliaData } from 'server/fetchAlgoliaData' +import { ChapterMapFieldsFragment } from 'types/__generated__/chapterFragments.generated' import type { AlgoliaResponse } from 'types/algolia' import type { Chapter } from 'types/chapter' import { getFilteredIcons, handleSocialUrls } from 'utils/utility' @@ -12,7 +13,7 @@ import ChapterMapWrapper from 'components/ChapterMapWrapper' import SearchPageLayout from 'components/SearchPageLayout' const ChaptersPage = () => { - const [geoLocData, setGeoLocData] = useState([]) + const [geoLocData, setGeoLocData] = useState([]) const { items: chapters, isLoaded, @@ -40,7 +41,7 @@ const ChaptersPage = () => { searchParams.currentPage, searchParams.hitsPerPage ) - setGeoLocData(data.hits) + setGeoLocData(data.hits) // TODO: add mapper to algoila } fetchData() }, [currentPage]) diff --git a/frontend/src/components/ChapterMap.tsx b/frontend/src/components/ChapterMap.tsx index 36c360aca5..6d272febb6 100644 --- a/frontend/src/components/ChapterMap.tsx +++ b/frontend/src/components/ChapterMap.tsx @@ -1,19 +1,19 @@ 'use client' import L, { MarkerClusterGroup } from 'leaflet' import React, { useEffect, useRef } from 'react' -import type { Chapter } from 'types/chapter' import 'leaflet.markercluster' import 'leaflet/dist/leaflet.css' import 'leaflet.markercluster/dist/MarkerCluster.css' import 'leaflet.markercluster/dist/MarkerCluster.Default.css' import 'leaflet.markercluster' +import { ChapterMapFieldsFragment } from 'types/__generated__/chapterFragments.generated' const ChapterMap = ({ geoLocData, showLocal, style, }: { - geoLocData: Chapter[] + geoLocData: ChapterMapFieldsFragment[] showLocal: boolean style: React.CSSProperties }) => { @@ -59,13 +59,11 @@ const ChapterMap = ({ shadowUrl: '/img/marker-shadow.png', }) - const marker = L.marker( - [ - chapter._geoloc?.lat || chapter.geoLocation?.lat, - chapter._geoloc?.lng || chapter.geoLocation?.lng, - ], - { icon: markerIcon } - ) + // TODO: Location markers not visible + // TODO: add mapper to algolia + const marker = L.marker([chapter.geoLocation?.lat, chapter.geoLocation?.lng], { + icon: markerIcon, + }) const popup = L.popup() const popupContent = document.createElement('div') popupContent.className = 'popup-content' @@ -84,20 +82,11 @@ const ChapterMap = ({ const maxNearestChapters = 5 const localChapters = geoLocData.slice(0, maxNearestChapters - 1) const localBounds = L.latLngBounds( - localChapters.map((chapter) => [ - chapter._geoloc?.lat || chapter.geoLocation?.lat, - chapter._geoloc?.lng || chapter.geoLocation?.lng, - ]) + localChapters.map((chapter) => [chapter.geoLocation?.lat, chapter.geoLocation?.lng]) ) const maxZoom = 7 const nearestChapter = geoLocData[0] - map.setView( - [ - nearestChapter._geoloc?.lat || nearestChapter.geoLocation?.lat, - nearestChapter._geoloc?.lng || nearestChapter.geoLocation?.lng, - ], - maxZoom - ) + map.setView([nearestChapter.geoLocation?.lat, nearestChapter.geoLocation?.lng], maxZoom) map.fitBounds(localBounds, { maxZoom: maxZoom }) } }, [geoLocData, showLocal]) diff --git a/frontend/src/components/ChapterMapWrapper.tsx b/frontend/src/components/ChapterMapWrapper.tsx index 48fb313e4a..fb91c4f177 100644 --- a/frontend/src/components/ChapterMapWrapper.tsx +++ b/frontend/src/components/ChapterMapWrapper.tsx @@ -1,11 +1,12 @@ import dynamic from 'next/dynamic' import React from 'react' -import type { Chapter } from 'types/chapter' +import { ChapterMapFieldsFragment } from 'types/__generated__/chapterFragments.generated' const ChapterMap = dynamic(() => import('./ChapterMap'), { ssr: false }) +// TODO: Location markers not visible const ChapterMapWrapper = (props: { - geoLocData: Chapter[] + geoLocData: ChapterMapFieldsFragment[] showLocal: boolean style: React.CSSProperties }) => { diff --git a/frontend/src/server/fragments/chapterFragments.ts b/frontend/src/server/fragments/chapterFragments.ts new file mode 100644 index 0000000000..6108d54418 --- /dev/null +++ b/frontend/src/server/fragments/chapterFragments.ts @@ -0,0 +1,35 @@ +import { gql } from '@apollo/client' + +export const CHAPTER_MAP_FIELDS = gql` + fragment ChapterMapFields on ChapterNode { + key + name + geoLocation { + lat + lng + } + } +` + +export const CHAPTER_METADATA_FIELDS = gql` + fragment ChapterMetadataFields on ChapterNode { + id + name + summary + } +` + +export const CHAPTER_FIELDS = gql` + ${CHAPTER_METADATA_FIELDS} + ${CHAPTER_MAP_FIELDS} + fragment ChapterFields on ChapterNode { + ...ChapterMetadataFields + ...ChapterMapFields + isActive + region + relatedUrls + suggestedLocation + updatedAt + url + } +` diff --git a/frontend/src/server/queries/chapterQueries.ts b/frontend/src/server/queries/chapterQueries.ts index 1714c4bd3c..4c7a90d635 100644 --- a/frontend/src/server/queries/chapterQueries.ts +++ b/frontend/src/server/queries/chapterQueries.ts @@ -1,38 +1,25 @@ import { gql } from '@apollo/client' +import { CHAPTER_FIELDS, CHAPTER_METADATA_FIELDS } from 'server/fragments/chapterFragments' +import { CONTRIBUTOR_FIELDS } from 'server/fragments/projectFragments' export const GET_CHAPTER_DATA = gql` + ${CONTRIBUTOR_FIELDS} + ${CHAPTER_FIELDS} query GetChapterData($key: String!) { chapter(key: $key) { - id - geoLocation { - lat - lng - } - isActive - key - name - region - relatedUrls - suggestedLocation - summary - updatedAt - url + ...ChapterFields } topContributors(chapter: $key) { - id - avatarUrl - login - name + ...ContributorFields } } ` export const GET_CHAPTER_METADATA = gql` + ${CHAPTER_METADATA_FIELDS} query GetChapterMetadata($key: String!) { chapter(key: $key) { - id - name - summary + ...ChapterMetadataFields } } ` diff --git a/frontend/src/types/__generated__/chapterFragments.generated.ts b/frontend/src/types/__generated__/chapterFragments.generated.ts new file mode 100644 index 0000000000..84d9bc9616 --- /dev/null +++ b/frontend/src/types/__generated__/chapterFragments.generated.ts @@ -0,0 +1,10 @@ +import * as Types from './graphql'; + +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +export type ChapterMapFieldsFragment = { __typename: 'ChapterNode', key: string, name: string, geoLocation: { __typename: 'GeoLocationType', lat: number, lng: number } | null }; + +export type ChapterMetadataFieldsFragment = { __typename: 'ChapterNode', id: string, name: string, summary: string }; + +export type ChapterFieldsFragment = { __typename: 'ChapterNode', isActive: boolean, region: string, relatedUrls: Array, suggestedLocation: string | null, updatedAt: number, url: string, id: string, name: string, summary: string, key: string, geoLocation: { __typename: 'GeoLocationType', lat: number, lng: number } | null }; + +export const ChapterFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChapterMetadataFields"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChapterMapFields"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"region"}},{"kind":"Field","name":{"kind":"Name","value":"relatedUrls"}},{"kind":"Field","name":{"kind":"Name","value":"suggestedLocation"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterMapFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"geoLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lng"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/frontend/src/types/__generated__/chapterQueries.generated.ts b/frontend/src/types/__generated__/chapterQueries.generated.ts index e9266997df..cb18491569 100644 --- a/frontend/src/types/__generated__/chapterQueries.generated.ts +++ b/frontend/src/types/__generated__/chapterQueries.generated.ts @@ -6,7 +6,7 @@ export type GetChapterDataQueryVariables = Types.Exact<{ }>; -export type GetChapterDataQuery = { chapter: { __typename: 'ChapterNode', id: string, isActive: boolean, key: string, name: string, region: string, relatedUrls: Array, suggestedLocation: string | null, summary: string, updatedAt: number, url: string, geoLocation: { __typename: 'GeoLocationType', lat: number, lng: number } | null } | null, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }> }; +export type GetChapterDataQuery = { chapter: { __typename: 'ChapterNode', isActive: boolean, region: string, relatedUrls: Array, suggestedLocation: string | null, updatedAt: number, url: string, id: string, name: string, summary: string, key: string, geoLocation: { __typename: 'GeoLocationType', lat: number, lng: number } | null } | null, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }> }; export type GetChapterMetadataQueryVariables = Types.Exact<{ key: Types.Scalars['String']['input']; @@ -16,5 +16,5 @@ export type GetChapterMetadataQueryVariables = Types.Exact<{ export type GetChapterMetadataQuery = { chapter: { __typename: 'ChapterNode', id: string, name: string, summary: string } | null }; -export const GetChapterDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetChapterData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chapter"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"geoLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lng"}}]}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"region"}},{"kind":"Field","name":{"kind":"Name","value":"relatedUrls"}},{"kind":"Field","name":{"kind":"Name","value":"suggestedLocation"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"chapter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; -export const GetChapterMetadataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetChapterMetadata"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chapter"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const GetChapterDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetChapterData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chapter"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChapterFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"chapter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ContributorFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterMapFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"geoLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lng"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChapterMetadataFields"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChapterMapFields"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"region"}},{"kind":"Field","name":{"kind":"Name","value":"relatedUrls"}},{"kind":"Field","name":{"kind":"Name","value":"suggestedLocation"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ContributorFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RepositoryContributorNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; +export const GetChapterMetadataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetChapterMetadata"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chapter"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChapterMetadataFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/frontend/src/types/card.ts b/frontend/src/types/card.ts index 9f37a9011e..5ff77b46b4 100644 --- a/frontend/src/types/card.ts +++ b/frontend/src/types/card.ts @@ -1,7 +1,6 @@ import type { IconDefinition } from '@fortawesome/free-solid-svg-icons' import type { JSX } from 'react' import type { Button } from 'types/button' -import type { Chapter } from 'types/chapter' import type { Contributor } from 'types/contributor' import type { HealthMetricsProps } from 'types/healthMetrics' import type { Icon } from 'types/icon' @@ -12,6 +11,8 @@ import type { Milestone } from 'types/milestone' import type { RepositoryCardProps } from 'types/project' import type { PullRequest } from 'types/pullRequest' import type { Release } from 'types/release' +// eslint-disable-next-line no-restricted-imports +import { ChapterMapFieldsFragment } from './__generated__/chapterFragments.generated' export type CardProps = { button: Button @@ -39,13 +40,14 @@ type Stats = { unit?: string value: number } + export interface DetailsCardProps { accessLevel?: string description?: string details?: { label: string; value: string | JSX.Element }[] domains?: string[] entityKey?: string - geolocationData?: Chapter[] + geolocationData?: ChapterMapFieldsFragment[] healthMetricsData?: HealthMetricsProps[] heatmap?: JSX.Element isActive?: boolean From ee6352d77f08a8958a274dfeef77e800157afed1 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Mon, 22 Sep 2025 18:52:11 +0530 Subject: [PATCH 10/25] Revert "Create and use fragments in Chapter pages" This reverts commit 0637a8427c06bfb2943a36db8627ed5d25f0bea7. --- .../src/app/chapters/[chapterKey]/page.tsx | 4 +-- frontend/src/app/chapters/page.tsx | 5 ++- frontend/src/components/ChapterMap.tsx | 29 ++++++++++----- frontend/src/components/ChapterMapWrapper.tsx | 5 ++- .../src/server/fragments/chapterFragments.ts | 35 ------------------- frontend/src/server/queries/chapterQueries.ts | 29 ++++++++++----- .../chapterFragments.generated.ts | 10 ------ .../__generated__/chapterQueries.generated.ts | 6 ++-- frontend/src/types/card.ts | 6 ++-- 9 files changed, 52 insertions(+), 77 deletions(-) delete mode 100644 frontend/src/server/fragments/chapterFragments.ts delete mode 100644 frontend/src/types/__generated__/chapterFragments.generated.ts diff --git a/frontend/src/app/chapters/[chapterKey]/page.tsx b/frontend/src/app/chapters/[chapterKey]/page.tsx index 877ea3006a..9c004a3779 100644 --- a/frontend/src/app/chapters/[chapterKey]/page.tsx +++ b/frontend/src/app/chapters/[chapterKey]/page.tsx @@ -4,8 +4,8 @@ import Link from 'next/link' import { useParams } from 'next/navigation' import { useState, useEffect } from 'react' import { handleAppError, ErrorDisplay } from 'app/global-error' -import { ChapterFieldsFragment } from 'types/__generated__/chapterFragments.generated' import { GetChapterDataDocument } from 'types/__generated__/chapterQueries.generated' +import { Chapter } from 'types/chapter' import type { Contributor } from 'types/contributor' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' @@ -13,7 +13,7 @@ import LoadingSpinner from 'components/LoadingSpinner' export default function ChapterDetailsPage() { const { chapterKey } = useParams<{ chapterKey: string }>() - const [chapter, setChapter] = useState({} as ChapterFieldsFragment) + const [chapter, setChapter] = useState({} as Chapter) const [topContributors, setTopContributors] = useState([]) const [isLoading, setIsLoading] = useState(true) diff --git a/frontend/src/app/chapters/page.tsx b/frontend/src/app/chapters/page.tsx index 238210ffb7..15d93df6ea 100644 --- a/frontend/src/app/chapters/page.tsx +++ b/frontend/src/app/chapters/page.tsx @@ -4,7 +4,6 @@ import { useRouter } from 'next/navigation' import { useEffect, useState } from 'react' import FontAwesomeIconWrapper from 'wrappers/FontAwesomeIconWrapper' import { fetchAlgoliaData } from 'server/fetchAlgoliaData' -import { ChapterMapFieldsFragment } from 'types/__generated__/chapterFragments.generated' import type { AlgoliaResponse } from 'types/algolia' import type { Chapter } from 'types/chapter' import { getFilteredIcons, handleSocialUrls } from 'utils/utility' @@ -13,7 +12,7 @@ import ChapterMapWrapper from 'components/ChapterMapWrapper' import SearchPageLayout from 'components/SearchPageLayout' const ChaptersPage = () => { - const [geoLocData, setGeoLocData] = useState([]) + const [geoLocData, setGeoLocData] = useState([]) const { items: chapters, isLoaded, @@ -41,7 +40,7 @@ const ChaptersPage = () => { searchParams.currentPage, searchParams.hitsPerPage ) - setGeoLocData(data.hits) // TODO: add mapper to algoila + setGeoLocData(data.hits) } fetchData() }, [currentPage]) diff --git a/frontend/src/components/ChapterMap.tsx b/frontend/src/components/ChapterMap.tsx index 6d272febb6..36c360aca5 100644 --- a/frontend/src/components/ChapterMap.tsx +++ b/frontend/src/components/ChapterMap.tsx @@ -1,19 +1,19 @@ 'use client' import L, { MarkerClusterGroup } from 'leaflet' import React, { useEffect, useRef } from 'react' +import type { Chapter } from 'types/chapter' import 'leaflet.markercluster' import 'leaflet/dist/leaflet.css' import 'leaflet.markercluster/dist/MarkerCluster.css' import 'leaflet.markercluster/dist/MarkerCluster.Default.css' import 'leaflet.markercluster' -import { ChapterMapFieldsFragment } from 'types/__generated__/chapterFragments.generated' const ChapterMap = ({ geoLocData, showLocal, style, }: { - geoLocData: ChapterMapFieldsFragment[] + geoLocData: Chapter[] showLocal: boolean style: React.CSSProperties }) => { @@ -59,11 +59,13 @@ const ChapterMap = ({ shadowUrl: '/img/marker-shadow.png', }) - // TODO: Location markers not visible - // TODO: add mapper to algolia - const marker = L.marker([chapter.geoLocation?.lat, chapter.geoLocation?.lng], { - icon: markerIcon, - }) + const marker = L.marker( + [ + chapter._geoloc?.lat || chapter.geoLocation?.lat, + chapter._geoloc?.lng || chapter.geoLocation?.lng, + ], + { icon: markerIcon } + ) const popup = L.popup() const popupContent = document.createElement('div') popupContent.className = 'popup-content' @@ -82,11 +84,20 @@ const ChapterMap = ({ const maxNearestChapters = 5 const localChapters = geoLocData.slice(0, maxNearestChapters - 1) const localBounds = L.latLngBounds( - localChapters.map((chapter) => [chapter.geoLocation?.lat, chapter.geoLocation?.lng]) + localChapters.map((chapter) => [ + chapter._geoloc?.lat || chapter.geoLocation?.lat, + chapter._geoloc?.lng || chapter.geoLocation?.lng, + ]) ) const maxZoom = 7 const nearestChapter = geoLocData[0] - map.setView([nearestChapter.geoLocation?.lat, nearestChapter.geoLocation?.lng], maxZoom) + map.setView( + [ + nearestChapter._geoloc?.lat || nearestChapter.geoLocation?.lat, + nearestChapter._geoloc?.lng || nearestChapter.geoLocation?.lng, + ], + maxZoom + ) map.fitBounds(localBounds, { maxZoom: maxZoom }) } }, [geoLocData, showLocal]) diff --git a/frontend/src/components/ChapterMapWrapper.tsx b/frontend/src/components/ChapterMapWrapper.tsx index fb91c4f177..48fb313e4a 100644 --- a/frontend/src/components/ChapterMapWrapper.tsx +++ b/frontend/src/components/ChapterMapWrapper.tsx @@ -1,12 +1,11 @@ import dynamic from 'next/dynamic' import React from 'react' -import { ChapterMapFieldsFragment } from 'types/__generated__/chapterFragments.generated' +import type { Chapter } from 'types/chapter' const ChapterMap = dynamic(() => import('./ChapterMap'), { ssr: false }) -// TODO: Location markers not visible const ChapterMapWrapper = (props: { - geoLocData: ChapterMapFieldsFragment[] + geoLocData: Chapter[] showLocal: boolean style: React.CSSProperties }) => { diff --git a/frontend/src/server/fragments/chapterFragments.ts b/frontend/src/server/fragments/chapterFragments.ts deleted file mode 100644 index 6108d54418..0000000000 --- a/frontend/src/server/fragments/chapterFragments.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { gql } from '@apollo/client' - -export const CHAPTER_MAP_FIELDS = gql` - fragment ChapterMapFields on ChapterNode { - key - name - geoLocation { - lat - lng - } - } -` - -export const CHAPTER_METADATA_FIELDS = gql` - fragment ChapterMetadataFields on ChapterNode { - id - name - summary - } -` - -export const CHAPTER_FIELDS = gql` - ${CHAPTER_METADATA_FIELDS} - ${CHAPTER_MAP_FIELDS} - fragment ChapterFields on ChapterNode { - ...ChapterMetadataFields - ...ChapterMapFields - isActive - region - relatedUrls - suggestedLocation - updatedAt - url - } -` diff --git a/frontend/src/server/queries/chapterQueries.ts b/frontend/src/server/queries/chapterQueries.ts index 4c7a90d635..1714c4bd3c 100644 --- a/frontend/src/server/queries/chapterQueries.ts +++ b/frontend/src/server/queries/chapterQueries.ts @@ -1,25 +1,38 @@ import { gql } from '@apollo/client' -import { CHAPTER_FIELDS, CHAPTER_METADATA_FIELDS } from 'server/fragments/chapterFragments' -import { CONTRIBUTOR_FIELDS } from 'server/fragments/projectFragments' export const GET_CHAPTER_DATA = gql` - ${CONTRIBUTOR_FIELDS} - ${CHAPTER_FIELDS} query GetChapterData($key: String!) { chapter(key: $key) { - ...ChapterFields + id + geoLocation { + lat + lng + } + isActive + key + name + region + relatedUrls + suggestedLocation + summary + updatedAt + url } topContributors(chapter: $key) { - ...ContributorFields + id + avatarUrl + login + name } } ` export const GET_CHAPTER_METADATA = gql` - ${CHAPTER_METADATA_FIELDS} query GetChapterMetadata($key: String!) { chapter(key: $key) { - ...ChapterMetadataFields + id + name + summary } } ` diff --git a/frontend/src/types/__generated__/chapterFragments.generated.ts b/frontend/src/types/__generated__/chapterFragments.generated.ts deleted file mode 100644 index 84d9bc9616..0000000000 --- a/frontend/src/types/__generated__/chapterFragments.generated.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as Types from './graphql'; - -import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; -export type ChapterMapFieldsFragment = { __typename: 'ChapterNode', key: string, name: string, geoLocation: { __typename: 'GeoLocationType', lat: number, lng: number } | null }; - -export type ChapterMetadataFieldsFragment = { __typename: 'ChapterNode', id: string, name: string, summary: string }; - -export type ChapterFieldsFragment = { __typename: 'ChapterNode', isActive: boolean, region: string, relatedUrls: Array, suggestedLocation: string | null, updatedAt: number, url: string, id: string, name: string, summary: string, key: string, geoLocation: { __typename: 'GeoLocationType', lat: number, lng: number } | null }; - -export const ChapterFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChapterMetadataFields"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChapterMapFields"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"region"}},{"kind":"Field","name":{"kind":"Name","value":"relatedUrls"}},{"kind":"Field","name":{"kind":"Name","value":"suggestedLocation"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterMapFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"geoLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lng"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/frontend/src/types/__generated__/chapterQueries.generated.ts b/frontend/src/types/__generated__/chapterQueries.generated.ts index cb18491569..e9266997df 100644 --- a/frontend/src/types/__generated__/chapterQueries.generated.ts +++ b/frontend/src/types/__generated__/chapterQueries.generated.ts @@ -6,7 +6,7 @@ export type GetChapterDataQueryVariables = Types.Exact<{ }>; -export type GetChapterDataQuery = { chapter: { __typename: 'ChapterNode', isActive: boolean, region: string, relatedUrls: Array, suggestedLocation: string | null, updatedAt: number, url: string, id: string, name: string, summary: string, key: string, geoLocation: { __typename: 'GeoLocationType', lat: number, lng: number } | null } | null, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }> }; +export type GetChapterDataQuery = { chapter: { __typename: 'ChapterNode', id: string, isActive: boolean, key: string, name: string, region: string, relatedUrls: Array, suggestedLocation: string | null, summary: string, updatedAt: number, url: string, geoLocation: { __typename: 'GeoLocationType', lat: number, lng: number } | null } | null, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }> }; export type GetChapterMetadataQueryVariables = Types.Exact<{ key: Types.Scalars['String']['input']; @@ -16,5 +16,5 @@ export type GetChapterMetadataQueryVariables = Types.Exact<{ export type GetChapterMetadataQuery = { chapter: { __typename: 'ChapterNode', id: string, name: string, summary: string } | null }; -export const GetChapterDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetChapterData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chapter"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChapterFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"chapter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ContributorFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterMapFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"geoLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lng"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChapterMetadataFields"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChapterMapFields"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"region"}},{"kind":"Field","name":{"kind":"Name","value":"relatedUrls"}},{"kind":"Field","name":{"kind":"Name","value":"suggestedLocation"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ContributorFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RepositoryContributorNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; -export const GetChapterMetadataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetChapterMetadata"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chapter"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChapterMetadataFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChapterMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ChapterNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const GetChapterDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetChapterData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chapter"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"geoLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lng"}}]}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"region"}},{"kind":"Field","name":{"kind":"Name","value":"relatedUrls"}},{"kind":"Field","name":{"kind":"Name","value":"suggestedLocation"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"chapter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const GetChapterMetadataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetChapterMetadata"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chapter"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/frontend/src/types/card.ts b/frontend/src/types/card.ts index 5ff77b46b4..9f37a9011e 100644 --- a/frontend/src/types/card.ts +++ b/frontend/src/types/card.ts @@ -1,6 +1,7 @@ import type { IconDefinition } from '@fortawesome/free-solid-svg-icons' import type { JSX } from 'react' import type { Button } from 'types/button' +import type { Chapter } from 'types/chapter' import type { Contributor } from 'types/contributor' import type { HealthMetricsProps } from 'types/healthMetrics' import type { Icon } from 'types/icon' @@ -11,8 +12,6 @@ import type { Milestone } from 'types/milestone' import type { RepositoryCardProps } from 'types/project' import type { PullRequest } from 'types/pullRequest' import type { Release } from 'types/release' -// eslint-disable-next-line no-restricted-imports -import { ChapterMapFieldsFragment } from './__generated__/chapterFragments.generated' export type CardProps = { button: Button @@ -40,14 +39,13 @@ type Stats = { unit?: string value: number } - export interface DetailsCardProps { accessLevel?: string description?: string details?: { label: string; value: string | JSX.Element }[] domains?: string[] entityKey?: string - geolocationData?: ChapterMapFieldsFragment[] + geolocationData?: Chapter[] healthMetricsData?: HealthMetricsProps[] heatmap?: JSX.Element isActive?: boolean From 14348ca89c13e71322debc511a5a917ea1488fe8 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Mon, 22 Sep 2025 18:52:57 +0530 Subject: [PATCH 11/25] Revert "Create and use fragments in About page" This reverts commit 3e70433386a7f2c187ed67392024edeb307e744d. --- frontend/src/app/about/page.tsx | 8 ++-- .../src/server/fragments/projectFragments.ts | 37 ------------------- .../src/server/fragments/userFragments.ts | 12 ------ frontend/src/server/queries/projectQueries.ts | 30 +++++++++++---- frontend/src/server/queries/userQueries.ts | 9 +++-- .../projectFragments.generated.ts | 11 ------ .../__generated__/projectQueries.generated.ts | 6 +-- .../__generated__/userFragments.generated.ts | 6 --- .../__generated__/userQueries.generated.ts | 2 +- 9 files changed, 37 insertions(+), 84 deletions(-) delete mode 100644 frontend/src/server/fragments/projectFragments.ts delete mode 100644 frontend/src/server/fragments/userFragments.ts delete mode 100644 frontend/src/types/__generated__/projectFragments.generated.ts delete mode 100644 frontend/src/types/__generated__/userFragments.generated.ts diff --git a/frontend/src/app/about/page.tsx b/frontend/src/app/about/page.tsx index ebff173128..910be4fc86 100644 --- a/frontend/src/app/about/page.tsx +++ b/frontend/src/app/about/page.tsx @@ -19,14 +19,14 @@ import { useRouter } from 'next/navigation' import { useEffect, useState } from 'react' import FontAwesomeIconWrapper from 'wrappers/FontAwesomeIconWrapper' import { ErrorDisplay, handleAppError } from 'app/global-error' -import { ProjectMetadataFieldsFragment } from 'types/__generated__/projectFragments.generated' import { GetProjectMetadataDocument, GetTopContributorsDocument, } from 'types/__generated__/projectQueries.generated' -import { LeaderFieldsFragment } from 'types/__generated__/userFragments.generated' import { GetLeaderDataDocument } from 'types/__generated__/userQueries.generated' import { Contributor } from 'types/contributor' +import { Project } from 'types/project' +import { User } from 'types/user' import { aboutText, technologies } from 'utils/aboutData' import AnchorTitle from 'components/AnchorTitle' import AnimatedCounter from 'components/AnimatedCounter' @@ -63,7 +63,7 @@ const About = () => { } ) - const [projectMetadata, setProjectMetadata] = useState(null) + const [projectMetadata, setProjectMetadata] = useState(null) const [topContributors, setTopContributors] = useState([]) useEffect(() => { @@ -264,7 +264,7 @@ const LeaderData = ({ username }: { username: string }) => { return

No data available for {username}

} - const handleButtonClick = (user: LeaderFieldsFragment) => { + const handleButtonClick = (user: User) => { router.push(`/members/${user.login}`) } diff --git a/frontend/src/server/fragments/projectFragments.ts b/frontend/src/server/fragments/projectFragments.ts deleted file mode 100644 index acc5c6721b..0000000000 --- a/frontend/src/server/fragments/projectFragments.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { gql } from '@apollo/client' - -export const CONTRIBUTOR_FIELDS = gql` - fragment ContributorFields on RepositoryContributorNode { - id - avatarUrl - login - name - } -` - -export const MILESTONE_METADATA_FIELDS = gql` - fragment MilestoneMetadataFields on MilestoneNode { - id - title - url - body - progress - state - } -` - -export const PROJECT_METADATA_FIELDS = gql` - ${MILESTONE_METADATA_FIELDS} - fragment ProjectMetadataFields on ProjectNode { - id - contributorsCount - forksCount - issuesCount - name - starsCount - summary - recentMilestones(limit: 25) { - ...MilestoneMetadataFields - } - } -` diff --git a/frontend/src/server/fragments/userFragments.ts b/frontend/src/server/fragments/userFragments.ts deleted file mode 100644 index 4018649b7f..0000000000 --- a/frontend/src/server/fragments/userFragments.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { gql } from '@apollo/client' - -export const LEADER_FIELDS = gql` - fragment LeaderFields on UserNode { - id - avatarUrl - company - location - login - name - } -` diff --git a/frontend/src/server/queries/projectQueries.ts b/frontend/src/server/queries/projectQueries.ts index b81eccd23d..f6b3138030 100644 --- a/frontend/src/server/queries/projectQueries.ts +++ b/frontend/src/server/queries/projectQueries.ts @@ -1,8 +1,6 @@ import { gql } from '@apollo/client' -import { CONTRIBUTOR_FIELDS, PROJECT_METADATA_FIELDS } from 'server/fragments/projectFragments' export const GET_PROJECT_DATA = gql` - ${CONTRIBUTOR_FIELDS} query GetProject($key: String!) { project(key: $key) { id @@ -109,22 +107,37 @@ export const GET_PROJECT_DATA = gql` } } topContributors(project: $key) { - ...ContributorFields + id + avatarUrl + login + name } } ` export const GET_PROJECT_METADATA = gql` - ${PROJECT_METADATA_FIELDS} query GetProjectMetadata($key: String!) { project(key: $key) { - ...ProjectMetadataFields + id + contributorsCount + forksCount + issuesCount + name + starsCount + summary + recentMilestones(limit: 25) { + id + title + url + body + progress + state + } } } ` export const GET_TOP_CONTRIBUTORS = gql` - ${CONTRIBUTOR_FIELDS} query GetTopContributors( $excludedUsernames: [String!] $hasFullName: Boolean = false @@ -137,7 +150,10 @@ export const GET_TOP_CONTRIBUTORS = gql` limit: $limit project: $key ) { - ...ContributorFields + id + avatarUrl + login + name } } ` diff --git a/frontend/src/server/queries/userQueries.ts b/frontend/src/server/queries/userQueries.ts index 5997d194d0..5bf0573638 100644 --- a/frontend/src/server/queries/userQueries.ts +++ b/frontend/src/server/queries/userQueries.ts @@ -1,11 +1,14 @@ import { gql } from '@apollo/client' -import { LEADER_FIELDS } from 'server/fragments/userFragments' export const GET_LEADER_DATA = gql` - ${LEADER_FIELDS} query GetLeaderData($key: String!) { user(login: $key) { - ...LeaderFields + id + avatarUrl + company + location + login + name } } ` diff --git a/frontend/src/types/__generated__/projectFragments.generated.ts b/frontend/src/types/__generated__/projectFragments.generated.ts deleted file mode 100644 index 192680510d..0000000000 --- a/frontend/src/types/__generated__/projectFragments.generated.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as Types from './graphql'; - -import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; -export type ContributorFieldsFragment = { __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }; - -export type MilestoneMetadataFieldsFragment = { __typename: 'MilestoneNode', id: string, title: string, url: string, body: string, progress: number, state: string }; - -export type ProjectMetadataFieldsFragment = { __typename: 'ProjectNode', id: string, contributorsCount: number, forksCount: number, issuesCount: number, name: string, starsCount: number, summary: string, recentMilestones: Array<{ __typename: 'MilestoneNode', id: string, title: string, url: string, body: string, progress: number, state: string }> }; - -export const ContributorFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ContributorFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RepositoryContributorNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; -export const ProjectMetadataFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ProjectNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"25"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MilestoneMetadataFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MilestoneMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MilestoneNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/frontend/src/types/__generated__/projectQueries.generated.ts b/frontend/src/types/__generated__/projectQueries.generated.ts index 04d09adec2..587871fca9 100644 --- a/frontend/src/types/__generated__/projectQueries.generated.ts +++ b/frontend/src/types/__generated__/projectQueries.generated.ts @@ -33,7 +33,7 @@ export type SearchProjectNamesQueryVariables = Types.Exact<{ export type SearchProjectNamesQuery = { searchProjects: Array<{ __typename: 'ProjectNode', id: string, name: string }> }; -export const GetProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"languages"}},{"kind":"Field","name":{"kind":"Name","value":"leaders"}},{"kind":"Field","name":{"kind":"Name","value":"level"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"healthMetricsList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"30"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"lastCommitDays"}},{"kind":"Field","name":{"kind":"Name","value":"lastCommitDaysRequirement"}},{"kind":"Field","name":{"kind":"Name","value":"lastReleaseDays"}},{"kind":"Field","name":{"kind":"Name","value":"lastReleaseDaysRequirement"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"openPullRequestsCount"}},{"kind":"Field","name":{"kind":"Name","value":"score"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"unassignedIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"unansweredIssuesCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentIssues"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentReleases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"tagName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repositories"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"organization"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"login"}}]}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"subscribersCount"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repositoriesCount"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"topics"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"closedIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentPullRequests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"project"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ContributorFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ContributorFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RepositoryContributorNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; -export const GetProjectMetadataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProjectMetadata"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectMetadataFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MilestoneMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MilestoneNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ProjectNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"25"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MilestoneMetadataFields"}}]}}]}}]} as unknown as DocumentNode; -export const GetTopContributorsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTopContributors"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"excludedUsernames"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"hasFullName"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}},"defaultValue":{"kind":"BooleanValue","value":false}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"20"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"excludedUsernames"},"value":{"kind":"Variable","name":{"kind":"Name","value":"excludedUsernames"}}},{"kind":"Argument","name":{"kind":"Name","value":"hasFullName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"hasFullName"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"project"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ContributorFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ContributorFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RepositoryContributorNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; +export const GetProjectDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProject"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"languages"}},{"kind":"Field","name":{"kind":"Name","value":"leaders"}},{"kind":"Field","name":{"kind":"Name","value":"level"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"healthMetricsList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"30"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"lastCommitDays"}},{"kind":"Field","name":{"kind":"Name","value":"lastCommitDaysRequirement"}},{"kind":"Field","name":{"kind":"Name","value":"lastReleaseDays"}},{"kind":"Field","name":{"kind":"Name","value":"lastReleaseDaysRequirement"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"openPullRequestsCount"}},{"kind":"Field","name":{"kind":"Name","value":"score"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"unassignedIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"unansweredIssuesCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentIssues"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentReleases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"tagName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repositories"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"organization"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"login"}}]}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"subscribersCount"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"repositoriesCount"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"topics"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"closedIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentPullRequests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"project"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; +export const GetProjectMetadataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProjectMetadata"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"25"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetTopContributorsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTopContributors"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"excludedUsernames"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"hasFullName"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}},"defaultValue":{"kind":"BooleanValue","value":false}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"20"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"excludedUsernames"},"value":{"kind":"Variable","name":{"kind":"Name","value":"excludedUsernames"}}},{"kind":"Argument","name":{"kind":"Name","value":"hasFullName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"hasFullName"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"project"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const SearchProjectNamesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SearchProjectNames"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"query"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"searchProjects"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"query"},"value":{"kind":"Variable","name":{"kind":"Name","value":"query"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/frontend/src/types/__generated__/userFragments.generated.ts b/frontend/src/types/__generated__/userFragments.generated.ts deleted file mode 100644 index 074b4d4dea..0000000000 --- a/frontend/src/types/__generated__/userFragments.generated.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as Types from './graphql'; - -import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; -export type LeaderFieldsFragment = { __typename: 'UserNode', id: string, avatarUrl: string, company: string, location: string, login: string, name: string }; - -export const LeaderFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LeaderFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"UserNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/frontend/src/types/__generated__/userQueries.generated.ts b/frontend/src/types/__generated__/userQueries.generated.ts index 78f3913c98..6d50491dfc 100644 --- a/frontend/src/types/__generated__/userQueries.generated.ts +++ b/frontend/src/types/__generated__/userQueries.generated.ts @@ -23,6 +23,6 @@ export type GetUserMetadataQueryVariables = Types.Exact<{ export type GetUserMetadataQuery = { user: { __typename: 'UserNode', id: string, bio: string, login: string, name: string } | null }; -export const GetLeaderDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaderData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"LeaderFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LeaderFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"UserNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; +export const GetLeaderDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLeaderData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; export const GetUserDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetUserData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"recentIssues"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"closedIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentPullRequests"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentReleases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isPreRelease"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"tagName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"topContributedRepositories"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"organization"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"login"}}]}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"subscribersCount"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"bio"}},{"kind":"Field","name":{"kind":"Name","value":"company"}},{"kind":"Field","name":{"kind":"Name","value":"contributionsCount"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"followersCount"}},{"kind":"Field","name":{"kind":"Name","value":"followingCount"}},{"kind":"Field","name":{"kind":"Name","value":"issuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"publicRepositoriesCount"}},{"kind":"Field","name":{"kind":"Name","value":"releasesCount"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; export const GetUserMetadataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetUserMetadata"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"login"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"bio"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file From 98858fcb0035637758098e817fffefb3687ba77e Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Mon, 22 Sep 2025 22:06:09 +0530 Subject: [PATCH 12/25] change types to match generated graphql schema types make types optional to comply with partial queried data --- frontend/graphql-codegen.ts | 11 +++- frontend/src/app/members/[memberKey]/page.tsx | 4 +- .../[programKey]/modules/[moduleKey]/page.tsx | 2 +- frontend/src/app/mentorship/programs/page.tsx | 4 +- .../modules/[moduleKey]/edit/page.tsx | 6 +-- .../[programKey]/modules/create/page.tsx | 6 +-- .../mentorship/programs/[programKey]/page.tsx | 4 +- .../my/mentorship/programs/create/page.tsx | 2 +- .../[organizationKey]/layout.tsx | 2 +- .../repositories/[repositoryKey]/layout.tsx | 4 +- .../repositories/[repositoryKey]/page.tsx | 9 ++-- frontend/src/app/page.tsx | 4 +- .../src/app/projects/[projectKey]/layout.tsx | 4 +- frontend/src/app/settings/api-keys/page.tsx | 4 +- frontend/src/app/snapshots/[id]/layout.tsx | 4 +- .../__generated__/apiKeyQueries.generated.ts | 4 +- frontend/src/types/__generated__/graphql.ts | 4 +- .../__generated__/homeQueries.generated.ts | 2 +- .../moduleMutations.generated.ts | 4 +- .../__generated__/moduleQueries.generated.ts | 6 +-- .../organizationQueries.generated.ts | 2 +- .../programsMutations.generated.ts | 4 +- .../programsQueries.generated.ts | 6 +-- .../__generated__/projectQueries.generated.ts | 2 +- ...rojectsHealthDashboardQueries.generated.ts | 4 +- .../repositoryQueries.generated.ts | 2 +- .../snapshotQueries.generated.ts | 4 +- .../__generated__/userQueries.generated.ts | 2 +- frontend/src/types/chapter.ts | 20 +++---- frontend/src/types/committee.ts | 4 +- frontend/src/types/healthMetrics.ts | 52 +++++++++---------- frontend/src/types/issue.ts | 16 +++--- frontend/src/types/mentorship.ts | 22 +++----- frontend/src/types/milestone.ts | 14 ++--- frontend/src/types/organization.ts | 20 +++---- frontend/src/types/project.ts | 36 ++++++------- frontend/src/types/pullRequest.ts | 2 +- frontend/src/types/release.ts | 4 +- frontend/src/types/user.ts | 20 ++++--- frontend/src/utils/structuredData.ts | 21 ++++++-- 40 files changed, 181 insertions(+), 166 deletions(-) diff --git a/frontend/graphql-codegen.ts b/frontend/graphql-codegen.ts index 110539eeeb..0142730f6a 100644 --- a/frontend/graphql-codegen.ts +++ b/frontend/graphql-codegen.ts @@ -31,8 +31,7 @@ export default (async (): Promise => { // Allow nullable input fields to remain unspecified inputValue: false, }, - // Use `unknown` instead of `any` for unconfigured scalars - defaultScalarType: 'unknown', + defaultScalarType: 'any', // Apollo Client always includes `__typename` fields nonOptionalTypename: true, // Apollo Client doesn't add the `__typename` field to root types so @@ -51,6 +50,14 @@ export default (async (): Promise => { }, }, './src/types/__generated__/graphql.ts': { + config: { + scalars: { + // eslint-disable-next-line @typescript-eslint/naming-convention + Date: 'string | number', + // eslint-disable-next-line @typescript-eslint/naming-convention + DateTime: 'string | number', + }, + }, plugins: ['typescript'], }, }, diff --git a/frontend/src/app/members/[memberKey]/page.tsx b/frontend/src/app/members/[memberKey]/page.tsx index 08b7ea6bd0..094bf53ddc 100644 --- a/frontend/src/app/members/[memberKey]/page.tsx +++ b/frontend/src/app/members/[memberKey]/page.tsx @@ -18,7 +18,7 @@ import type { Milestone } from 'types/milestone' import type { RepositoryCardProps } from 'types/project' import type { PullRequest } from 'types/pullRequest' import type { Release } from 'types/release' -import type { UserDetails } from 'types/user' +import type { User } from 'types/user' import { formatDate } from 'utils/dateFormatter' import { drawContributions, fetchHeatmapData, HeatmapData } from 'utils/helpers/githubHeatmap' import DetailsCard from 'components/CardDetailsPage' @@ -26,7 +26,7 @@ import LoadingSpinner from 'components/LoadingSpinner' const UserDetailsPage: React.FC = () => { const { memberKey } = useParams<{ memberKey: string }>() - const [user, setUser] = useState() + const [user, setUser] = useState() const [issues, setIssues] = useState([]) const [topRepositories, setTopRepositories] = useState([]) const [milestones, setMilestones] = useState([]) diff --git a/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx b/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx index f756671470..71a4ed2b14 100644 --- a/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx +++ b/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx @@ -1,11 +1,11 @@ 'use client' -import Module from 'module' import { useQuery } from '@apollo/client/react' import upperFirst from 'lodash/upperFirst' import { useParams } from 'next/navigation' import { useEffect, useState } from 'react' import { ErrorDisplay, handleAppError } from 'app/global-error' import { GetProgramAdminsAndModulesDocument } from 'types/__generated__/moduleQueries.generated' +import { Module } from 'types/mentorship' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' diff --git a/frontend/src/app/mentorship/programs/page.tsx b/frontend/src/app/mentorship/programs/page.tsx index 66f78a897e..0a673d54bb 100644 --- a/frontend/src/app/mentorship/programs/page.tsx +++ b/frontend/src/app/mentorship/programs/page.tsx @@ -2,6 +2,7 @@ import { useSearchPage } from 'hooks/useSearchPage' import { useRouter } from 'next/navigation' +import { ProgramStatusEnum } from 'types/__generated__/graphql' import { Program } from 'types/mentorship' import ProgramCard from 'components/ProgramCard' import SearchPageLayout from 'components/SearchPageLayout' @@ -51,7 +52,8 @@ const ProgramsPage = () => { totalPages={totalPages} >
- {programs && programs.filter((p) => p.status === 'published').map(renderProgramCard)} + {programs && + programs.filter((p) => p.status === ProgramStatusEnum.Published).map(renderProgramCard)}
) diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/edit/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/edit/page.tsx index 7e5e5ba37b..81a5a08290 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/edit/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/edit/page.tsx @@ -6,7 +6,7 @@ import { useSession } from 'next-auth/react' import React, { useEffect, useState } from 'react' import { ErrorDisplay, handleAppError } from 'app/global-error' import { UPDATE_MODULE } from 'server/mutations/moduleMutations' -import { GET_PROGRAM_ADMINS_AND_MODULES } from 'server/queries/moduleQueries' +import { GetProgramAdminsAndModulesDocument } from 'types/__generated__/moduleQueries.generated' import type { ExtendedSession } from 'types/auth' import { EXPERIENCE_LEVELS, type ModuleFormData } from 'types/mentorship' import { formatDateForInput } from 'utils/dateFormatter' @@ -22,13 +22,13 @@ const EditModulePage = () => { const [formData, setFormData] = useState(null) const [accessStatus, setAccessStatus] = useState<'checking' | 'allowed' | 'denied'>('checking') - const [updateModule, { loading: mutationLoading }] = useMutation(UPDATE_MODULE) + const [updateModule, { loading: mutationLoading }] = useMutation(UPDATE_MODULE) // TODO: update const { data, loading: queryLoading, error: queryError, - } = useQuery(GET_PROGRAM_ADMINS_AND_MODULES, { + } = useQuery(GetProgramAdminsAndModulesDocument, { variables: { programKey, moduleKey }, skip: !programKey || !moduleKey, fetchPolicy: 'network-only', diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/modules/create/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/modules/create/page.tsx index d9da37009f..21d3c2ea0b 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/modules/create/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/modules/create/page.tsx @@ -6,7 +6,7 @@ import { useSession } from 'next-auth/react' import React, { useEffect, useState } from 'react' import { ErrorDisplay } from 'app/global-error' import { CREATE_MODULE } from 'server/mutations/moduleMutations' -import { GET_PROGRAM_ADMIN_DETAILS } from 'server/queries/programsQueries' +import { GetProgramAdminDetailsDocument } from 'types/__generated__/programsQueries.generated' import type { ExtendedSession } from 'types/auth' import { EXPERIENCE_LEVELS } from 'types/mentorship' import { parseCommaSeparated } from 'utils/parser' @@ -18,13 +18,13 @@ const CreateModulePage = () => { const { programKey } = useParams() as { programKey: string } const { data: sessionData, status: sessionStatus } = useSession() - const [createModule, { loading: mutationLoading }] = useMutation(CREATE_MODULE) + const [createModule, { loading: mutationLoading }] = useMutation(CREATE_MODULE) // TODO: update const { data: programData, loading: queryLoading, error: queryError, - } = useQuery(GET_PROGRAM_ADMIN_DETAILS, { + } = useQuery(GetProgramAdminDetailsDocument, { variables: { programKey }, skip: !programKey, fetchPolicy: 'network-only', diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx index b4fdb5d97b..de32f41240 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/page.tsx @@ -7,9 +7,10 @@ import { useSession } from 'next-auth/react' import { useEffect, useMemo, useState } from 'react' import { ErrorDisplay, handleAppError } from 'app/global-error' import { UPDATE_PROGRAM_STATUS_MUTATION } from 'server/mutations/programsMutations' +import { ProgramStatusEnum } from 'types/__generated__/graphql' import { GetProgramAndModulesDocument } from 'types/__generated__/programsQueries.generated' import type { ExtendedSession } from 'types/auth' -import { Program, ProgramStatusEnum, Module } from 'types/mentorship' +import { Program, Module } from 'types/mentorship' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' @@ -28,6 +29,7 @@ const ProgramDetailsPage = () => { const [isRefetching, setIsRefetching] = useState(false) const [updateProgram] = useMutation(UPDATE_PROGRAM_STATUS_MUTATION, { + // TODO: update onError: handleAppError, }) diff --git a/frontend/src/app/my/mentorship/programs/create/page.tsx b/frontend/src/app/my/mentorship/programs/create/page.tsx index 31225af1af..0634c06120 100644 --- a/frontend/src/app/my/mentorship/programs/create/page.tsx +++ b/frontend/src/app/my/mentorship/programs/create/page.tsx @@ -18,7 +18,7 @@ const CreateProgramPage = () => { const [redirected, setRedirected] = useState(false) - const [createProgram, { loading }] = useMutation(CREATE_PROGRAM) + const [createProgram, { loading }] = useMutation(CREATE_PROGRAM) // TODO: update const [formData, setFormData] = useState({ name: '', diff --git a/frontend/src/app/organizations/[organizationKey]/layout.tsx b/frontend/src/app/organizations/[organizationKey]/layout.tsx index bd595f7954..e0dedbea1b 100644 --- a/frontend/src/app/organizations/[organizationKey]/layout.tsx +++ b/frontend/src/app/organizations/[organizationKey]/layout.tsx @@ -3,7 +3,7 @@ import Script from 'next/script' import React from 'react' import { apolloClient } from 'server/apolloClient' import { - GET_ORGANIZATION_METADATA, + GET_ORGANIZATION_METADATA, // TODO: update GET_ORGANIZATION_DATA, } from 'server/queries/organizationQueries' import { generateSeoMetadata } from 'utils/metaconfig' diff --git a/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/layout.tsx b/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/layout.tsx index 5958bfadc5..877731db6e 100644 --- a/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/layout.tsx +++ b/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/layout.tsx @@ -1,7 +1,7 @@ import { Metadata } from 'next' import React from 'react' import { apolloClient } from 'server/apolloClient' -import { GET_REPOSITORY_METADATA } from 'server/queries/repositoryQueries' +import { GetRepositoryMetadataDocument } from 'types/__generated__/repositoryQueries.generated' import { generateSeoMetadata } from 'utils/metaconfig' export async function generateMetadata({ @@ -14,7 +14,7 @@ export async function generateMetadata({ }): Promise { const { repositoryKey, organizationKey } = await params const { data } = await apolloClient.query({ - query: GET_REPOSITORY_METADATA, + query: GetRepositoryMetadataDocument, variables: { organizationKey: organizationKey, repositoryKey: repositoryKey }, }) const repository = data?.repository diff --git a/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/page.tsx b/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/page.tsx index ea9816a089..8c67e6563c 100644 --- a/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/page.tsx +++ b/frontend/src/app/organizations/[organizationKey]/repositories/[repositoryKey]/page.tsx @@ -11,19 +11,22 @@ import Link from 'next/link' import { useParams } from 'next/navigation' import { useEffect, useState } from 'react' import { handleAppError, ErrorDisplay } from 'app/global-error' -import { GET_REPOSITORY_DATA } from 'server/queries/repositoryQueries' +import { GetRepositoryDataDocument } from 'types/__generated__/repositoryQueries.generated' import type { Contributor } from 'types/contributor' import { formatDate } from 'utils/dateFormatter' import DetailsCard from 'components/CardDetailsPage' import LoadingSpinner from 'components/LoadingSpinner' const RepositoryDetailsPage = () => { - const { repositoryKey, organizationKey } = useParams() + const { repositoryKey, organizationKey } = useParams<{ + repositoryKey: string + organizationKey: string + }>() const [repository, setRepository] = useState(null) const [topContributors, setTopContributors] = useState([]) const [recentPullRequests, setRecentPullRequests] = useState(null) const [isLoading, setIsLoading] = useState(true) - const { data, error: graphQLRequestError } = useQuery(GET_REPOSITORY_DATA, { + const { data, error: graphQLRequestError } = useQuery(GetRepositoryDataDocument, { variables: { repositoryKey: repositoryKey, organizationKey: organizationKey }, }) useEffect(() => { diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index 1679274c67..96ae9e7226 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -21,7 +21,7 @@ import upperFirst from 'lodash/upperFirst' import Link from 'next/link' import { useEffect, useState } from 'react' import { fetchAlgoliaData } from 'server/fetchAlgoliaData' -import { GET_MAIN_PAGE_DATA } from 'server/queries/homeQueries' +import { GetMainPageDataDocument } from 'types/__generated__/homeQueries.generated' import type { AlgoliaResponse } from 'types/algolia' import type { Chapter } from 'types/chapter' import type { Event } from 'types/event' @@ -47,7 +47,7 @@ import { TruncatedText } from 'components/TruncatedText' export default function Home() { const [isLoading, setIsLoading] = useState(true) const [data, setData] = useState(null) - const { data: graphQLData, error: graphQLRequestError } = useQuery(GET_MAIN_PAGE_DATA, { + const { data: graphQLData, error: graphQLRequestError } = useQuery(GetMainPageDataDocument, { variables: { distinct: true }, }) diff --git a/frontend/src/app/projects/[projectKey]/layout.tsx b/frontend/src/app/projects/[projectKey]/layout.tsx index e37c2307d2..1d8524007e 100644 --- a/frontend/src/app/projects/[projectKey]/layout.tsx +++ b/frontend/src/app/projects/[projectKey]/layout.tsx @@ -1,7 +1,7 @@ import { Metadata } from 'next' import React from 'react' import { apolloClient } from 'server/apolloClient' -import { GET_PROJECT_METADATA } from 'server/queries/projectQueries' +import { GetProjectMetadataDocument } from 'types/__generated__/projectQueries.generated' import { generateSeoMetadata } from 'utils/metaconfig' export async function generateMetadata({ @@ -13,7 +13,7 @@ export async function generateMetadata({ }): Promise { const { projectKey } = await params const { data } = await apolloClient.query({ - query: GET_PROJECT_METADATA, + query: GetProjectMetadataDocument, variables: { key: projectKey, }, diff --git a/frontend/src/app/settings/api-keys/page.tsx b/frontend/src/app/settings/api-keys/page.tsx index 5f119b37fd..d2d31e2edf 100644 --- a/frontend/src/app/settings/api-keys/page.tsx +++ b/frontend/src/app/settings/api-keys/page.tsx @@ -106,9 +106,9 @@ export default function Page() { addToast({ title: 'Error', description: 'Please select an expiration date', color: 'danger' }) return } - const variables: { name: string; expiresAt: Date } = { + const variables: { name: string; expiresAt: string } = { name: newKeyName.trim(), - expiresAt: new Date(newKeyExpiry), + expiresAt: new Date(newKeyExpiry).toISOString(), } createApiKey({ variables }) } diff --git a/frontend/src/app/snapshots/[id]/layout.tsx b/frontend/src/app/snapshots/[id]/layout.tsx index b5d53f12b2..c8b9d5e82c 100644 --- a/frontend/src/app/snapshots/[id]/layout.tsx +++ b/frontend/src/app/snapshots/[id]/layout.tsx @@ -1,7 +1,7 @@ import { Metadata } from 'next' import React from 'react' import { apolloClient } from 'server/apolloClient' -import { GET_SNAPSHOT_DETAILS_METADATA } from 'server/queries/snapshotQueries' +import { GetSnapshotDetailsMetadataDocument } from 'types/__generated__/snapshotQueries.generated' import { generateSeoMetadata } from 'utils/metaconfig' export async function generateMetadata({ @@ -11,7 +11,7 @@ export async function generateMetadata({ }): Promise { const { id: snapshotKey } = await params const { data } = await apolloClient.query({ - query: GET_SNAPSHOT_DETAILS_METADATA, + query: GetSnapshotDetailsMetadataDocument, variables: { key: snapshotKey }, }) const snapshot = data?.snapshot diff --git a/frontend/src/types/__generated__/apiKeyQueries.generated.ts b/frontend/src/types/__generated__/apiKeyQueries.generated.ts index 8f6eb3d8e8..a5a2c3e47d 100644 --- a/frontend/src/types/__generated__/apiKeyQueries.generated.ts +++ b/frontend/src/types/__generated__/apiKeyQueries.generated.ts @@ -4,7 +4,7 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ export type GetApiKeysQueryVariables = Types.Exact<{ [key: string]: never; }>; -export type GetApiKeysQuery = { activeApiKeyCount: number, apiKeys: Array<{ __typename: 'ApiKeyNode', id: string, createdAt: unknown, expiresAt: unknown, isRevoked: boolean, name: string, uuid: unknown }> }; +export type GetApiKeysQuery = { activeApiKeyCount: number, apiKeys: Array<{ __typename: 'ApiKeyNode', id: string, createdAt: any, expiresAt: any, isRevoked: boolean, name: string, uuid: any }> }; export type CreateApiKeyMutationVariables = Types.Exact<{ name: Types.Scalars['String']['input']; @@ -12,7 +12,7 @@ export type CreateApiKeyMutationVariables = Types.Exact<{ }>; -export type CreateApiKeyMutation = { createApiKey: { __typename: 'CreateApiKeyResult', code: string | null, message: string | null, ok: boolean, rawKey: string | null, apiKey: { __typename: 'ApiKeyNode', id: string, createdAt: unknown, expiresAt: unknown, isRevoked: boolean, name: string, uuid: unknown } | null } }; +export type CreateApiKeyMutation = { createApiKey: { __typename: 'CreateApiKeyResult', code: string | null, message: string | null, ok: boolean, rawKey: string | null, apiKey: { __typename: 'ApiKeyNode', id: string, createdAt: any, expiresAt: any, isRevoked: boolean, name: string, uuid: any } | null } }; export type RevokeApiKeyMutationVariables = Types.Exact<{ uuid: Types.Scalars['UUID']['input']; diff --git a/frontend/src/types/__generated__/graphql.ts b/frontend/src/types/__generated__/graphql.ts index 17f2ff0c06..c2df58b1e9 100644 --- a/frontend/src/types/__generated__/graphql.ts +++ b/frontend/src/types/__generated__/graphql.ts @@ -12,8 +12,8 @@ export type Scalars = { Boolean: { input: boolean; output: boolean; } Int: { input: number; output: number; } Float: { input: number; output: number; } - Date: { input: any; output: any; } - DateTime: { input: any; output: any; } + Date: { input: string | number; output: string | number; } + DateTime: { input: string | number; output: string | number; } JSON: { input: any; output: any; } UUID: { input: any; output: any; } }; diff --git a/frontend/src/types/__generated__/homeQueries.generated.ts b/frontend/src/types/__generated__/homeQueries.generated.ts index da5cf21a1e..d73b89a6d5 100644 --- a/frontend/src/types/__generated__/homeQueries.generated.ts +++ b/frontend/src/types/__generated__/homeQueries.generated.ts @@ -6,7 +6,7 @@ export type GetMainPageDataQueryVariables = Types.Exact<{ }>; -export type GetMainPageDataQuery = { recentProjects: Array<{ __typename: 'ProjectNode', id: string, createdAt: unknown | null, key: string, leaders: Array, name: string, openIssuesCount: number, repositoriesCount: number, type: string }>, recentPosts: Array<{ __typename: 'PostNode', id: string, authorName: string, authorImageUrl: string, publishedAt: unknown, title: string, url: string }>, recentChapters: Array<{ __typename: 'ChapterNode', id: string, createdAt: number, key: string, leaders: Array, name: string, suggestedLocation: string | null }>, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }>, recentIssues: Array<{ __typename: 'IssueNode', id: string, createdAt: unknown, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, recentPullRequests: Array<{ __typename: 'PullRequestNode', id: string, createdAt: unknown, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, recentReleases: Array<{ __typename: 'ReleaseNode', id: string, name: string, organizationName: string | null, publishedAt: unknown | null, repositoryName: string | null, tagName: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, sponsors: Array<{ __typename: 'SponsorNode', id: string, imageUrl: string, name: string, sponsorType: string, url: string }>, statsOverview: { __typename: 'StatsNode', activeChaptersStats: number, activeProjectsStats: number, contributorsStats: number, countriesStats: number, slackWorkspaceStats: number }, upcomingEvents: Array<{ __typename: 'EventNode', id: string, category: string, endDate: unknown | null, key: string, name: string, startDate: unknown, summary: string, suggestedLocation: string, url: string }>, recentMilestones: Array<{ __typename: 'MilestoneNode', id: string, title: string, openIssuesCount: number, closedIssuesCount: number, repositoryName: string | null, organizationName: string | null, createdAt: unknown, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }> }; +export type GetMainPageDataQuery = { recentProjects: Array<{ __typename: 'ProjectNode', id: string, createdAt: any | null, key: string, leaders: Array, name: string, openIssuesCount: number, repositoriesCount: number, type: string }>, recentPosts: Array<{ __typename: 'PostNode', id: string, authorName: string, authorImageUrl: string, publishedAt: any, title: string, url: string }>, recentChapters: Array<{ __typename: 'ChapterNode', id: string, createdAt: number, key: string, leaders: Array, name: string, suggestedLocation: string | null }>, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }>, recentIssues: Array<{ __typename: 'IssueNode', id: string, createdAt: any, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, recentPullRequests: Array<{ __typename: 'PullRequestNode', id: string, createdAt: any, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, recentReleases: Array<{ __typename: 'ReleaseNode', id: string, name: string, organizationName: string | null, publishedAt: any | null, repositoryName: string | null, tagName: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, sponsors: Array<{ __typename: 'SponsorNode', id: string, imageUrl: string, name: string, sponsorType: string, url: string }>, statsOverview: { __typename: 'StatsNode', activeChaptersStats: number, activeProjectsStats: number, contributorsStats: number, countriesStats: number, slackWorkspaceStats: number }, upcomingEvents: Array<{ __typename: 'EventNode', id: string, category: string, endDate: any | null, key: string, name: string, startDate: any, summary: string, suggestedLocation: string, url: string }>, recentMilestones: Array<{ __typename: 'MilestoneNode', id: string, title: string, openIssuesCount: number, closedIssuesCount: number, repositoryName: string | null, organizationName: string | null, createdAt: any, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }> }; export const GetMainPageDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetMainPageData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"distinct"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"recentProjects"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"3"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"leaders"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"repositoriesCount"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentPosts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"6"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"authorName"}},{"kind":"Field","name":{"kind":"Name","value":"authorImageUrl"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentChapters"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"3"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"leaders"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"suggestedLocation"}}]}},{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"hasFullName"},"value":{"kind":"BooleanValue","value":true}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"40"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentIssues"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"distinct"},"value":{"kind":"Variable","name":{"kind":"Name","value":"distinct"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentPullRequests"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"distinct"},"value":{"kind":"Variable","name":{"kind":"Name","value":"distinct"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentReleases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"distinct"},"value":{"kind":"Variable","name":{"kind":"Name","value":"distinct"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"tagName"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"sponsors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"imageUrl"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"sponsorType"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"statsOverview"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeChaptersStats"}},{"kind":"Field","name":{"kind":"Name","value":"activeProjectsStats"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsStats"}},{"kind":"Field","name":{"kind":"Name","value":"countriesStats"}},{"kind":"Field","name":{"kind":"Name","value":"slackWorkspaceStats"}}]}},{"kind":"Field","name":{"kind":"Name","value":"upcomingEvents"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"9"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"suggestedLocation"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}},{"kind":"Field","name":{"kind":"Name","value":"recentMilestones"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"5"}},{"kind":"Argument","name":{"kind":"Name","value":"state"},"value":{"kind":"StringValue","value":"all","block":false}},{"kind":"Argument","name":{"kind":"Name","value":"distinct"},"value":{"kind":"Variable","name":{"kind":"Name","value":"distinct"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"openIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"closedIssuesCount"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/frontend/src/types/__generated__/moduleMutations.generated.ts b/frontend/src/types/__generated__/moduleMutations.generated.ts index 298ec04aa9..2a0cc1c862 100644 --- a/frontend/src/types/__generated__/moduleMutations.generated.ts +++ b/frontend/src/types/__generated__/moduleMutations.generated.ts @@ -6,14 +6,14 @@ export type UpdateModuleMutationVariables = Types.Exact<{ }>; -export type UpdateModuleMutation = { updateModule: { __typename: 'ModuleNode', id: string, key: string, name: string, description: string, experienceLevel: Types.ExperienceLevelEnum, startedAt: unknown, endedAt: unknown, tags: Array | null, domains: Array | null, projectId: string | null, mentors: Array<{ __typename: 'MentorNode', login: string, name: string, avatarUrl: string }> } }; +export type UpdateModuleMutation = { updateModule: { __typename: 'ModuleNode', id: string, key: string, name: string, description: string, experienceLevel: Types.ExperienceLevelEnum, startedAt: any, endedAt: any, tags: Array | null, domains: Array | null, projectId: string | null, mentors: Array<{ __typename: 'MentorNode', login: string, name: string, avatarUrl: string }> } }; export type CreateModuleMutationVariables = Types.Exact<{ input: Types.CreateModuleInput; }>; -export type CreateModuleMutation = { createModule: { __typename: 'ModuleNode', id: string, key: string, name: string, description: string, experienceLevel: Types.ExperienceLevelEnum, startedAt: unknown, endedAt: unknown, domains: Array | null, tags: Array | null, projectId: string | null, mentors: Array<{ __typename: 'MentorNode', login: string, name: string, avatarUrl: string }> } }; +export type CreateModuleMutation = { createModule: { __typename: 'ModuleNode', id: string, key: string, name: string, description: string, experienceLevel: Types.ExperienceLevelEnum, startedAt: any, endedAt: any, domains: Array | null, tags: Array | null, projectId: string | null, mentors: Array<{ __typename: 'MentorNode', login: string, name: string, avatarUrl: string }> } }; export const UpdateModuleDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateModule"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateModuleInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateModule"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"inputData"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"experienceLevel"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"tags"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"mentors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}}]}}]}}]}}]} as unknown as DocumentNode; diff --git a/frontend/src/types/__generated__/moduleQueries.generated.ts b/frontend/src/types/__generated__/moduleQueries.generated.ts index 50d5bbc5bc..11aed263c9 100644 --- a/frontend/src/types/__generated__/moduleQueries.generated.ts +++ b/frontend/src/types/__generated__/moduleQueries.generated.ts @@ -6,7 +6,7 @@ export type GetModulesByProgramQueryVariables = Types.Exact<{ }>; -export type GetModulesByProgramQuery = { getProgramModules: Array<{ __typename: 'ModuleNode', id: string, key: string, name: string, description: string, experienceLevel: Types.ExperienceLevelEnum, startedAt: unknown, endedAt: unknown, projectId: string | null, projectName: string | null, mentors: Array<{ __typename: 'MentorNode', id: string, login: string, avatarUrl: string }> }> }; +export type GetModulesByProgramQuery = { getProgramModules: Array<{ __typename: 'ModuleNode', id: string, key: string, name: string, description: string, experienceLevel: Types.ExperienceLevelEnum, startedAt: any, endedAt: any, projectId: string | null, projectName: string | null, mentors: Array<{ __typename: 'MentorNode', id: string, login: string, avatarUrl: string }> }> }; export type GetModuleByIdQueryVariables = Types.Exact<{ moduleKey: Types.Scalars['String']['input']; @@ -14,7 +14,7 @@ export type GetModuleByIdQueryVariables = Types.Exact<{ }>; -export type GetModuleByIdQuery = { getModule: { __typename: 'ModuleNode', id: string, key: string, name: string, description: string, tags: Array | null, domains: Array | null, experienceLevel: Types.ExperienceLevelEnum, startedAt: unknown, endedAt: unknown, mentors: Array<{ __typename: 'MentorNode', id: string, login: string, name: string, avatarUrl: string }> } }; +export type GetModuleByIdQuery = { getModule: { __typename: 'ModuleNode', id: string, key: string, name: string, description: string, tags: Array | null, domains: Array | null, experienceLevel: Types.ExperienceLevelEnum, startedAt: any, endedAt: any, mentors: Array<{ __typename: 'MentorNode', id: string, login: string, name: string, avatarUrl: string }> } }; export type GetProgramAdminsAndModulesQueryVariables = Types.Exact<{ programKey: Types.Scalars['String']['input']; @@ -22,7 +22,7 @@ export type GetProgramAdminsAndModulesQueryVariables = Types.Exact<{ }>; -export type GetProgramAdminsAndModulesQuery = { getProgram: { __typename: 'ProgramNode', id: string, admins: Array<{ __typename: 'MentorNode', id: string, login: string, name: string, avatarUrl: string }> | null }, getModule: { __typename: 'ModuleNode', id: string, key: string, name: string, description: string, tags: Array | null, projectId: string | null, projectName: string | null, domains: Array | null, experienceLevel: Types.ExperienceLevelEnum, startedAt: unknown, endedAt: unknown, mentors: Array<{ __typename: 'MentorNode', id: string, login: string, name: string, avatarUrl: string }> } }; +export type GetProgramAdminsAndModulesQuery = { getProgram: { __typename: 'ProgramNode', id: string, admins: Array<{ __typename: 'MentorNode', id: string, login: string, name: string, avatarUrl: string }> | null }, getModule: { __typename: 'ModuleNode', id: string, key: string, name: string, description: string, tags: Array | null, projectId: string | null, projectName: string | null, domains: Array | null, experienceLevel: Types.ExperienceLevelEnum, startedAt: any, endedAt: any, mentors: Array<{ __typename: 'MentorNode', id: string, login: string, name: string, avatarUrl: string }> } }; export const GetModulesByProgramDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetModulesByProgram"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"programKey"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getProgramModules"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"programKey"},"value":{"kind":"Variable","name":{"kind":"Name","value":"programKey"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"experienceLevel"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"projectName"}},{"kind":"Field","name":{"kind":"Name","value":"mentors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}}]}}]}}]}}]} as unknown as DocumentNode; diff --git a/frontend/src/types/__generated__/organizationQueries.generated.ts b/frontend/src/types/__generated__/organizationQueries.generated.ts index 26c2215850..a6973cf7dc 100644 --- a/frontend/src/types/__generated__/organizationQueries.generated.ts +++ b/frontend/src/types/__generated__/organizationQueries.generated.ts @@ -6,7 +6,7 @@ export type GetOrganizationDataQueryVariables = Types.Exact<{ }>; -export type GetOrganizationDataQuery = { organization: { __typename: 'OrganizationNode', id: string, avatarUrl: string, collaboratorsCount: number, company: string, createdAt: unknown, description: string, email: string, followersCount: number, location: string, login: string, name: string, updatedAt: unknown, url: string, stats: { __typename: 'OrganizationStatsNode', totalContributors: number, totalForks: number, totalIssues: number, totalRepositories: number, totalStars: number } } | null, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }>, recentPullRequests: Array<{ __typename: 'PullRequestNode', id: string, createdAt: unknown, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, recentReleases: Array<{ __typename: 'ReleaseNode', id: string, name: string, organizationName: string | null, publishedAt: unknown | null, repositoryName: string | null, tagName: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, recentMilestones: Array<{ __typename: 'MilestoneNode', id: string, title: string, openIssuesCount: number, closedIssuesCount: number, repositoryName: string | null, organizationName: string | null, createdAt: unknown, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, repositories: Array<{ __typename: 'RepositoryNode', id: string, contributorsCount: number, forksCount: number, key: string, name: string, openIssuesCount: number, starsCount: number, url: string, organization: { __typename: 'OrganizationNode', id: string, login: string } | null }>, recentIssues: Array<{ __typename: 'IssueNode', id: string, createdAt: unknown, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }> }; +export type GetOrganizationDataQuery = { organization: { __typename: 'OrganizationNode', id: string, avatarUrl: string, collaboratorsCount: number, company: string, createdAt: any, description: string, email: string, followersCount: number, location: string, login: string, name: string, updatedAt: any, url: string, stats: { __typename: 'OrganizationStatsNode', totalContributors: number, totalForks: number, totalIssues: number, totalRepositories: number, totalStars: number } } | null, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }>, recentPullRequests: Array<{ __typename: 'PullRequestNode', id: string, createdAt: any, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, recentReleases: Array<{ __typename: 'ReleaseNode', id: string, name: string, organizationName: string | null, publishedAt: any | null, repositoryName: string | null, tagName: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, recentMilestones: Array<{ __typename: 'MilestoneNode', id: string, title: string, openIssuesCount: number, closedIssuesCount: number, repositoryName: string | null, organizationName: string | null, createdAt: any, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, repositories: Array<{ __typename: 'RepositoryNode', id: string, contributorsCount: number, forksCount: number, key: string, name: string, openIssuesCount: number, starsCount: number, url: string, organization: { __typename: 'OrganizationNode', id: string, login: string } | null }>, recentIssues: Array<{ __typename: 'IssueNode', id: string, createdAt: any, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }> }; export type GetOrganizationMetadataQueryVariables = Types.Exact<{ login: Types.Scalars['String']['input']; diff --git a/frontend/src/types/__generated__/programsMutations.generated.ts b/frontend/src/types/__generated__/programsMutations.generated.ts index 95e8a0f5c9..f402e987fc 100644 --- a/frontend/src/types/__generated__/programsMutations.generated.ts +++ b/frontend/src/types/__generated__/programsMutations.generated.ts @@ -6,14 +6,14 @@ export type UpdateProgramMutationVariables = Types.Exact<{ }>; -export type UpdateProgramMutation = { updateProgram: { __typename: 'ProgramNode', key: string, name: string, description: string, status: Types.ProgramStatusEnum, menteesLimit: number | null, startedAt: unknown, endedAt: unknown, tags: Array | null, domains: Array | null, admins: Array<{ __typename: 'MentorNode', login: string }> | null } }; +export type UpdateProgramMutation = { updateProgram: { __typename: 'ProgramNode', key: string, name: string, description: string, status: Types.ProgramStatusEnum, menteesLimit: number | null, startedAt: any, endedAt: any, tags: Array | null, domains: Array | null, admins: Array<{ __typename: 'MentorNode', login: string }> | null } }; export type CreateProgramMutationVariables = Types.Exact<{ input: Types.CreateProgramInput; }>; -export type CreateProgramMutation = { createProgram: { __typename: 'ProgramNode', id: string, key: string, name: string, description: string, menteesLimit: number | null, startedAt: unknown, endedAt: unknown, tags: Array | null, domains: Array | null, admins: Array<{ __typename: 'MentorNode', login: string, name: string, avatarUrl: string }> | null } }; +export type CreateProgramMutation = { createProgram: { __typename: 'ProgramNode', id: string, key: string, name: string, description: string, menteesLimit: number | null, startedAt: any, endedAt: any, tags: Array | null, domains: Array | null, admins: Array<{ __typename: 'MentorNode', login: string, name: string, avatarUrl: string }> | null } }; export type UpdateProgramStatusMutationVariables = Types.Exact<{ inputData: Types.UpdateProgramStatusInput; diff --git a/frontend/src/types/__generated__/programsQueries.generated.ts b/frontend/src/types/__generated__/programsQueries.generated.ts index daa4783da8..876b59b346 100644 --- a/frontend/src/types/__generated__/programsQueries.generated.ts +++ b/frontend/src/types/__generated__/programsQueries.generated.ts @@ -8,21 +8,21 @@ export type GetMyProgramsQueryVariables = Types.Exact<{ }>; -export type GetMyProgramsQuery = { myPrograms: { __typename: 'PaginatedPrograms', currentPage: number, totalPages: number, programs: Array<{ __typename: 'ProgramNode', id: string, key: string, name: string, description: string, startedAt: unknown, endedAt: unknown, userRole: string | null }> } }; +export type GetMyProgramsQuery = { myPrograms: { __typename: 'PaginatedPrograms', currentPage: number, totalPages: number, programs: Array<{ __typename: 'ProgramNode', id: string, key: string, name: string, description: string, startedAt: any, endedAt: any, userRole: string | null }> } }; export type GetProgramDetailsQueryVariables = Types.Exact<{ programKey: Types.Scalars['String']['input']; }>; -export type GetProgramDetailsQuery = { getProgram: { __typename: 'ProgramNode', id: string, key: string, name: string, description: string, status: Types.ProgramStatusEnum, menteesLimit: number | null, experienceLevels: Array | null, startedAt: unknown, endedAt: unknown, domains: Array | null, tags: Array | null, admins: Array<{ __typename: 'MentorNode', id: string, login: string, name: string, avatarUrl: string }> | null } }; +export type GetProgramDetailsQuery = { getProgram: { __typename: 'ProgramNode', id: string, key: string, name: string, description: string, status: Types.ProgramStatusEnum, menteesLimit: number | null, experienceLevels: Array | null, startedAt: any, endedAt: any, domains: Array | null, tags: Array | null, admins: Array<{ __typename: 'MentorNode', id: string, login: string, name: string, avatarUrl: string }> | null } }; export type GetProgramAndModulesQueryVariables = Types.Exact<{ programKey: Types.Scalars['String']['input']; }>; -export type GetProgramAndModulesQuery = { getProgram: { __typename: 'ProgramNode', id: string, key: string, name: string, description: string, status: Types.ProgramStatusEnum, menteesLimit: number | null, experienceLevels: Array | null, startedAt: unknown, endedAt: unknown, domains: Array | null, tags: Array | null, admins: Array<{ __typename: 'MentorNode', id: string, login: string, name: string, avatarUrl: string }> | null }, getProgramModules: Array<{ __typename: 'ModuleNode', id: string, key: string, name: string, description: string, experienceLevel: Types.ExperienceLevelEnum, startedAt: unknown, endedAt: unknown, mentors: Array<{ __typename: 'MentorNode', id: string, login: string, name: string, avatarUrl: string }> }> }; +export type GetProgramAndModulesQuery = { getProgram: { __typename: 'ProgramNode', id: string, key: string, name: string, description: string, status: Types.ProgramStatusEnum, menteesLimit: number | null, experienceLevels: Array | null, startedAt: any, endedAt: any, domains: Array | null, tags: Array | null, admins: Array<{ __typename: 'MentorNode', id: string, login: string, name: string, avatarUrl: string }> | null }, getProgramModules: Array<{ __typename: 'ModuleNode', id: string, key: string, name: string, description: string, experienceLevel: Types.ExperienceLevelEnum, startedAt: any, endedAt: any, mentors: Array<{ __typename: 'MentorNode', id: string, login: string, name: string, avatarUrl: string }> }> }; export type GetProgramAdminDetailsQueryVariables = Types.Exact<{ programKey: Types.Scalars['String']['input']; diff --git a/frontend/src/types/__generated__/projectQueries.generated.ts b/frontend/src/types/__generated__/projectQueries.generated.ts index 587871fca9..9c6790e484 100644 --- a/frontend/src/types/__generated__/projectQueries.generated.ts +++ b/frontend/src/types/__generated__/projectQueries.generated.ts @@ -6,7 +6,7 @@ export type GetProjectQueryVariables = Types.Exact<{ }>; -export type GetProjectQuery = { project: { __typename: 'ProjectNode', id: string, contributorsCount: number, forksCount: number, issuesCount: number, isActive: boolean, key: string, languages: Array, leaders: Array, level: string, name: string, repositoriesCount: number, starsCount: number, summary: string, topics: Array, type: string, updatedAt: number, url: string, healthMetricsList: Array<{ __typename: 'ProjectHealthMetricsNode', id: string, createdAt: unknown, forksCount: number, lastCommitDays: number, lastCommitDaysRequirement: number, lastReleaseDays: number, lastReleaseDaysRequirement: number, openIssuesCount: number, openPullRequestsCount: number, score: number | null, starsCount: number, unassignedIssuesCount: number, unansweredIssuesCount: number }>, recentIssues: Array<{ __typename: 'IssueNode', createdAt: unknown, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string, url: string } | null }>, recentReleases: Array<{ __typename: 'ReleaseNode', name: string, organizationName: string | null, publishedAt: unknown | null, repositoryName: string | null, tagName: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, repositories: Array<{ __typename: 'RepositoryNode', id: string, contributorsCount: number, forksCount: number, key: string, name: string, openIssuesCount: number, starsCount: number, subscribersCount: number, url: string, organization: { __typename: 'OrganizationNode', login: string } | null }>, recentMilestones: Array<{ __typename: 'MilestoneNode', title: string, openIssuesCount: number, closedIssuesCount: number, repositoryName: string | null, organizationName: string | null, createdAt: unknown, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, recentPullRequests: Array<{ __typename: 'PullRequestNode', createdAt: unknown, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }> } | null, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }> }; +export type GetProjectQuery = { project: { __typename: 'ProjectNode', id: string, contributorsCount: number, forksCount: number, issuesCount: number, isActive: boolean, key: string, languages: Array, leaders: Array, level: string, name: string, repositoriesCount: number, starsCount: number, summary: string, topics: Array, type: string, updatedAt: number, url: string, healthMetricsList: Array<{ __typename: 'ProjectHealthMetricsNode', id: string, createdAt: any, forksCount: number, lastCommitDays: number, lastCommitDaysRequirement: number, lastReleaseDays: number, lastReleaseDaysRequirement: number, openIssuesCount: number, openPullRequestsCount: number, score: number | null, starsCount: number, unassignedIssuesCount: number, unansweredIssuesCount: number }>, recentIssues: Array<{ __typename: 'IssueNode', createdAt: any, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string, url: string } | null }>, recentReleases: Array<{ __typename: 'ReleaseNode', name: string, organizationName: string | null, publishedAt: any | null, repositoryName: string | null, tagName: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, repositories: Array<{ __typename: 'RepositoryNode', id: string, contributorsCount: number, forksCount: number, key: string, name: string, openIssuesCount: number, starsCount: number, subscribersCount: number, url: string, organization: { __typename: 'OrganizationNode', login: string } | null }>, recentMilestones: Array<{ __typename: 'MilestoneNode', title: string, openIssuesCount: number, closedIssuesCount: number, repositoryName: string | null, organizationName: string | null, createdAt: any, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, recentPullRequests: Array<{ __typename: 'PullRequestNode', createdAt: any, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }> } | null, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }> }; export type GetProjectMetadataQueryVariables = Types.Exact<{ key: Types.Scalars['String']['input']; diff --git a/frontend/src/types/__generated__/projectsHealthDashboardQueries.generated.ts b/frontend/src/types/__generated__/projectsHealthDashboardQueries.generated.ts index 72870bba8a..8ac5638ef0 100644 --- a/frontend/src/types/__generated__/projectsHealthDashboardQueries.generated.ts +++ b/frontend/src/types/__generated__/projectsHealthDashboardQueries.generated.ts @@ -13,14 +13,14 @@ export type GetProjectHealthMetricsQueryVariables = Types.Exact<{ }>; -export type GetProjectHealthMetricsQuery = { projectHealthMetricsDistinctLength: number, projectHealthMetrics: Array<{ __typename: 'ProjectHealthMetricsNode', id: string, createdAt: unknown, contributorsCount: number, forksCount: number, projectKey: string, projectName: string, score: number | null, starsCount: number }> }; +export type GetProjectHealthMetricsQuery = { projectHealthMetricsDistinctLength: number, projectHealthMetrics: Array<{ __typename: 'ProjectHealthMetricsNode', id: string, createdAt: any, contributorsCount: number, forksCount: number, projectKey: string, projectName: string, score: number | null, starsCount: number }> }; export type GetProjectHealthMetricsDetailsQueryVariables = Types.Exact<{ projectKey: Types.Scalars['String']['input']; }>; -export type GetProjectHealthMetricsDetailsQuery = { project: { __typename: 'ProjectNode', id: string, healthMetricsLatest: { __typename: 'ProjectHealthMetricsNode', id: string, ageDays: number, ageDaysRequirement: number, isFundingRequirementsCompliant: boolean, isLeaderRequirementsCompliant: boolean, lastCommitDays: number, lastCommitDaysRequirement: number, lastPullRequestDays: number, lastPullRequestDaysRequirement: number, lastReleaseDays: number, lastReleaseDaysRequirement: number, owaspPageLastUpdateDays: number, owaspPageLastUpdateDaysRequirement: number, projectName: string, score: number | null } | null, healthMetricsList: Array<{ __typename: 'ProjectHealthMetricsNode', id: string, contributorsCount: number, createdAt: unknown, forksCount: number, openIssuesCount: number, openPullRequestsCount: number, recentReleasesCount: number, starsCount: number, totalIssuesCount: number, totalReleasesCount: number, unassignedIssuesCount: number, unansweredIssuesCount: number }> } | null }; +export type GetProjectHealthMetricsDetailsQuery = { project: { __typename: 'ProjectNode', id: string, healthMetricsLatest: { __typename: 'ProjectHealthMetricsNode', id: string, ageDays: number, ageDaysRequirement: number, isFundingRequirementsCompliant: boolean, isLeaderRequirementsCompliant: boolean, lastCommitDays: number, lastCommitDaysRequirement: number, lastPullRequestDays: number, lastPullRequestDaysRequirement: number, lastReleaseDays: number, lastReleaseDaysRequirement: number, owaspPageLastUpdateDays: number, owaspPageLastUpdateDaysRequirement: number, projectName: string, score: number | null } | null, healthMetricsList: Array<{ __typename: 'ProjectHealthMetricsNode', id: string, contributorsCount: number, createdAt: any, forksCount: number, openIssuesCount: number, openPullRequestsCount: number, recentReleasesCount: number, starsCount: number, totalIssuesCount: number, totalReleasesCount: number, unassignedIssuesCount: number, unansweredIssuesCount: number }> } | null }; export const GetProjectHealthStatsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetProjectHealthStats"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"projectHealthStats"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"averageScore"}},{"kind":"Field","name":{"kind":"Name","value":"monthlyOverallScores"}},{"kind":"Field","name":{"kind":"Name","value":"monthlyOverallScoresMonths"}},{"kind":"Field","name":{"kind":"Name","value":"projectsCountHealthy"}},{"kind":"Field","name":{"kind":"Name","value":"projectsCountNeedAttention"}},{"kind":"Field","name":{"kind":"Name","value":"projectsCountUnhealthy"}},{"kind":"Field","name":{"kind":"Name","value":"projectsPercentageHealthy"}},{"kind":"Field","name":{"kind":"Name","value":"projectsPercentageNeedAttention"}},{"kind":"Field","name":{"kind":"Name","value":"projectsPercentageUnhealthy"}},{"kind":"Field","name":{"kind":"Name","value":"totalContributors"}},{"kind":"Field","name":{"kind":"Name","value":"totalForks"}},{"kind":"Field","name":{"kind":"Name","value":"totalStars"}}]}}]}}]} as unknown as DocumentNode; diff --git a/frontend/src/types/__generated__/repositoryQueries.generated.ts b/frontend/src/types/__generated__/repositoryQueries.generated.ts index 6b17f62d21..cee91ea9ba 100644 --- a/frontend/src/types/__generated__/repositoryQueries.generated.ts +++ b/frontend/src/types/__generated__/repositoryQueries.generated.ts @@ -7,7 +7,7 @@ export type GetRepositoryDataQueryVariables = Types.Exact<{ }>; -export type GetRepositoryDataQuery = { repository: { __typename: 'RepositoryNode', id: string, commitsCount: number, contributorsCount: number, createdAt: unknown, description: string, forksCount: number, key: string, languages: Array, license: string, name: string, openIssuesCount: number, size: number, starsCount: number, topics: Array, updatedAt: unknown, url: string, issues: Array<{ __typename: 'IssueNode', id: string, organizationName: string | null, repositoryName: string | null, createdAt: unknown, title: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, organization: { __typename: 'OrganizationNode', id: string, login: string } | null, project: { __typename: 'ProjectNode', id: string, key: string, name: string } | null, releases: Array<{ __typename: 'ReleaseNode', id: string, isPreRelease: boolean, name: string, organizationName: string | null, publishedAt: unknown | null, repositoryName: string | null, tagName: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, name: string, login: string } | null }>, recentMilestones: Array<{ __typename: 'MilestoneNode', id: string, title: string, openIssuesCount: number, closedIssuesCount: number, repositoryName: string | null, organizationName: string | null, createdAt: unknown, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }> } | null, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }>, recentPullRequests: Array<{ __typename: 'PullRequestNode', id: string, createdAt: unknown, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }> }; +export type GetRepositoryDataQuery = { repository: { __typename: 'RepositoryNode', id: string, commitsCount: number, contributorsCount: number, createdAt: any, description: string, forksCount: number, key: string, languages: Array, license: string, name: string, openIssuesCount: number, size: number, starsCount: number, topics: Array, updatedAt: any, url: string, issues: Array<{ __typename: 'IssueNode', id: string, organizationName: string | null, repositoryName: string | null, createdAt: any, title: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }>, organization: { __typename: 'OrganizationNode', id: string, login: string } | null, project: { __typename: 'ProjectNode', id: string, key: string, name: string } | null, releases: Array<{ __typename: 'ReleaseNode', id: string, isPreRelease: boolean, name: string, organizationName: string | null, publishedAt: any | null, repositoryName: string | null, tagName: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, name: string, login: string } | null }>, recentMilestones: Array<{ __typename: 'MilestoneNode', id: string, title: string, openIssuesCount: number, closedIssuesCount: number, repositoryName: string | null, organizationName: string | null, createdAt: any, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }> } | null, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }>, recentPullRequests: Array<{ __typename: 'PullRequestNode', id: string, createdAt: any, organizationName: string | null, repositoryName: string | null, title: string, url: string, author: { __typename: 'UserNode', id: string, avatarUrl: string, login: string, name: string } | null }> }; export type GetRepositoryMetadataQueryVariables = Types.Exact<{ repositoryKey: Types.Scalars['String']['input']; diff --git a/frontend/src/types/__generated__/snapshotQueries.generated.ts b/frontend/src/types/__generated__/snapshotQueries.generated.ts index 83cc2b8c70..69e9e59767 100644 --- a/frontend/src/types/__generated__/snapshotQueries.generated.ts +++ b/frontend/src/types/__generated__/snapshotQueries.generated.ts @@ -6,7 +6,7 @@ export type GetSnapshotDetailsQueryVariables = Types.Exact<{ }>; -export type GetSnapshotDetailsQuery = { snapshot: { __typename: 'SnapshotNode', id: string, endAt: unknown, key: string, startAt: unknown, title: string, newReleases: Array<{ __typename: 'ReleaseNode', id: string, name: string, organizationName: string | null, projectName: string | null, publishedAt: unknown | null, repositoryName: string | null, tagName: string, author: { __typename: 'UserNode', avatarUrl: string, id: string, login: string, name: string } | null }>, newProjects: Array<{ __typename: 'ProjectNode', id: string, key: string, name: string, summary: string, starsCount: number, forksCount: number, contributorsCount: number, level: string, isActive: boolean, repositoriesCount: number, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }> }>, newChapters: Array<{ __typename: 'ChapterNode', id: string, key: string, name: string, createdAt: number, suggestedLocation: string | null, region: string, summary: string, updatedAt: number, url: string, relatedUrls: Array, isActive: boolean, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }>, geoLocation: { __typename: 'GeoLocationType', lat: number, lng: number } | null }> } | null }; +export type GetSnapshotDetailsQuery = { snapshot: { __typename: 'SnapshotNode', id: string, endAt: any, key: string, startAt: any, title: string, newReleases: Array<{ __typename: 'ReleaseNode', id: string, name: string, organizationName: string | null, projectName: string | null, publishedAt: any | null, repositoryName: string | null, tagName: string, author: { __typename: 'UserNode', avatarUrl: string, id: string, login: string, name: string } | null }>, newProjects: Array<{ __typename: 'ProjectNode', id: string, key: string, name: string, summary: string, starsCount: number, forksCount: number, contributorsCount: number, level: string, isActive: boolean, repositoriesCount: number, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }> }>, newChapters: Array<{ __typename: 'ChapterNode', id: string, key: string, name: string, createdAt: number, suggestedLocation: string | null, region: string, summary: string, updatedAt: number, url: string, relatedUrls: Array, isActive: boolean, topContributors: Array<{ __typename: 'RepositoryContributorNode', id: string, avatarUrl: string, login: string, name: string }>, geoLocation: { __typename: 'GeoLocationType', lat: number, lng: number } | null }> } | null }; export type GetSnapshotDetailsMetadataQueryVariables = Types.Exact<{ key: Types.Scalars['String']['input']; @@ -18,7 +18,7 @@ export type GetSnapshotDetailsMetadataQuery = { snapshot: { __typename: 'Snapsho export type GetCommunitySnapshotsQueryVariables = Types.Exact<{ [key: string]: never; }>; -export type GetCommunitySnapshotsQuery = { snapshots: Array<{ __typename: 'SnapshotNode', id: string, key: string, title: string, startAt: unknown, endAt: unknown }> }; +export type GetCommunitySnapshotsQuery = { snapshots: Array<{ __typename: 'SnapshotNode', id: string, key: string, title: string, startAt: any, endAt: any }> }; export const GetSnapshotDetailsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSnapshotDetails"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"snapshot"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"endAt"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"startAt"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"newReleases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"organizationName"}},{"kind":"Field","name":{"kind":"Name","value":"projectName"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"repositoryName"}},{"kind":"Field","name":{"kind":"Name","value":"tagName"}},{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"newProjects"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"starsCount"}},{"kind":"Field","name":{"kind":"Name","value":"forksCount"}},{"kind":"Field","name":{"kind":"Name","value":"contributorsCount"}},{"kind":"Field","name":{"kind":"Name","value":"level"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"repositoriesCount"}},{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"newChapters"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"suggestedLocation"}},{"kind":"Field","name":{"kind":"Name","value":"region"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"topContributors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"login"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"relatedUrls"}},{"kind":"Field","name":{"kind":"Name","value":"geoLocation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lng"}}]}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]}}]}}]} as unknown as DocumentNode; diff --git a/frontend/src/types/__generated__/userQueries.generated.ts b/frontend/src/types/__generated__/userQueries.generated.ts index 6d50491dfc..0cd3c6ae2e 100644 --- a/frontend/src/types/__generated__/userQueries.generated.ts +++ b/frontend/src/types/__generated__/userQueries.generated.ts @@ -13,7 +13,7 @@ export type GetUserDataQueryVariables = Types.Exact<{ }>; -export type GetUserDataQuery = { recentIssues: Array<{ __typename: 'IssueNode', id: string, createdAt: unknown, organizationName: string | null, repositoryName: string | null, title: string, url: string }>, recentMilestones: Array<{ __typename: 'MilestoneNode', id: string, title: string, openIssuesCount: number, closedIssuesCount: number, repositoryName: string | null, organizationName: string | null, createdAt: unknown, url: string }>, recentPullRequests: Array<{ __typename: 'PullRequestNode', id: string, createdAt: unknown, organizationName: string | null, repositoryName: string | null, title: string, url: string }>, recentReleases: Array<{ __typename: 'ReleaseNode', id: string, isPreRelease: boolean, name: string, publishedAt: unknown | null, organizationName: string | null, repositoryName: string | null, tagName: string, url: string }>, topContributedRepositories: Array<{ __typename: 'RepositoryNode', id: string, contributorsCount: number, forksCount: number, key: string, name: string, openIssuesCount: number, starsCount: number, subscribersCount: number, url: string, organization: { __typename: 'OrganizationNode', id: string, login: string } | null }>, user: { __typename: 'UserNode', id: string, avatarUrl: string, bio: string, company: string, contributionsCount: number, createdAt: number, email: string, followersCount: number, followingCount: number, issuesCount: number, location: string, login: string, name: string, publicRepositoriesCount: number, releasesCount: number, updatedAt: number, url: string } | null }; +export type GetUserDataQuery = { recentIssues: Array<{ __typename: 'IssueNode', id: string, createdAt: any, organizationName: string | null, repositoryName: string | null, title: string, url: string }>, recentMilestones: Array<{ __typename: 'MilestoneNode', id: string, title: string, openIssuesCount: number, closedIssuesCount: number, repositoryName: string | null, organizationName: string | null, createdAt: any, url: string }>, recentPullRequests: Array<{ __typename: 'PullRequestNode', id: string, createdAt: any, organizationName: string | null, repositoryName: string | null, title: string, url: string }>, recentReleases: Array<{ __typename: 'ReleaseNode', id: string, isPreRelease: boolean, name: string, publishedAt: any | null, organizationName: string | null, repositoryName: string | null, tagName: string, url: string }>, topContributedRepositories: Array<{ __typename: 'RepositoryNode', id: string, contributorsCount: number, forksCount: number, key: string, name: string, openIssuesCount: number, starsCount: number, subscribersCount: number, url: string, organization: { __typename: 'OrganizationNode', id: string, login: string } | null }>, user: { __typename: 'UserNode', id: string, avatarUrl: string, bio: string, company: string, contributionsCount: number, createdAt: number, email: string, followersCount: number, followingCount: number, issuesCount: number, location: string, login: string, name: string, publicRepositoriesCount: number, releasesCount: number, updatedAt: number, url: string } | null }; export type GetUserMetadataQueryVariables = Types.Exact<{ key: Types.Scalars['String']['input']; diff --git a/frontend/src/types/chapter.ts b/frontend/src/types/chapter.ts index c6ee7bbe70..fe1e7f1bf8 100644 --- a/frontend/src/types/chapter.ts +++ b/frontend/src/types/chapter.ts @@ -2,20 +2,20 @@ import type { Contributor } from 'types/contributor' export type Chapter = { _geoloc?: GeoLocation - createdAt: number + createdAt?: number geoLocation?: GeoLocation - isActive: boolean + isActive?: boolean key: string - leaders: string[] + leaders?: string[] name: string - objectID: string - region: string - relatedUrls: string[] + objectID?: string + region?: string + relatedUrls?: string[] suggestedLocation: string - summary: string - topContributors: Contributor[] - updatedAt: number - url: string + summary?: string + topContributors?: Contributor[] + updatedAt?: number + url?: string } export type GeoLocation = { diff --git a/frontend/src/types/committee.ts b/frontend/src/types/committee.ts index 98ed64db32..d68fe9c1d1 100644 --- a/frontend/src/types/committee.ts +++ b/frontend/src/types/committee.ts @@ -5,7 +5,7 @@ export type Committee = { createdAt: number forksCount?: number issuesCount?: number - key: string + key?: string leaders: string[] name: string objectID?: string @@ -13,7 +13,7 @@ export type Committee = { repositoriesCount?: number starsCount?: number summary: string - topContributors: Contributor[] + topContributors?: Contributor[] updatedAt: number url: string } diff --git a/frontend/src/types/healthMetrics.ts b/frontend/src/types/healthMetrics.ts index d4fcfec6fa..e38f1180db 100644 --- a/frontend/src/types/healthMetrics.ts +++ b/frontend/src/types/healthMetrics.ts @@ -24,33 +24,33 @@ export type ApexBarChartDataSeries = { } export type HealthMetricsProps = { - ageDays: number - ageDaysRequirement: number + ageDays?: number + ageDaysRequirement?: number id: string - createdAt: string - contributorsCount: number - forksCount: number - isFundingRequirementsCompliant: boolean - isLeaderRequirementsCompliant: boolean - lastCommitDays: number - lastCommitDaysRequirement: number - lastPullRequestDays: number - lastPullRequestDaysRequirement: number - lastReleaseDays: number - lastReleaseDaysRequirement: number - openIssuesCount: number - openPullRequestsCount: number - owaspPageLastUpdateDays: number - owaspPageLastUpdateDaysRequirement: number - projectName: string - projectKey: string - recentReleasesCount: number - score: number - starsCount: number - totalIssuesCount: number - totalReleasesCount: number - unassignedIssuesCount: number - unansweredIssuesCount: number + createdAt?: string + contributorsCount?: number + forksCount?: number + isFundingRequirementsCompliant?: boolean + isLeaderRequirementsCompliant?: boolean + lastCommitDays?: number + lastCommitDaysRequirement?: number + lastPullRequestDays?: number + lastPullRequestDaysRequirement?: number + lastReleaseDays?: number + lastReleaseDaysRequirement?: number + openIssuesCount?: number + openPullRequestsCount?: number + owaspPageLastUpdateDays?: number + owaspPageLastUpdateDaysRequirement?: number + projectName?: string + projectKey?: string + recentReleasesCount?: number + score?: number + starsCount?: number + totalIssuesCount?: number + totalReleasesCount?: number + unassignedIssuesCount?: number + unansweredIssuesCount?: number } export type HealthMetricsFilter = { diff --git a/frontend/src/types/issue.ts b/frontend/src/types/issue.ts index bd8f746f0c..074283b192 100644 --- a/frontend/src/types/issue.ts +++ b/frontend/src/types/issue.ts @@ -1,19 +1,19 @@ import type { RepositoryDetails, User } from 'types/user' export type Issue = { - author: User + author?: User createdAt: number - hint: string - labels: string[] + hint?: string + labels?: string[] number?: string organizationName?: string - projectName: string - projectUrl: string + projectName?: string + projectUrl?: string repository?: RepositoryDetails repositoryLanguages?: string[] - summary: string + summary?: string title: string - updatedAt: number + updatedAt?: number url: string - objectID: string + objectID?: string } diff --git a/frontend/src/types/mentorship.ts b/frontend/src/types/mentorship.ts index 7afecf2465..14bdf3b337 100644 --- a/frontend/src/types/mentorship.ts +++ b/frontend/src/types/mentorship.ts @@ -1,16 +1,6 @@ import type { Contributor } from 'types/contributor' -export enum ExperienceLevelEnum { - BEGINNER = 'beginner', - INTERMEDIATE = 'intermediate', - ADVANCED = 'advanced', - EXPERT = 'expert', -} - -export enum ProgramStatusEnum { - DRAFT = 'draft', - PUBLISHED = 'published', - COMPLETED = 'completed', -} +// eslint-disable-next-line no-restricted-imports +import { ExperienceLevelEnum, ProgramStatusEnum } from './__generated__/graphql' export const EXPERIENCE_LEVELS = { BEGINNER: 'BEGINNER', @@ -24,7 +14,7 @@ export type Program = { key: string name: string description: string - status: ProgramStatusEnum + status?: ProgramStatusEnum experienceLevels?: ExperienceLevelEnum[] menteesLimit?: number startedAt: string @@ -54,13 +44,13 @@ export type Module = { key: string name: string description: string - status: ProgramStatusEnum + status?: ProgramStatusEnum experienceLevel: ExperienceLevelEnum mentors: Contributor[] startedAt: string endedAt: string - domains: string[] - tags: string[] + domains?: string[] + tags?: string[] } export type ModuleFormData = { diff --git a/frontend/src/types/milestone.ts b/frontend/src/types/milestone.ts index 51908d7ad1..9656c02b4c 100644 --- a/frontend/src/types/milestone.ts +++ b/frontend/src/types/milestone.ts @@ -1,15 +1,15 @@ import type { User } from 'types/user' export type Milestone = { - author: User - body: string - closedIssuesCount: number - createdAt: string - openIssuesCount: number + author?: User + body?: string + closedIssuesCount?: number + createdAt?: string + openIssuesCount?: number organizationName?: string progress?: number - repositoryName: string - state: string + repositoryName?: string + state?: string title: string url?: string } diff --git a/frontend/src/types/organization.ts b/frontend/src/types/organization.ts index 3502a1f4ac..b0510a1676 100644 --- a/frontend/src/types/organization.ts +++ b/frontend/src/types/organization.ts @@ -1,17 +1,17 @@ export type Organization = { - avatarUrl: string - collaboratorsCount: number + avatarUrl?: string + collaboratorsCount?: number company?: string - createdAt: number + createdAt?: number description?: string email?: string - followersCount: number - key: string + followersCount?: number + key?: string location?: string login: string - name: string - objectID: string - publicRepositoriesCount: number - updatedAt: number - url: string + name?: string + objectID?: string + publicRepositoriesCount?: number + updatedAt?: number + url?: string } diff --git a/frontend/src/types/project.ts b/frontend/src/types/project.ts index 10cada1c79..455286ab08 100644 --- a/frontend/src/types/project.ts +++ b/frontend/src/types/project.ts @@ -16,27 +16,27 @@ export type ProjectStats = { export type Project = { createdAt?: string - contributorsCount: number - description: string - forksCount: number + contributorsCount?: number + description?: string + forksCount?: number healthMetricsList?: HealthMetricsProps[] - isActive: boolean - issuesCount: number - key: string - languages: string[] - leaders: string[] - level: string + isActive?: boolean + issuesCount?: number + key?: string + languages?: string[] + leaders?: string[] + level?: string name: string openIssuesCount?: number - organizations: string - repositoriesCount: number - starsCount: number - summary: string - topics: string[] - topContributors: Contributor[] - type: string - updatedAt: number - url: string + organizations?: string + repositoriesCount?: number + starsCount?: number + summary?: string + topics?: string[] + topContributors?: Contributor[] + type?: string + updatedAt?: number + url?: string recentIssues?: Issue[] recentPullRequests?: PullRequest[] recentReleases?: Release[] diff --git a/frontend/src/types/pullRequest.ts b/frontend/src/types/pullRequest.ts index 47c15ad798..04006b6e9a 100644 --- a/frontend/src/types/pullRequest.ts +++ b/frontend/src/types/pullRequest.ts @@ -1,7 +1,7 @@ import type { User } from 'types/user' export type PullRequest = { - author: User + author?: User createdAt: string organizationName: string repositoryName?: string diff --git a/frontend/src/types/release.ts b/frontend/src/types/release.ts index 2e422ec81d..71c6154a7e 100644 --- a/frontend/src/types/release.ts +++ b/frontend/src/types/release.ts @@ -1,8 +1,8 @@ import type { RepositoryDetails, User } from 'types/user' export type Release = { - author: User - isPreRelease: boolean + author?: User + isPreRelease?: boolean name: string organizationName?: string projectName?: string diff --git a/frontend/src/types/user.ts b/frontend/src/types/user.ts index f2b50891a0..349618b99e 100644 --- a/frontend/src/types/user.ts +++ b/frontend/src/types/user.ts @@ -7,28 +7,26 @@ export type RepositoryDetails = { ownerKey: string } -export type User = { +export type User = { avatarUrl: string bio?: string company?: string - contributionsCount: number - createdAt: T + contributionsCount?: number + createdAt?: number | string email?: string - followersCount: number - followingCount: number + followersCount?: number + followingCount?: number isOwaspStaff?: boolean issues?: Issue[] issuesCount?: number - key: string + key?: string location?: string login: string name?: string - publicRepositoriesCount: number + publicRepositoriesCount?: number releases?: Release[] releasesCount?: number topRepositories?: RepositoryCardProps[] - updatedAt?: T - url: string + updatedAt?: number | string + url?: string } - -export type UserDetails = User diff --git a/frontend/src/utils/structuredData.ts b/frontend/src/utils/structuredData.ts index a43f60f27b..62581631e6 100644 --- a/frontend/src/utils/structuredData.ts +++ b/frontend/src/utils/structuredData.ts @@ -1,5 +1,18 @@ import { ProfilePageStructuredData } from 'types/profilePageStructuredData' -import type { UserDetails } from 'types/user' +import type { User } from 'types/user' + +export const formatISODate = (input: number | string): string => { + const date = + typeof input === 'number' + ? new Date(input * 1000) // Unix timestamp in seconds + : new Date(input) // ISO date string + + if (isNaN(date.getTime())) { + throw new Error('Invalid date') + } + + return date.toISOString() +} /** * JSON-LD structure data for ProfilePage @@ -11,14 +24,14 @@ import type { UserDetails } from 'types/user' * */ export function generateProfilePageStructuredData( - user: UserDetails, + user: User, baseUrl = 'https://nest.owasp.org' ): ProfilePageStructuredData { return { '@context': 'https://schema.org', '@type': 'ProfilePage', - dateCreated: new Date(parseInt(user.createdAt) * 1000).toISOString(), - dateModified: new Date(parseInt(user.updatedAt) * 1000).toISOString(), + dateCreated: formatISODate(user.createdAt), + dateModified: formatISODate(user.updatedAt), mainEntity: { '@type': 'Person', ...(user.location && { From 2b5222958fea33f3a57325692a505929a7590511 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Mon, 22 Sep 2025 22:18:06 +0530 Subject: [PATCH 13/25] revert as string type casts --- .../programs/[programKey]/modules/[moduleKey]/page.tsx | 6 +++--- .../src/app/mentorship/programs/[programKey]/page.tsx | 4 ++-- .../app/my/mentorship/programs/[programKey]/edit/page.tsx | 4 ++-- .../programs/[programKey]/modules/[moduleKey]/page.tsx | 6 +++--- .../app/projects/dashboard/metrics/[projectKey]/page.tsx | 2 +- frontend/src/app/settings/api-keys/page.tsx | 8 ++++---- frontend/src/app/snapshots/[id]/page.tsx | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx b/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx index 71a4ed2b14..95aa910f29 100644 --- a/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx +++ b/frontend/src/app/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx @@ -49,11 +49,11 @@ const ModuleDetailsPage = () => { const moduleDetails = [ { label: 'Experience Level', value: upperFirst(module.experienceLevel) }, - { label: 'Start Date', value: formatDate(module.startedAt as string) }, - { label: 'End Date', value: formatDate(module.endedAt as string) }, + { label: 'Start Date', value: formatDate(module.startedAt) }, + { label: 'End Date', value: formatDate(module.endedAt) }, { label: 'Duration', - value: getSimpleDuration(module.startedAt as string, module.endedAt as string), + value: getSimpleDuration(module.startedAt, module.endedAt), }, ] diff --git a/frontend/src/app/mentorship/programs/[programKey]/page.tsx b/frontend/src/app/mentorship/programs/[programKey]/page.tsx index fc56249ccd..5cf8b6d7de 100644 --- a/frontend/src/app/mentorship/programs/[programKey]/page.tsx +++ b/frontend/src/app/mentorship/programs/[programKey]/page.tsx @@ -70,8 +70,8 @@ const ProgramDetailsPage = () => { const programDetails = [ { label: 'Status', value: upperFirst(program.status) }, - { label: 'Start Date', value: formatDate(program.startedAt as string) }, - { label: 'End Date', value: formatDate(program.endedAt as string) }, + { label: 'Start Date', value: formatDate(program.startedAt) }, + { label: 'End Date', value: formatDate(program.endedAt) }, { label: 'Mentees Limit', value: String(program.menteesLimit) }, { label: 'Experience Levels', diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx index c5f341b92f..03a8fde2fc 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/edit/page.tsx @@ -74,8 +74,8 @@ const EditProgramPage = () => { name: program.name || '', description: program.description || '', menteesLimit: program.menteesLimit ?? 5, - startedAt: formatDateForInput(program.startedAt as string), - endedAt: formatDateForInput(program.endedAt as string), + startedAt: formatDateForInput(program.startedAt), + endedAt: formatDateForInput(program.endedAt), tags: (program.tags || []).join(', '), domains: (program.domains || []).join(', '), adminLogins: (program.admins || []) diff --git a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx index f55426e569..479df68d84 100644 --- a/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx +++ b/frontend/src/app/my/mentorship/programs/[programKey]/modules/[moduleKey]/page.tsx @@ -49,11 +49,11 @@ const ModuleDetailsPage = () => { const moduleDetails = [ { label: 'Experience Level', value: upperFirst(module.experienceLevel) }, - { label: 'Start Date', value: formatDate(module.startedAt as string) }, - { label: 'End Date', value: formatDate(module.endedAt as string) }, + { label: 'Start Date', value: formatDate(module.startedAt) }, + { label: 'End Date', value: formatDate(module.endedAt) }, { label: 'Duration', - value: getSimpleDuration(module.startedAt as string, module.endedAt as string), + value: getSimpleDuration(module.startedAt, module.endedAt), }, ] diff --git a/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx b/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx index 1df0c0e55f..08a934aa64 100644 --- a/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx +++ b/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx @@ -53,7 +53,7 @@ const ProjectHealthMetricsDetails: FC = () => { const labels = metricsList?.map((m) => - new Date(m.createdAt as string).toLocaleString('default', { + new Date(m.createdAt).toLocaleString('default', { month: 'short', day: 'numeric', }) diff --git a/frontend/src/app/settings/api-keys/page.tsx b/frontend/src/app/settings/api-keys/page.tsx index d2d31e2edf..26853d9748 100644 --- a/frontend/src/app/settings/api-keys/page.tsx +++ b/frontend/src/app/settings/api-keys/page.tsx @@ -241,14 +241,14 @@ export default function Page() { {data.apiKeys.map((key: ApiKey) => ( {key.name} - {key.uuid as string} - {format(new Date(key.createdAt as string), 'PP')} + {key.uuid} + {format(new Date(key.createdAt), 'PP')} - {key.expiresAt ? format(new Date(key.expiresAt as string), 'PP') : 'Never'} + {key.expiresAt ? format(new Date(key.expiresAt), 'PP') : 'Never'} - + = ({ } const moduleDetails = [ - { label: 'Experience Level', value: upperFirst(module.experienceLevel.toLowerCase()) }, + { label: 'Experience Level', value: capitalize(module.experienceLevel) }, { label: 'Start Date', value: formatDate(module.startedAt) }, { label: 'End Date', value: formatDate(module.endedAt) }, { label: 'Duration', value: getSimpleDuration(module.startedAt, module.endedAt) }, From 483477b2d871949924f2afeb38fd09d4727cfd88 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Wed, 1 Oct 2025 11:15:45 +0530 Subject: [PATCH 21/25] remove gql imports and cleanup tests --- frontend/__tests__/unit/pages/CreateModule.test.tsx | 4 ---- frontend/__tests__/unit/pages/EditModule.test.tsx | 4 ---- frontend/__tests__/unit/utils/structuredData.test.ts | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/frontend/__tests__/unit/pages/CreateModule.test.tsx b/frontend/__tests__/unit/pages/CreateModule.test.tsx index bcd2ea9812..56d47c8633 100644 --- a/frontend/__tests__/unit/pages/CreateModule.test.tsx +++ b/frontend/__tests__/unit/pages/CreateModule.test.tsx @@ -21,10 +21,6 @@ jest.mock('@apollo/client/react', () => ({ useApolloClient: jest.fn(), })) -jest.mock('@apollo/client', () => ({ - gql: jest.requireActual('@apollo/client').gql, -})) - describe('CreateModulePage', () => { const mockPush = jest.fn() const mockReplace = jest.fn() diff --git a/frontend/__tests__/unit/pages/EditModule.test.tsx b/frontend/__tests__/unit/pages/EditModule.test.tsx index fe621436d8..aa18c93955 100644 --- a/frontend/__tests__/unit/pages/EditModule.test.tsx +++ b/frontend/__tests__/unit/pages/EditModule.test.tsx @@ -23,10 +23,6 @@ jest.mock('@apollo/client/react', () => ({ useApolloClient: jest.fn(), })) -jest.mock('@apollo/client', () => ({ - gql: jest.requireActual('@apollo/client').gql, -})) - describe('EditModulePage', () => { const mockPush = jest.fn() const mockReplace = jest.fn() diff --git a/frontend/__tests__/unit/utils/structuredData.test.ts b/frontend/__tests__/unit/utils/structuredData.test.ts index 40b0e13679..b3797cdfd4 100644 --- a/frontend/__tests__/unit/utils/structuredData.test.ts +++ b/frontend/__tests__/unit/utils/structuredData.test.ts @@ -1,4 +1,4 @@ -import { User } from 'types/user' +import type { User } from 'types/user' import { generateProfilePageStructuredData } from 'utils/structuredData' describe('generateProfilePageStructuredData', () => { From 95b9549303f7d71fa3d1222c6e0d95059c5240c5 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Wed, 1 Oct 2025 18:23:39 +0530 Subject: [PATCH 22/25] sonar qube suggestions --- frontend/src/utils/structuredData.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/utils/structuredData.ts b/frontend/src/utils/structuredData.ts index 62581631e6..f9aa3ca0b5 100644 --- a/frontend/src/utils/structuredData.ts +++ b/frontend/src/utils/structuredData.ts @@ -7,8 +7,8 @@ export const formatISODate = (input: number | string): string => { ? new Date(input * 1000) // Unix timestamp in seconds : new Date(input) // ISO date string - if (isNaN(date.getTime())) { - throw new Error('Invalid date') + if (Number.isNaN(date.getTime())) { + throw new TypeError('Invalid date') } return date.toISOString() From bf6264323c2531db799ddbd6e3bcfb8fecab6fe0 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Wed, 1 Oct 2025 18:31:41 +0530 Subject: [PATCH 23/25] sonar qube suggestions --- frontend/src/app/mentorship/programs/page.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/app/mentorship/programs/page.tsx b/frontend/src/app/mentorship/programs/page.tsx index 0a673d54bb..4f4f12c151 100644 --- a/frontend/src/app/mentorship/programs/page.tsx +++ b/frontend/src/app/mentorship/programs/page.tsx @@ -52,8 +52,7 @@ const ProgramsPage = () => { totalPages={totalPages} >
- {programs && - programs.filter((p) => p.status === ProgramStatusEnum.Published).map(renderProgramCard)} + {programs?.filter((p) => p.status === ProgramStatusEnum.Published).map(renderProgramCard)}
) From a91abc180b8286a77f1db74963a16abab266152c Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Wed, 1 Oct 2025 18:42:38 +0530 Subject: [PATCH 24/25] make input optional --- frontend/src/utils/structuredData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/utils/structuredData.ts b/frontend/src/utils/structuredData.ts index f9aa3ca0b5..bc1926c297 100644 --- a/frontend/src/utils/structuredData.ts +++ b/frontend/src/utils/structuredData.ts @@ -1,7 +1,7 @@ import { ProfilePageStructuredData } from 'types/profilePageStructuredData' import type { User } from 'types/user' -export const formatISODate = (input: number | string): string => { +export const formatISODate = (input?: number | string): string => { const date = typeof input === 'number' ? new Date(input * 1000) // Unix timestamp in seconds From a3d45831682fbfc976d94588114b74489781c750 Mon Sep 17 00:00:00 2001 From: Rudransh Shrivastava Date: Wed, 1 Oct 2025 18:52:37 +0530 Subject: [PATCH 25/25] spread fields --- frontend/src/utils/structuredData.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/utils/structuredData.ts b/frontend/src/utils/structuredData.ts index bc1926c297..319428994b 100644 --- a/frontend/src/utils/structuredData.ts +++ b/frontend/src/utils/structuredData.ts @@ -2,6 +2,10 @@ import { ProfilePageStructuredData } from 'types/profilePageStructuredData' import type { User } from 'types/user' export const formatISODate = (input?: number | string): string => { + if (input == null) { + return undefined + } + const date = typeof input === 'number' ? new Date(input * 1000) // Unix timestamp in seconds @@ -30,8 +34,12 @@ export function generateProfilePageStructuredData( return { '@context': 'https://schema.org', '@type': 'ProfilePage', - dateCreated: formatISODate(user.createdAt), - dateModified: formatISODate(user.updatedAt), + ...(formatISODate(user.createdAt) && { + dateCreated: formatISODate(user.createdAt), + }), + ...(formatISODate(user.updatedAt) && { + dateModified: formatISODate(user.updatedAt), + }), mainEntity: { '@type': 'Person', ...(user.location && {