Open
Conversation
Signed-off-by: Hitarth Hindocha <hindochahitarth@gmail.com>
49eba1a to
e266fff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template
GDG CHARUSAT TEAM ID Team 137
Description
This PR introduces a Categorization System to the library demo. Previously, books were only associated with authors. This change adds a
Category
entity, allowing books to be grouped by genres or topics (e.g., "Fiction", "Science", "Biography").
Summary of changes:
Created a
Category
JPA entity with id, name, and description.
Implemented
CategoryRepository
for data persistence.
Added
CategoryInput
DTO and updated
BookInput
to support linking books to categories via categoryId.
Updated the GraphQL Schema with:
New
Category
type.
Queries:
getAllCategories
,
getCategoryById
.
Mutation:
addCategory
.
Updated
Book
type to include its category details.
Enhanced
BookController
with mapping logic for the new GraphQL endpoints.
Fixes keploy/keploy#3889
Type of change
New feature (non-breaking change which adds functionality)
How Has This Been Tested?
The changes were verified manually using the GraphQL interface (localhost:8081/graphiql) and recorded using Keploy.
Reproduction Steps:
Start the app with Keploy: keploy record -c "./mvnw spring-boot:run"
Create a category:
graphql
mutation { addCategory(category: { name: "Biography", description: "Life stories" }) { id name } }
Create a book linked to that category:
graphql
mutation { addBook(book: { name: "Example Book", pageCount: 100, authorId: 1, categoryId: 1 }) { id name category { name } } }
Fetch all categories to see the linked books:
graphql
query { getAllCategories { name books { name } } }
Additional Context
The implementation preserves the existing functionality of the library demo while providing a foundation for more advanced features like genre-based filtering and search.
Checklist:
GDG CHARUSAT TEAM ID Team 137