Skip to content

Commit

Permalink
Merge pull request #168 from tahmid-saj/dev-graphql-fitness
Browse files Browse the repository at this point in the history
graphql fitness
  • Loading branch information
tahmid-saj authored Aug 5, 2024
2 parents 5429c56 + 6f90d77 commit 903ec3b
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/utils/graphql/fitness.graphql.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { gql } from "@apollo/client";

// graphql fitness queries
export const EXERCISES_BY_USER = gql`
query ExercisesByUser($userId: String!, $email: String!) {
exercisesByUser(userId: $userId, email: $email) {
exerciseDate
exerciseName
exerciseSets
exerciseReps
exerciseType
exerciseMuscle
exerciseEquipment
exerciseDifficulty
exerciseInstructions
exerciseTag
}
}
`

// graphql fitness mutations
export const CREATE_USER_EXERCISE = gql`
query CreateUserExercise($userId: String!, $email: String!, $exercise: ExerciseInfo!) {
createUserExercise(userId: $userId, email: $email, exercise: $exercise)
}
`

export const DELETE_USER_EXERCISE = gql`
query DeleteUserExercise($userId: String!, $email: String!, $exerciseTag: Int!) {
deleteUserExercise(userId: $userId, email: $email, exerciseTag: $exerciseTag)
}
`

export const UPDATE_USER_EXERCISES = gql`
query UpdateUserExercises($userId: String!, $email: String!, $exercises: [ExerciseInfo]!) {
updateUserExercises(userId: $userId, email: $email, exercises: $exercises)
}
`

0 comments on commit 903ec3b

Please sign in to comment.