Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#328 fx-adding input validations #602

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Bananayosostene
Copy link
Contributor

@Bananayosostene Bananayosostene commented Oct 24, 2024

PR Description
This PR addresses two key issues: duplication in mutation and types, and the lack of input validation in the application. The aim is to enhance the codebase by removing redundant mutations and types while ensuring robust input validation across relevant mutations.

Description of tasks that were expected to be completed
Remove Duplication in Mutations and Types
Consolidated redundant mutations and types, reducing unnecessary code duplication. This refactor improves maintainability and readability of the GraphQL schema.

Implement Input Validation
Added input validation to mutations where it was previously missing. This ensures that invalid data is caught early and appropriate error messages are returned. The validation checks for required fields, correct data formats, and constraints.

Refactor and Clean Code
Refactored the code to follow DRY (Don't Repeat Yourself) principles, ensuring that shared logic is reusable. Updated the documentation where necessary to reflect the changes.

How has this been tested?
Unit Tests
Unit tests were written for all affected mutations to ensure that the refactoring and validation implementation works as expected. Mock data and scenarios for invalid inputs were tested thoroughly.

Manual Testing
Manually tested the GraphQL API using tools like Postman and GraphQL Playground to ensure that valid inputs succeed and invalid inputs fail with proper error messages.

Regression Testing
Ran a full suite of regression tests to ensure that the refactor didn't introduce any new issues in unrelated parts of the application.

Number of Commits
The number of commits has been limited to 2 commits to ensure clarity:

Refactor and remove duplication.
Implement input validation and write tests.
Screenshots (If appropriate)
N/A

Please check this Checklist before you submit your PR:
My code follows the style guidelines of this project.
I have performed a self-review of my code.
I have commented my code, particularly in hard-to-understand areas.
My code generates no warnings.
My test coverage meets the set test coverage threshold.
There are no vulnerabilities.
There are no conflicts with the base branch.

Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
metron-devpulse ❌ Failed (Inspect) Oct 27, 2024 7:12pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant