Open
Conversation
Signed-off-by: Hitarth Hindocha <hindochahitarth@gmail.com>
Signed-off-by: Hitarth Hindocha <hindochahitarth@gmail.com>
Signed-off-by: Hitarth Hindocha <hindochahitarth@gmail.com>
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 Partial Title Search functionality for books. Previously, users could only fetch books by their exact name using getBookByName. This enhancement allows users to find books even if they only know a fragment of the title, with support for case-insensitivity.
Summary of changes:
BookRepository
Added a new query method findByNameContainingIgnoreCase(String name) to leverage Spring Data JPA's derived query feature.
schema.graphqls
Introduced the searchBooks(title: String!): [Book] query to the GraphQL schema.
BookController
Implemented the @QueryMapping for searchBooks to connect the GraphQL entry point with the repository logic.
Fixes keploy/keploy#3888
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
The changes were verified manually using curl against the local GraphQL endpoint.
Test Case: Partial and Case-Insensitive Search
Setup: Ensure at least one book exists, e.g., "The Great Gatsby".
Execution: Run the following curl command:
bash
curl -X POST http://localhost:8081/graphql
-H "Content-Type: application/json"
-d '{"query": "{ searchBooks(title: "great") { name author { firstName lastName } } }"}'
Expected Result: The API returns an array containing "The Great Gatsby", even though the search term "great" was lowercase.
Additional Context (Please include any Screenshots/gifs if relevant)
This feature improves the discoverability of books in the library system and provides a more user-friendly search experience compared to exact matching.
...
Checklist:
GDG CHARUSAT TEAM ID Team 137