Skip to content

Commit 5645ff2

Browse files
committed
update gql fields
1 parent a77e7ba commit 5645ff2

File tree

19 files changed

+202
-71
lines changed

19 files changed

+202
-71
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
query IdByLogin($login: String!) {
2-
rankByLogin(login: $login) {
2+
globalRankByLogin(login: $login) {
33
githubId
44
}
55
}

app/badge/[[...login]]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default async function Badge({ params }: { params: Promise<{ login?: stri
1515

1616
if (githubLogin) {
1717
const data = await graphqlDirect(IdByLoginDocument, { login: githubLogin });
18-
githubId = data.rankByLogin?.githubId;
18+
githubId = data.globalRankByLogin?.githubId;
1919
}
2020

2121
return (

app/by/[rankingType]/[page]/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from '@/components/ui/pagination';
1010
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
1111
import { graphqlDirect } from '@/lib/graphql/graphql-direct';
12-
import { RankingsDocument, RankOrder } from '@/types/generated/graphql';
12+
import { GlobalRankingsDocument, RankOrder } from '@/types/generated/graphql';
1313
import { getInitials } from '@/utils/get-initials';
1414

1515
import { ClickableRow } from './components/clickale-row';
@@ -58,7 +58,7 @@ export default async function GlobalRanking({ params }: { params: Promise<{ rank
5858
const page = parseInt(pageParam, 10);
5959
const [queryOrder, rankPropName, title, subtitle, rankingBaseEntity] = getConfigByRankingType(rankingType);
6060
const offset = (page - 1) * ITEMS_PER_PAGE;
61-
const data = await graphqlDirect(RankingsDocument, { order: queryOrder, offset });
61+
const data = await graphqlDirect(GlobalRankingsDocument, { order: queryOrder, offset });
6262

6363
return (
6464
<Page className="max-w-5xl gap-6">
@@ -77,7 +77,7 @@ export default async function GlobalRanking({ params }: { params: Promise<{ rank
7777
</TableRow>
7878
</TableHeader>
7979
<TableBody>
80-
{data.rankings.map((item) => {
80+
{data.globalRankings.map((item) => {
8181
const { githubId, user } = item;
8282
return (
8383
<ClickableRow key={githubId} className="border-b-0" href={`/profile/${user?.login}`}>

app/by/[rankingType]/[page]/rank-list.query.gql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
query Rankings($order: RankOrder, $offset: Int) {
2-
rankings(order: $order, offset: $offset) {
1+
query GlobalRankings($order: RankOrder, $offset: Int) {
2+
globalRankings(order: $order, offset: $offset) {
33
githubId
44
c
55
cM

app/components/search-profiile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const SearchProfile = () => {
2525
setLoading(true);
2626
const data = await graphqlClient(IdByLoginDocument, { login });
2727

28-
const profileFound = data.rankByLogin?.githubId;
28+
const profileFound = data.globalRankByLogin?.githubId;
2929

3030
posthog.capture('landingPage.search', {
3131
login,

app/profile/[login]/components/ranks-overview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { UserQuery } from '@/types/generated/graphql';
77
import { ProfileCard, ProfileCardActions, ProfileCardContent, ProfileCardHeader } from './profile-card';
88

99
type RanksOverviewProps = {
10-
ranksData: NonNullable<UserQuery['user']>['rank'];
10+
ranksData: NonNullable<UserQuery['user']>['rankGlobal'];
1111
login: string;
1212
};
1313

app/profile/[login]/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export async function generateMetadata({ params }: { params: Promise<{ login: st
1616
return { title: 'GitHub Profile Analytics & Rankings · GitRanks' };
1717
}
1818

19-
const { s, c, f } = user.rank ?? {};
19+
const { s, c, f } = user.rankGlobal ?? {};
2020

2121
return {
2222
title: `${login} – GitHub Profile Analytics & Rankings · GitRanks`,
@@ -36,7 +36,7 @@ export default async function Profile({ params }: { params: Promise<{ login: str
3636
notFound();
3737
}
3838

39-
if (user.fetchingStatus === 'FETCHING' && !user.rank) {
39+
if (user.fetchingStatus === 'FETCHING' && !user.rankGlobal) {
4040
// user is being fetched for the first time
4141
return <NotFound fetchingStatus={user.fetchingStatus} fetchingUpdatedAt={user.fetchingUpdatedAt} />;
4242
}
@@ -45,7 +45,7 @@ export default async function Profile({ params }: { params: Promise<{ login: str
4545
<LayoutLeftColumn user={user}>
4646
<div className="flex-grow flex flex-col gap-6">
4747
<div className="flex flex-col md:flex-row flex-wrap gap-6">
48-
<RanksOverview ranksData={user.rank} login={login} />
48+
<RanksOverview ranksData={user.rankGlobal} login={login} />
4949
<RepositoriesOverview
5050
topRepoStars={user.repositories?.[0]?.stargazerCount ?? 0}
5151
contributedRepoCount={user.contributedRepoCount}

app/profile/[login]/profile-summary.gql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ query User($login: String!) {
7373
changes
7474
createdAt
7575
}
76-
rank {
76+
rankGlobal {
7777
s
7878
sProvisional
7979
sM

app/profile/[login]/ranks/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default async function ProfileRanks({ params }: { params: Promise<{ login
1717
notFound();
1818
}
1919

20-
const { s, c, cM, f, sProvisional, cProvisional, fProvisional, sM, fM } = user.rank ?? {};
20+
const { s, c, cM, f, sProvisional, cProvisional, fProvisional, sM, fM } = user.rankGlobal ?? {};
2121

2222
const bestRankType = getBestRankType({ s, c, f });
2323

app/profile/[login]/top-ranks.gql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
query TopRanks {
2-
byStars: rankings(order: STARS) {
2+
byStars: globalRankings(order: STARS) {
33
user {
44
login
55
}
66
}
7-
byContribution: rankings(order: CONTRIBUTIONS) {
7+
byContribution: globalRankings(order: CONTRIBUTIONS) {
88
user {
99
login
1010
}
1111
}
12-
byFollowers: rankings(order: FOLLOWERS) {
12+
byFollowers: globalRankings(order: FOLLOWERS) {
1313
user {
1414
login
1515
}

0 commit comments

Comments
 (0)