👀 Is there an existing feature request for this?
🔖 Enhancement description
Problem
When viewing an author, there is no quick way to see how many books they have written without fetching the entire list of books. This information is often needed for high-level summaries or author profiles.
Proposed Solution
Add a virtual field bookCount to the
Author
type in the GraphQL schema.
GraphQL Schema:
graphql
type Author {
id: ID
firstName: String
lastName: String
bookCount: Int # New Field
books: [Book]
}
Controller/Entity:
Add a method in the
BookController
or update the
Author
entity to calculate the size of the books list.
Expected Behavior
When querying an author, the user can request the bookCount field.
The system returns the integer count of books associated with that author.
🎤 Why should this be worked on?
Data Efficiency: Allows clients to get aggregate data (count) without the overhead of transferring the full list of books.
Improved UX: Useful for UI components that display author statistics.
💻 Repository spring-boot-postgres-graphql
GDG CHARUSAT TEAM : T137
💻 Repository
keploy
👀 Is there an existing feature request for this?
🔖 Enhancement description
Problem
When viewing an author, there is no quick way to see how many books they have written without fetching the entire list of books. This information is often needed for high-level summaries or author profiles.
Proposed Solution
Add a virtual field bookCount to the
Author
type in the GraphQL schema.
GraphQL Schema:
graphql
type Author {
id: ID
firstName: String
lastName: String
bookCount: Int # New Field
books: [Book]
}
Controller/Entity:
Add a method in the
BookController
or update the
Author
entity to calculate the size of the books list.
Expected Behavior
When querying an author, the user can request the bookCount field.
The system returns the integer count of books associated with that author.
🎤 Why should this be worked on?
Data Efficiency: Allows clients to get aggregate data (count) without the overhead of transferring the full list of books.
Improved UX: Useful for UI components that display author statistics.
💻 Repository spring-boot-postgres-graphql
GDG CHARUSAT TEAM : T137
💻 Repository
keploy