Files
maternal-app/maternal-web/graphql/queries/dashboard.ts
Andrei a3cbe22592
Some checks failed
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled
feat: Implement dynamic dashboard with tabs/cards for multi-child families
- Create DynamicChildDashboard component with tab view (1-3 children) and card view (4+)
- Integrate with Redux viewMode selector for automatic layout switching
- Update GraphQL dashboard query to include displayColor, sortOrder, nickname
- Replace static summary with dynamic multi-child dashboard
- Add child selection handling with Redux state sync
- Implement compact metrics display for card view
- Build and test successfully
2025-10-04 21:43:05 +00:00

64 lines
1.0 KiB
TypeScript

import { gql } from '@apollo/client';
export const GET_DASHBOARD = gql`
query GetDashboard($childId: String) {
dashboard(childId: $childId) {
children {
id
name
birthDate
gender
photoUrl
displayColor
sortOrder
nickname
}
selectedChild {
id
name
birthDate
gender
photoUrl
displayColor
sortOrder
nickname
}
recentActivities {
id
type
startedAt
endedAt
notes
metadata
childId
loggedBy
logger {
id
name
}
}
todaySummary {
date
feedingCount
totalFeedingAmount
sleepCount
totalSleepDuration
diaperCount
medicationCount
}
familyMembers {
userId
familyId
role
user {
id
name
email
}
}
totalChildren
totalActivitiesToday
}
}
`;