@@ -36,16 +36,6 @@ type Query {
3636 """
3737 getAllReports : [Report ]
3838
39- """
40- Get the workout goals of a user by ID.
41- """
42- getWorkoutGoals (id : Int ! ): [String ]
43-
44- """
45- Get the current and max workout streak of a user.
46- """
47- getUserStreak (id : Int ! ): JSONString
48-
4939 """
5040 Get all facility hourly average capacities.
5141 """
@@ -358,39 +348,39 @@ type User {
358348
359349 name : String !
360350
361- activeStreak : Int
351+ activeStreak : Int !
352+
353+ maxStreak : Int !
354+
355+ workoutGoal : Int
362356
363- maxStreak : Int
357+ lastGoalChange : DateTime
364358
365- workoutGoal : [ DayOfWeekGraphQLEnum ]
359+ lastStreak : Int !
366360
367361 encodedImage : String
368362
369363 giveaways : [Giveaway ]
370364
365+ goalHistory : [WorkoutGoalHistory ]
366+
371367 friendRequestsSent : [Friendship ]
372368
373369 friendRequestsReceived : [Friendship ]
374370
375371 friendships : [Friendship ]
376372
377373 friends : [User ]
378- }
379-
380- enum DayOfWeekGraphQLEnum {
381- MONDAY
382-
383- TUESDAY
384-
385- WEDNESDAY
386-
387- THURSDAY
388-
389- FRIDAY
390374
391- SATURDAY
375+ """
376+ Get the total number of gym days (unique workout days) for user.
377+ """
378+ totalGymDays : Int !
392379
393- SUNDAY
380+ """
381+ The start date of the most recent active streak, up until the current date.
382+ """
383+ streakStart : Date
394384}
395385
396386type Giveaway {
@@ -401,6 +391,18 @@ type Giveaway {
401391 users : [User ]
402392}
403393
394+ type WorkoutGoalHistory {
395+ id : ID !
396+
397+ userId : Int !
398+
399+ workoutGoal : Int !
400+
401+ effectiveAt : DateTime !
402+
403+ user : User
404+ }
405+
404406type Friendship {
405407 id : ID !
406408
@@ -419,6 +421,13 @@ type Friendship {
419421 friend : User
420422}
421423
424+ """
425+ The `Date` scalar type represents a Date
426+ value as specified by
427+ [iso8601](https://en.wikipedia.org/wiki/ISO_8601).
428+ """
429+ scalar Date
430+
422431type Workout {
423432 id : ID !
424433
@@ -427,12 +436,9 @@ type Workout {
427436 userId : Int !
428437
429438 facilityId : Int !
430- }
431439
432- """
433- JSON String
434- """
435- scalar JSONString
440+ gymName : String !
441+ }
436442
437443type HourlyAverageCapacity {
438444 id : ID !
@@ -448,6 +454,22 @@ type HourlyAverageCapacity {
448454 history : [Float ]!
449455}
450456
457+ enum DayOfWeekGraphQLEnum {
458+ MONDAY
459+
460+ TUESDAY
461+
462+ WEDNESDAY
463+
464+ THURSDAY
465+
466+ FRIDAY
467+
468+ SATURDAY
469+
470+ SUNDAY
471+ }
472+
451473type CapacityReminder {
452474 id : ID !
453475
@@ -518,7 +540,7 @@ type Mutation {
518540 """
519541 Set a user's workout goals.
520542 """
521- setWorkoutGoals ("The ID of the user." userId : Int ! , "The new workout goal for the user in terms of days of the week." workoutGoal : [ String ] ! ): User
543+ setWorkoutGoals ("The ID of the user." userId : Int ! , "The new workout goal for the user in terms of number of days per week." workoutGoal : Int ! ): User
522544
523545 """
524546 Log a user's workout.
@@ -545,6 +567,11 @@ type Mutation {
545567 """
546568 createReport (createdAt : DateTime ! , description : String ! , gymId : Int ! , issue : String ! ): CreateReport
547569
570+ """
571+ Deletes a report by ID.
572+ """
573+ deleteReport (reportId : Int ! ): Report
574+
548575 """
549576 Deletes a user by ID.
550577 """
0 commit comments