Compare commits

..

6 Commits

Author SHA1 Message Date
Dean Wenstrand
d1ed5b308b Add GetDrillRunLeaderboard query + generated types
All checks were successful
Tests / Tests (pull_request) Successful in 9s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 16:42:52 -07:00
af68bc3c60 Add Apple subscription sync schema
All checks were successful
Tests / Tests (pull_request) Successful in 10s
2026-06-11 18:40:54 -07:00
f12d2c5a1b Merge pull request 'Add Apple entitlement source enum' (#252) from apple-entitlement-source-enum into master
Reviewed-on: #252
2026-06-11 21:55:26 +00:00
4e3f649a2c Add Apple entitlement source enum
All checks were successful
Tests / Tests (pull_request) Successful in 28s
2026-06-11 12:43:03 -07:00
7cef75b2ca Merge pull request 'dean/get-video-card-query' (#250) from dean/get-video-card-query into master
Reviewed-on: #250
2026-06-09 05:05:52 +00:00
9358205327 Merge pull request 'Add quotaEnforcementEnabled to deployed config' (#249) from loewy/expose-quota-enforcement-config into master
Reviewed-on: #249
2026-05-28 23:18:01 +00:00
3 changed files with 242 additions and 0 deletions

View File

@@ -304,6 +304,14 @@ export type DoesNotOwnShotErrOtherErrorNeedsNote =
| DoesNotOwnShotErr
| OtherErrorNeedsNote;
export type DrillRunLeaderboardGql = {
__typename?: "DrillRunLeaderboardGQL";
entries: Array<RunGql>;
totalPlayers: Scalars["Int"]["output"];
youRank?: Maybe<Scalars["Int"]["output"]>;
youRun?: Maybe<RunGql>;
};
export type EditShotReturn = {
__typename?: "EditShotReturn";
error?: Maybe<DoesNotOwnShotErr>;
@@ -331,6 +339,7 @@ export type EditableShotFieldInputGql = {
export enum EntitlementSourceTypeEnum {
Admin = "ADMIN",
AlphaLegacy = "ALPHA_LEGACY",
Apple = "APPLE",
Manual = "MANUAL",
Stripe = "STRIPE",
}
@@ -2429,6 +2438,7 @@ export type Mutation = {
startChallenge: ChallengeEntry;
submitCancellationFeedback: Scalars["Boolean"]["output"];
submitChallengeEntry: ChallengeEntry;
syncAppleSubscription: SyncAppleSubscriptionResultGql;
undismissChallenge: Scalars["Boolean"]["output"];
unfollowUser: UserGql;
updateShotAnnotations: UpdateShotAnnotationReturn;
@@ -2632,6 +2642,10 @@ export type MutationSubmitChallengeEntryArgs = {
videoId: Scalars["ID"]["input"];
};
export type MutationSyncAppleSubscriptionArgs = {
input: SyncAppleSubscriptionInputGql;
};
export type MutationUndismissChallengeArgs = {
challengeId: Scalars["ID"]["input"];
};
@@ -2814,9 +2828,11 @@ export type Query = {
challenges: Array<Challenge>;
doesUsernameExist: Scalars["Boolean"]["output"];
getAggregatedShotMetrics: Array<AggregateResultGql>;
getAppleAppAccountToken: Scalars["String"]["output"];
getAvailableSubscriptionOptions: StripeSubscriptionOptionsGql;
getBucketSet?: Maybe<BucketSetGql>;
getDeployedConfig: DeployedConfigGql;
getDrillRunLeaderboard: DrillRunLeaderboardGql;
getFeedVideos: VideoHistoryGql;
getGameTypeTagMetrics: Array<GameTypeTagMetric>;
getLoggedInUser?: Maybe<UserGql>;
@@ -2878,6 +2894,12 @@ export type QueryGetBucketSetArgs = {
keyName: Scalars["String"]["input"];
};
export type QueryGetDrillRunLeaderboardArgs = {
drillTag: Scalars["String"]["input"];
interval?: InputMaybe<TimeInterval>;
limit?: Scalars["Int"]["input"];
};
export type QueryGetFeedVideosArgs = {
after?: InputMaybe<Scalars["String"]["input"]>;
feedInput?: InputMaybe<VideoFeedInputGql>;
@@ -3377,6 +3399,27 @@ export type SuccessfulAddAddShotAnnotationErrors =
| AddShotAnnotationErrors
| SuccessfulAdd;
export type SyncAppleSubscriptionInputGql = {
signedRenewalInfo?: InputMaybe<Scalars["String"]["input"]>;
signedTransactionInfo: Scalars["String"]["input"];
};
export type SyncAppleSubscriptionResultGql = {
__typename?: "SyncAppleSubscriptionResultGQL";
appleStatus?: Maybe<Scalars["Int"]["output"]>;
entitlementEndsAt?: Maybe<Scalars["DateTime"]["output"]>;
entitlementSource?: Maybe<EntitlementSourceTypeEnum>;
entitlementStartsAt?: Maybe<Scalars["DateTime"]["output"]>;
errorCode?: Maybe<Scalars["String"]["output"]>;
errorMessage?: Maybe<Scalars["String"]["output"]>;
expiresAt?: Maybe<Scalars["DateTime"]["output"]>;
hasActiveSubscription: Scalars["Boolean"]["output"];
latestTransactionId?: Maybe<Scalars["String"]["output"]>;
ok: Scalars["Boolean"]["output"];
originalTransactionId?: Maybe<Scalars["String"]["output"]>;
productId?: Maybe<Scalars["String"]["output"]>;
};
export type TableStateGql = {
__typename?: "TableStateGQL";
homography?: Maybe<HomographyInfoGql>;
@@ -4573,6 +4616,39 @@ export type GetRunsLeaderboardQuery = {
};
};
export type GetDrillRunLeaderboardQueryVariables = Exact<{
drillTag: Scalars["String"]["input"];
interval?: InputMaybe<TimeInterval>;
limit?: InputMaybe<Scalars["Int"]["input"]>;
}>;
export type GetDrillRunLeaderboardQuery = {
__typename?: "Query";
getDrillRunLeaderboard: {
__typename?: "DrillRunLeaderboardGQL";
youRank?: number | null;
totalPlayers: number;
entries: Array<{
__typename?: "RunGQL";
id: number;
runLength: number;
videoId: number;
user: {
__typename?: "UserGQL";
id: number;
username: string;
profileImageUri?: string | null;
};
}>;
youRun?: {
__typename?: "RunGQL";
id: number;
runLength: number;
videoId: number;
} | null;
};
};
export type GetVideoMakePercentageIntervalsQueryVariables = Exact<{
videoId: Scalars["ID"]["input"];
intervalDuration: Scalars["Int"]["input"];
@@ -9547,6 +9623,105 @@ export type GetRunsLeaderboardQueryResult = Apollo.QueryResult<
GetRunsLeaderboardQuery,
GetRunsLeaderboardQueryVariables
>;
export const GetDrillRunLeaderboardDocument = gql`
query GetDrillRunLeaderboard(
$drillTag: String!
$interval: TimeInterval
$limit: Int = 50
) {
getDrillRunLeaderboard(
drillTag: $drillTag
interval: $interval
limit: $limit
) {
entries {
id
runLength
videoId
user {
id
username
profileImageUri
}
}
youRun {
id
runLength
videoId
}
youRank
totalPlayers
}
}
`;
/**
* __useGetDrillRunLeaderboardQuery__
*
* To run a query within a React component, call `useGetDrillRunLeaderboardQuery` and pass it any options that fit your needs.
* When your component renders, `useGetDrillRunLeaderboardQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetDrillRunLeaderboardQuery({
* variables: {
* drillTag: // value for 'drillTag'
* interval: // value for 'interval'
* limit: // value for 'limit'
* },
* });
*/
export function useGetDrillRunLeaderboardQuery(
baseOptions: Apollo.QueryHookOptions<
GetDrillRunLeaderboardQuery,
GetDrillRunLeaderboardQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<
GetDrillRunLeaderboardQuery,
GetDrillRunLeaderboardQueryVariables
>(GetDrillRunLeaderboardDocument, options);
}
export function useGetDrillRunLeaderboardLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetDrillRunLeaderboardQuery,
GetDrillRunLeaderboardQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetDrillRunLeaderboardQuery,
GetDrillRunLeaderboardQueryVariables
>(GetDrillRunLeaderboardDocument, options);
}
export function useGetDrillRunLeaderboardSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetDrillRunLeaderboardQuery,
GetDrillRunLeaderboardQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetDrillRunLeaderboardQuery,
GetDrillRunLeaderboardQueryVariables
>(GetDrillRunLeaderboardDocument, options);
}
export type GetDrillRunLeaderboardQueryHookResult = ReturnType<
typeof useGetDrillRunLeaderboardQuery
>;
export type GetDrillRunLeaderboardLazyQueryHookResult = ReturnType<
typeof useGetDrillRunLeaderboardLazyQuery
>;
export type GetDrillRunLeaderboardSuspenseQueryHookResult = ReturnType<
typeof useGetDrillRunLeaderboardSuspenseQuery
>;
export type GetDrillRunLeaderboardQueryResult = Apollo.QueryResult<
GetDrillRunLeaderboardQuery,
GetDrillRunLeaderboardQueryVariables
>;
export const GetVideoMakePercentageIntervalsDocument = gql`
query GetVideoMakePercentageIntervals(
$videoId: ID!

View File

@@ -30,3 +30,33 @@ query GetRunsLeaderboard($interval: TimeInterval, $when: DateTime) {
}
}
}
query GetDrillRunLeaderboard(
$drillTag: String!
$interval: TimeInterval
$limit: Int = 50
) {
getDrillRunLeaderboard(
drillTag: $drillTag
interval: $interval
limit: $limit
) {
entries {
id
runLength
videoId
user {
id
username
profileImageUri
}
}
youRun {
id
runLength
videoId
}
youRank
totalPlayers
}
}

View File

@@ -31,6 +31,11 @@ type Query {
limit: Int! = 50
requiredTags: [String!] = null
): RunLeaderboardGQL!
getDrillRunLeaderboard(
drillTag: String!
interval: TimeInterval = null
limit: Int! = 50
): DrillRunLeaderboardGQL!
getMakesLeaderboard(
interval: TimeInterval = null
when: DateTime = null
@@ -98,6 +103,7 @@ type Query {
): UserRelationshipsResult!
getAvailableSubscriptionOptions: StripeSubscriptionOptionsGQL!
getUserSubscriptionStatus: UserSubscriptionStatusGQL!
getAppleAppAccountToken: String!
getQuotaStatus: QuotaStatusGQL!
getPlayTime(userId: Int!, filters: VideoFilterInput = null): UserPlayTimeGQL!
getUserVideos(
@@ -749,6 +755,13 @@ type RunLeaderboardGQL {
entries: [RunGQL!]!
}
type DrillRunLeaderboardGQL {
entries: [RunGQL!]!
youRun: RunGQL
youRank: Int
totalPlayers: Int!
}
type CountLeaderboardGQL {
entries: [UserShotCountEntry!]!
}
@@ -1020,6 +1033,7 @@ enum EntitlementSourceTypeEnum {
ADMIN
MANUAL
STRIPE
APPLE
ALPHA_LEGACY
}
@@ -1175,6 +1189,9 @@ type Mutation {
retireTags(tagIds: [Int!]!): Boolean!
ensureStripeCustomerExists: UserGQL!
deleteUser: Boolean!
syncAppleSubscription(
input: SyncAppleSubscriptionInputGQL!
): SyncAppleSubscriptionResultGQL!
createSubscription(priceId: String!): CreateSubscriptionResultGQL!
createCustomerPortalSession: CreateCustomerPortalSessionResultGQL!
cancelSubscription: UserSubscriptionStatusGQL!
@@ -1328,6 +1345,26 @@ input EditUserInputGQL {
agreesToMarketing: Boolean = null
}
type SyncAppleSubscriptionResultGQL {
ok: Boolean!
errorCode: String
errorMessage: String
hasActiveSubscription: Boolean!
entitlementSource: EntitlementSourceTypeEnum
entitlementStartsAt: DateTime
entitlementEndsAt: DateTime
appleStatus: Int
originalTransactionId: String
latestTransactionId: String
productId: String
expiresAt: DateTime
}
input SyncAppleSubscriptionInputGQL {
signedTransactionInfo: String!
signedRenewalInfo: String = null
}
type CreateSubscriptionResultGQL {
checkoutUrl: String!
sessionId: String!