Skip to content

Commit

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

// graphql calories burned queries
export const TRACKED_CALORIES_BURNED_BY_USER = gql`
query TrackedCaloriesBurnedByUser($userId: String!, $email: String!) {
trackedCaloriesBurnedByUser(userId: $userId, email: $email) {
dateTracked
activity
durationMinutes
caloriesBurnedPerHour
totalCaloriesBurned
activityId
}
}
`

// graphql calories burned mutations
export const CREATE_USER_TRACKED_CALORIES_BURNED = gql`
mutation CreateUserTrackedCaloriesBurned($userId: String!, $email: String!, $trackedCaloriesBurned: TrackedCaloriesBurnedInfo!) {
createUserTrackedCaloriesBurned(userId: $userId, email: $email, trackedCaloriesBurned: $trackedCaloriesBurned)
}
`

export const DELETE_USER_TRACKED_CALORIES_BURNED = gql`
mutation DeleteUserTrackedCaloriesBurned($userId: String!, $email: String!, $activityId: Int!) {
deleteUserTrackedCaloriesBurned(userId: $userId, email: $email, activityId: $activityId)
}
`

export const UPDATE_USER_TRACKED_CALORIES_BURNED = gql`
mutation UpdateUserTrackedCaloriesBurned($userId: String!, $email: String!, $trackedCaloriesBurned: [TrackedCaloriesBurnedInfo]!) {
updateUserTrackedCaloriesBurned(userId: $userId, email: $email, trackedCaloriesBurned: $trackedCaloriesBurned)
}
`

0 comments on commit 5429c56

Please sign in to comment.