Repository navigation
Expand file tree
/
Copy pathschema.graphql
More file actions
44 lines (38 loc) · 1.45 KB
/
Copy pathschema.graphql
File metadata and controls
44 lines (38 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# @model annotations are used by AWS AppSync to create DynamoDB tables
type Routine @model(subscriptions: null) @auth(rules: [{ allow: owner }]) {
id: ID!
name: String
exercises: [Exercise] @connection(name: "RoutineExercises")
workouts: [Workout] @connection(name: "RoutineWorkouts")
}
# @connection annotations are used by AWS AppSync to create foreign keys between
# objects
# Many-to-Many connections are not yet supported by AWS AppSync
type Exercise @model(subscriptions: null) @auth(rules: [{ allow: owner }]) {
id: ID!
name: String
sets: Int
repetitions: Int
weightInKg: Float
routine: Routine! @connection(name: "RoutineExercises")
results: [ExerciseResult] @connection(name: "ExerciseResults")
}
type Workout @model(subscriptions: null) @auth(rules: [{ allow: owner }]) {
id: ID!
routine: Routine! @connection(name: "RoutineWorkouts")
startedAt: AWSDateTime!
completedAt: AWSDateTime
exerciseResults: [ExerciseResult] @connection(name: "WorkoutExerciseResults")
}
type ExerciseResult @model(subscriptions: null) @auth(rules: [{ allow: owner }]) {
id: ID!
workout: Workout! @connection(name: "WorkoutExerciseResults")
exercise: Exercise! @connection(name: "ExerciseResults")
sets: [Set] @connection(name: "ExerciseResultSets")
}
type Set @model(subscriptions: null) @auth(rules: [{ allow: owner }]) {
exerciseResult: ExerciseResult @connection(name: "ExerciseResultSets")
setNumber: Int
repetitions: Int
weightInKg: Float
}