From fedc5e46dab2e926d0445b7d3751a566ad49f933 Mon Sep 17 00:00:00 2001 From: Rushil Perera Date: Sat, 6 Dec 2025 08:26:16 -0500 Subject: [PATCH] feat: Define User GraphQL types and user profile query --- src/graphql/schema.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/graphql/schema.ts b/src/graphql/schema.ts index 217c6a3..4d3dc3f 100644 --- a/src/graphql/schema.ts +++ b/src/graphql/schema.ts @@ -129,6 +129,19 @@ export const typeDefs = /* GraphQL */ ` url: String! } + type User { + name: String! + avatar: Image! + statistics: UserAnimeStatistics! + } + + type UserAnimeStatistics { + count: Int! + meanScore: Float! + minutesWatched: Int! + episodesWatched: Int! + } + # ==================== # Input Types # ==================== @@ -181,6 +194,11 @@ export const typeDefs = /* GraphQL */ ` page: Int = 1 limit: Int = 10 ): PopularResult! + + """ + Fetch the authenticated user's profile + """ + user: User! } # ====================