Compare commits

..

13 Commits

Author SHA1 Message Date
dean
b7b482694e WIP: Add challenges feature schema and operations
- Add Challenge, ChallengeEntry, ChallengeInvitation, RuleSet types
- Add queries: challenges, challenge, challengeLeaderboard, myChallengeInvitations, myChallengeEntries, ruleSets
- Add mutations: createChallenge, createRuleSet, inviteUsersToChallenge, respondToChallengeInvitation, startChallenge, submitChallengeEntry, recalculateChallengeEntry

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 16:12:03 -08:00
dean
ce8d2aaec8 Add pocket size field to GraphQL schema and operations
All checks were successful
Tests / Tests (pull_request) Successful in 9s
2025-11-10 10:55:08 -08:00
0f89f97006 Merge pull request 'Add playlist with segment durations to ShotWithAllFeaturesFragment' (#207) from loewy/include-playlist-in-shot-features into master
Reviewed-on: #207
Reviewed-by: dean <deanwenstrand@gmail.com>
2025-11-10 18:15:41 +00:00
cdf438c089 add playlist w/ segment durations in gql return
All checks were successful
Tests / Tests (pull_request) Successful in 10s
2025-11-07 11:53:13 -08:00
7dbfadf13a Merge pull request 'Notifications Operation' (#206) from loewy/notifications-operations into master
Reviewed-on: #206
2025-11-07 00:15:28 +00:00
a74a11e789 update notif operations
All checks were successful
Tests / Tests (pull_request) Successful in 9s
2025-11-06 16:06:32 -08:00
3b2f88c0e0 update naming of notification fragment 2025-11-06 16:06:32 -08:00
a3ac769cd4 notifications operations 2025-11-06 16:06:32 -08:00
00fc2ab44b Merge pull request 'Notifications schema' (#205) from loewy/notifications-schema into master
Reviewed-on: #205
2025-11-07 00:05:04 +00:00
58ab272289 add follow enum
All checks were successful
Tests / Tests (pull_request) Successful in 9s
2025-11-06 15:33:41 -08:00
242afae92b notifications schema 2025-11-06 15:33:41 -08:00
6bf597a2ec Merge pull request 'add has follwer to feed query' (#204) from dean/add-has-following-to-feed into master
Reviewed-on: #204
2025-11-06 23:30:07 +00:00
5c62d45068 Merge pull request 'Add marketing opt in to schema' (#203) from loewy/add-agrees-to-marketing-schema into master
Reviewed-on: #203
2025-10-20 20:52:17 +00:00
9 changed files with 8228 additions and 465 deletions

5423
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,207 @@
query GetChallenges {
challenges {
id
name
description
minimumShots
startDate
endDate
createdAt
updatedAt
requiredTableSize
requiredPocketSize
isPublic
maxAttempts
ruleSet {
id
name
description
}
createdBy {
id
username
profileImageUri
}
}
}
query GetChallenge($id: ID!) {
challenge(id: $id) {
id
name
description
minimumShots
startDate
endDate
createdAt
updatedAt
requiredTableSize
requiredPocketSize
isPublic
maxAttempts
ruleSet {
id
name
description
}
createdBy {
id
username
profileImageUri
}
}
}
query GetRuleSets {
ruleSets {
id
name
description
}
}
query GetChallengeLeaderboard($challengeId: ID!, $limit: Int) {
challengeLeaderboard(challengeId: $challengeId, limit: $limit) {
id
status
shotsCount
makesCount
makeRate
qualified
createdAt
user {
id
username
profileImageUri
}
video {
id
createdAt
}
}
}
query GetMyChallengeInvitations {
myChallengeInvitations {
id
status
createdAt
challenge {
id
name
description
startDate
endDate
createdBy {
id
username
profileImageUri
}
}
inviter {
id
username
profileImageUri
}
}
}
mutation CreateRuleSet($name: String!, $description: String) {
createRuleSet(name: $name, description: $description) {
id
name
description
}
}
mutation CreateChallenge(
$name: String!
$ruleSetId: ID!
$minimumShots: Int!
$startDate: DateTime!
$endDate: DateTime!
$description: String
$requiredTableSize: Float
$requiredPocketSize: Float
$isPublic: Boolean! = false
$maxAttempts: Int
) {
createChallenge(
name: $name
ruleSetId: $ruleSetId
minimumShots: $minimumShots
startDate: $startDate
endDate: $endDate
description: $description
requiredTableSize: $requiredTableSize
requiredPocketSize: $requiredPocketSize
isPublic: $isPublic
maxAttempts: $maxAttempts
) {
id
name
description
requiredTableSize
requiredPocketSize
isPublic
maxAttempts
}
}
mutation InviteUsersToChallenge($challengeId: ID!, $userIds: [ID!]!) {
inviteUsersToChallenge(challengeId: $challengeId, userIds: $userIds) {
id
status
inviter {
id
username
}
}
}
mutation RespondToChallengeInvitation($invitationId: ID!, $accept: Boolean!) {
respondToChallengeInvitation(invitationId: $invitationId, accept: $accept) {
id
status
challenge {
id
}
}
}
mutation StartChallenge($challengeId: ID!) {
startChallenge(challengeId: $challengeId) {
id
status
createdAt
challenge {
id
name
}
}
}
mutation SubmitChallengeEntry($entryId: ID!, $videoId: ID!) {
submitChallengeEntry(entryId: $entryId, videoId: $videoId) {
id
status
qualified
makeRate
shotsCount
makesCount
video {
id
}
}
}
mutation RecalculateChallengeEntry($entryId: ID!) {
recalculateChallengeEntry(entryId: $entryId) {
id
status
qualified
makeRate
shotsCount
makesCount
}
}

View File

@@ -0,0 +1,58 @@
query GetNotifications(
$limit: Int! = 20
$offset: Int! = 0
$filters: NotificationFilters = null
) {
notifications(limit: $limit, offset: $offset, filters: $filters) {
notifications {
...Notification
}
totalCount
unreadCount
hasMore
}
}
query GetUnreadNotificationCount {
unreadNotificationCount
}
mutation MarkNotificationAsRead($notificationId: Int!) {
markNotificationAsRead(notificationId: $notificationId)
}
mutation MarkNotificationsAsRead($notificationIds: [Int!]!) {
markNotificationsAsRead(notificationIds: $notificationIds)
}
mutation MarkAllNotificationsAsRead {
markAllNotificationsAsRead
}
mutation DeleteNotification($notificationId: Int!) {
deleteNotification(notificationId: $notificationId)
}
fragment Notification on NotificationGQL {
id
notificationType
actor {
id
username
profileImageUri
}
videoId
comment {
id
message
user {
id
username
profileImageUri
}
}
reactionType
isRead
createdAt
readAt
}

View File

@@ -191,6 +191,9 @@ fragment ShotWithAllFeatures on ShotGQL {
id
streamSegmentType
}
playlist {
segmentDurations
}
}
}

View File

@@ -177,3 +177,13 @@ fragment UserFragment on UserGQL {
videosPrivateByDefault
agreesToMarketing
}
query GetUsersMatching(
$matchString: String = null
$limit: Int = null
$after: String = null
) {
getUsersMatching(matchString: $matchString, limit: $limit, after: $after) {
...UserFragment
}
}

View File

@@ -36,6 +36,7 @@ query GetVideoUpdatePageDetails($videoId: Int!) {
makePercentage
elapsedTime
tableSize
pocketSize
private
tags {
tagClasses {
@@ -66,6 +67,7 @@ query GetVideoDetails($videoId: Int!) {
createdAt
updatedAt
tableSize
pocketSize
private
owner {
id
@@ -97,6 +99,9 @@ query GetVideoSocialDetailsById($videoId: Int!) {
getVideo(videoId: $videoId) {
id
name
screenshotUri
makePercentage
totalShots
owner {
id
firebaseUid

View File

@@ -3,6 +3,12 @@ type Query {
aggregateInput: AggregateInputGQL!
): [AggregateResultGQL!]!
getBucketSet(keyName: String!): BucketSetGQL
challenges: [Challenge!]!
challenge(id: ID!): Challenge
challengeLeaderboard(challengeId: ID!, limit: Int! = 50): [ChallengeEntry!]!
myChallengeInvitations: [ChallengeInvitation!]!
ruleSets: [RuleSet!]!
myChallengeEntries: [ChallengeEntry!]!
getDeployedConfig: DeployedConfigGQL!
waitFor(duration: Float!): Float!
getFeedVideos(
@@ -28,6 +34,12 @@ type Query {
when: DateTime = null
): CountLeaderboardGQL!
getMedals(scope: MedalScope!, userId: Int = null): RequestedMedalsGQL!
notifications(
limit: Int! = 20
offset: Int! = 0
filters: NotificationFilters = null
): NotificationConnection!
unreadNotificationCount: Int!
getRuns(
filterInput: RunFilterInput!
runIds: [Int!] = null
@@ -292,35 +304,60 @@ type BucketGQL {
lowerBound: Float!
}
type DeployedConfigGQL {
allowNewUsers: Boolean!
firebase: Boolean!
devMode: Boolean!
environment: String!
minimumAllowedAppVersion: String!
subscriptionGatingEnabled: Boolean!
bannerMessages: [BannerGQL!]!
type Challenge {
id: ID!
name: String!
description: String
minimumShots: Int!
requiredTableSize: Float
requiredPocketSize: Float
isPublic: Boolean!
maxAttempts: Int
startDate: DateTime!
endDate: DateTime!
createdAt: DateTime!
updatedAt: DateTime!
ruleSet: RuleSet!
createdBy: UserGQL!
}
type BannerGQL {
type RuleSet {
id: ID!
name: String!
description: String
createdAt: DateTime!
updatedAt: DateTime!
}
type UserGQL {
id: Int!
message: String!
color: String!
kind: BannerKindEnum!
dismissible: Boolean!
priority: Int!
firebaseUid: String
username: String!
isAdmin: Boolean
fargoRating: Int
activeVideoId: Int
stripeCustomerId: String
profileImageUri: String
createdAt: DateTime
updatedAt: DateTime
videosPrivateByDefault: Boolean
agreesToMarketing: Boolean
following: [UserGQL!]
followers: [UserGQL!]
isFollowedByCurrentUser: Boolean
}
enum BannerKindEnum {
INFO
WARNING
ERROR
}
type VideoHistoryGQL {
videos: [VideoGQL!]!
pageInfo: PageInfoGQL!
hasFollowing: Boolean!
type ChallengeEntry {
id: ID!
status: String!
shotsCount: Int
makesCount: Int
makeRate: Float
qualified: Boolean
createdAt: DateTime!
challenge: Challenge!
video: VideoGQL
user: UserGQL!
}
type VideoGQL {
@@ -342,6 +379,7 @@ type VideoGQL {
elapsedTime: Float
framesPerSecond: Float!
tableSize: Float!
pocketSize: Float
private: Boolean!
stream: UploadStreamGQL
playlist: HLSPlaylistGQL
@@ -353,23 +391,6 @@ type VideoGQL {
comments: [CommentGQL!]!
}
type UserGQL {
id: Int!
firebaseUid: String
username: String!
isAdmin: Boolean
fargoRating: Int
activeVideoId: Int
stripeCustomerId: String
profileImageUri: String
createdAt: DateTime
updatedAt: DateTime
videosPrivateByDefault: Boolean
agreesToMarketing: Boolean
following: [UserGQL!]
followers: [UserGQL!]
}
type ShotGQL {
id: Int!
videoId: Int!
@@ -625,6 +646,45 @@ type CommentGQL {
replies: [CommentGQL!]!
}
type ChallengeInvitation {
id: ID!
status: String!
createdAt: DateTime!
challenge: Challenge!
inviter: UserGQL!
}
type DeployedConfigGQL {
allowNewUsers: Boolean!
firebase: Boolean!
devMode: Boolean!
environment: String!
minimumAllowedAppVersion: String!
subscriptionGatingEnabled: Boolean!
bannerMessages: [BannerGQL!]!
}
type BannerGQL {
id: Int!
message: String!
color: String!
kind: BannerKindEnum!
dismissible: Boolean!
priority: Int!
}
enum BannerKindEnum {
INFO
WARNING
ERROR
}
type VideoHistoryGQL {
videos: [VideoGQL!]!
pageInfo: PageInfoGQL!
hasFollowing: Boolean!
}
type PageInfoGQL {
hasNextPage: Boolean!
endCursor: String
@@ -647,6 +707,7 @@ input VideoFeedInputGQL @oneOf {
followedByUserId: Int
userId: Int
allUsers: Boolean
home: Boolean
}
type MakePercentageIntervalGQL {
@@ -715,6 +776,37 @@ input MedalScope @oneOf {
datetimeRange: DatetimeRangeAggregationInput
}
type NotificationConnection {
notifications: [NotificationGQL!]!
totalCount: Int!
unreadCount: Int!
hasMore: Boolean!
}
type NotificationGQL {
id: Int!
notificationType: NotificationTypeEnum!
actor: UserGQL!
videoId: Int
comment: CommentGQL
reactionType: String
isRead: Boolean!
createdAt: DateTime!
readAt: DateTime
}
enum NotificationTypeEnum {
COMMENT
COMMENT_REPLY
REACTION
FOLLOW
}
input NotificationFilters {
isRead: Boolean = null
notificationTypes: [NotificationTypeEnum!] = null
}
type GetRunsResult {
runs: [RunGQL!]!
count: Int
@@ -900,6 +992,30 @@ scalar JSON
type Mutation {
createBucketSet(params: CreateBucketSetInput!): BucketSetGQL!
createRuleSet(name: String!, description: String = null): RuleSet!
createChallenge(
name: String!
ruleSetId: ID!
minimumShots: Int!
startDate: DateTime!
endDate: DateTime!
description: String = null
requiredTableSize: Float = null
requiredPocketSize: Float = null
isPublic: Boolean! = false
maxAttempts: Int = null
): Challenge!
inviteUsersToChallenge(
challengeId: ID!
userIds: [ID!]!
): [ChallengeInvitation!]!
respondToChallengeInvitation(
invitationId: ID!
accept: Boolean!
): ChallengeInvitation!
startChallenge(challengeId: ID!): ChallengeEntry!
recalculateChallengeEntry(entryId: ID!): ChallengeEntry!
submitChallengeEntry(entryId: ID!, videoId: ID!): ChallengeEntry!
setLoggerLevel(path: String!, level: String!): Boolean!
reactToVideo(videoId: Int!, reaction: ReactionEnum): Boolean!
commentOnVideo(
@@ -916,6 +1032,10 @@ type Mutation {
reason: ReportReasonEnum!
customReason: String = null
): Boolean!
markNotificationAsRead(notificationId: Int!): Boolean!
markAllNotificationsAsRead: Boolean!
markNotificationsAsRead(notificationIds: [Int!]!): Boolean!
deleteNotification(notificationId: Int!): Boolean!
addAnnotationToShot(
shotId: Int!
annotationName: String!
@@ -1081,6 +1201,7 @@ input VideoMetadataInput {
"""
tags: [VideoTagInput!] = null
tableSize: Float = null
pocketSize: Float = null
lastIntendedSegmentBound: Int = null
streamSegmentType: StreamSegmentTypeEnum = null
private: Boolean = null

848
yarn.lock

File diff suppressed because it is too large Load Diff