File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -318,6 +318,7 @@ type User {
318318 friends : [User ]
319319 totalGymDays : Int !
320320 streakStart : DateTime
321+ workoutHistory : [Workout ]
321322}
322323
323324type Workout {
@@ -333,4 +334,5 @@ type WorkoutGoalHistory {
333334 userId : Int !
334335 workoutGoal : Int !
335336 effectiveAt : DateTime !
337+ user : User
336338}
Original file line number Diff line number Diff line change @@ -269,6 +269,11 @@ class Meta:
269269 streak_start = graphene .DateTime (
270270 description = "The start datetime of the most recent active streak (midnight of the day in local timezone), up until the current date."
271271 )
272+ workout_history = graphene .List (lambda : Workout )
273+
274+ def resolve_workout_history (self , info ):
275+ query = Workout .get_query (info ).filter (WorkoutModel .user_id == self .id ).order_by (WorkoutModel .workout_time .desc ())
276+ return query .all ()
272277
273278 def resolve_total_gym_days (self , info ):
274279 return (
You can’t perform that action at this time.
0 commit comments