Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphql fitness #168

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
`
Loading