Skip to content

Support for required and partial #14

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

Merged
merged 7 commits into from
Aug 18, 2024
Merged

Support for required and partial #14

merged 7 commits into from
Aug 18, 2024

Conversation

shmax
Copy link
Owner

@shmax shmax commented Aug 18, 2024

Adding two new features:

  1. required this is a convenience property on any field definition. When set to true and the value is not passed-in, an error will automatically be generated for you in this form of [1, "<name> is required"]. Alternatively, you can set required to the error you would like to get back when the value is not provided (eg. required: [1, 'my own custom error message']).
  2. 'partial'. When true, we will only validate any values passed in. When false, we will validate any required fields on the InputObject even when not provided.

Copy link

codecov bot commented Aug 18, 2024

Codecov Report

Attention: Patch coverage is 72.22222% with 5 lines in your changes missing coverage. Please review.

Project coverage is 95.78%. Comparing base (3d6b1ce) to head (8ae1fcf).
Report is 1 commits behind head on master.

Files Patch % Lines
src/Type/Definition/ValidatedFieldDefinition.php 72.22% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #14      +/-   ##
==========================================
- Coverage   97.60%   95.78%   -1.83%     
==========================================
  Files           2        2              
  Lines         251      261      +10     
==========================================
+ Hits          245      250       +5     
- Misses          6       11       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shmax shmax changed the title fix line endings Support for required and partial Aug 18, 2024
@shmax shmax merged commit 9807335 into master Aug 18, 2024
4 checks passed
@shmax shmax deleted the partial-and-required branch August 18, 2024 19:26
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