From 6f90d77f1520187c2acd4e9570da9e1481efaa87 Mon Sep 17 00:00:00 2001 From: tahmid-saj Date: Mon, 5 Aug 2024 13:56:45 -0400 Subject: [PATCH] graphql fitness --- src/utils/graphql/fitness.graphql.js | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/utils/graphql/fitness.graphql.js b/src/utils/graphql/fitness.graphql.js index e69de29..5802d21 100644 --- a/src/utils/graphql/fitness.graphql.js +++ b/src/utils/graphql/fitness.graphql.js @@ -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) + } +` \ No newline at end of file