From 034facebf38afaa0979cf08f748485613b0dcf1b Mon Sep 17 00:00:00 2001 From: Loewy Date: Thu, 21 Nov 2024 12:18:17 -0800 Subject: [PATCH] update medal operation, create fragment --- src/index.tsx | 111 +++++++++++++++----------------------- src/operations/medals.gql | 94 ++++++++++++++++---------------- 2 files changed, 89 insertions(+), 116 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 476a0c3..356bfa1 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2999,6 +2999,12 @@ export type GetVideoMakePercentageIntervalsQuery = { }>; }; +export type MedalFieldsFragment = { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; +}; + export type GetMedalsQueryVariables = Exact<{ scope: MedalScope; userId?: InputMaybe; @@ -3073,37 +3079,27 @@ export type GetMedalsQuery = { count: number; nickname?: string | null; } | null; - totalMakes25?: { - __typename?: "MedalGQL"; - count: number; - nickname?: string | null; - } | null; - totalMakes50?: { - __typename?: "MedalGQL"; - count: number; - nickname?: string | null; - } | null; - totalMakes75?: { - __typename?: "MedalGQL"; - count: number; - nickname?: string | null; - } | null; totalMakes100?: { __typename?: "MedalGQL"; count: number; nickname?: string | null; } | null; - totalMakes200?: { + dailyMakes50?: { __typename?: "MedalGQL"; count: number; nickname?: string | null; } | null; - totalMakes300?: { + dailyMakes100?: { __typename?: "MedalGQL"; count: number; nickname?: string | null; } | null; - totalMakes400?: { + dailyMakes150?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + dailyMakes200?: { __typename?: "MedalGQL"; count: number; nickname?: string | null; @@ -4369,6 +4365,12 @@ export const VideoCardFieldsFragmentDoc = gql` } } `; +export const MedalFieldsFragmentDoc = gql` + fragment MedalFields on MedalGQL { + count + nickname + } +`; export const ShotWithAllFeaturesFragmentDoc = gql` fragment ShotWithAllFeatures on ShotGQL { id @@ -4944,87 +4946,62 @@ export const GetMedalsDocument = gql` query getMedals($scope: MedalScope!, $userId: Int) { getMedals(scope: $scope, userId: $userId) { distanceOver66 { - count - nickname + ...MedalFields } distanceOver78 { - count - nickname + ...MedalFields } distanceOver90 { - count - nickname + ...MedalFields } runLength3 { - count - nickname + ...MedalFields } runLength5 { - count - nickname + ...MedalFields } runLength8 { - count - nickname + ...MedalFields } runLength10 { - count - nickname + ...MedalFields } runLength15 { - count - nickname + ...MedalFields } runLength20 { - count - nickname + ...MedalFields } runLength25 { - count - nickname + ...MedalFields } runLength30 { - count - nickname + ...MedalFields } runLength40 { - count - nickname + ...MedalFields } runLength50 { - count - nickname - } - totalMakes25 { - count - nickname - } - totalMakes50 { - count - nickname - } - totalMakes75 { - count - nickname + ...MedalFields } totalMakes100 { - count - nickname + ...MedalFields } - totalMakes200 { - count - nickname + dailyMakes50 { + ...MedalFields } - totalMakes300 { - count - nickname + dailyMakes100 { + ...MedalFields } - totalMakes400 { - count - nickname + dailyMakes150 { + ...MedalFields + } + dailyMakes200 { + ...MedalFields } } } + ${MedalFieldsFragmentDoc} `; /** diff --git a/src/operations/medals.gql b/src/operations/medals.gql index 97886dc..5645148 100644 --- a/src/operations/medals.gql +++ b/src/operations/medals.gql @@ -1,84 +1,80 @@ +fragment MedalFields on MedalGQL { + count + nickname +} + query getMedals($scope: MedalScope!, $userId: Int) { getMedals(scope: $scope, userId: $userId) { distanceOver66 { - count - nickname + ...MedalFields } distanceOver78 { - count - nickname + ...MedalFields } distanceOver90 { - count - nickname + ...MedalFields } runLength3 { - count - nickname + ...MedalFields } runLength5 { - count - nickname + ...MedalFields } runLength8 { - count - nickname + ...MedalFields } runLength10 { - count - nickname + ...MedalFields } runLength15 { - count - nickname + ...MedalFields } runLength20 { - count - nickname + ...MedalFields } runLength25 { - count - nickname + ...MedalFields } runLength30 { - count - nickname + ...MedalFields } runLength40 { - count - nickname + ...MedalFields } runLength50 { - count - nickname - } - totalMakes25 { - count - nickname - } - totalMakes50 { - count - nickname - } - totalMakes75 { - count - nickname + ...MedalFields } totalMakes100 { - count - nickname + ...MedalFields } - totalMakes200 { - count - nickname + # missing assets + # totalMakes500 { + # ...MedalFields + # } + # totalMakes1000 { + # ...MedalFields + # } + # totalMakes5000 { + # ...MedalFields + # } + # totalMakes10000 { + # ...MedalFields + # } + dailyMakes50 { + ...MedalFields } - totalMakes300 { - count - nickname + dailyMakes100 { + ...MedalFields } - totalMakes400 { - count - nickname + dailyMakes150 { + ...MedalFields } + dailyMakes200 { + ...MedalFields + } + # missing asset + # dailyMakes250 { + # ...MedalFields + # } } }