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

feat: add entity write validation #50

Closed
wants to merge 1 commit into from

Conversation

wschurman
Copy link
Member

Why

#25

This adds the ability for custom field validators to be specified for fields, which will allow moving some field-specific logic to the entity layer in application in a structured way rather than needing the validation to be at the edge/API layer.

Some notes:

How

Add write validator and validate during mutation.

Test Plan

Run new tests.

@codecov
Copy link

codecov bot commented Jun 24, 2020

Codecov Report

Merging #50 into master will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #50      +/-   ##
==========================================
+ Coverage   93.91%   94.00%   +0.09%     
==========================================
  Files          57       57              
  Lines        1347     1368      +21     
  Branches      145      151       +6     
==========================================
+ Hits         1265     1286      +21     
  Misses         81       81              
  Partials        1        1              
Flag Coverage Δ
#integration 94.00% <100.00%> (+0.09%) ⬆️
#unittest 94.00% <100.00%> (+0.09%) ⬆️
Impacted Files Coverage Δ
packages/entity/src/EntityConfiguration.ts 100.00% <100.00%> (ø)
packages/entity/src/EntityFields.ts 100.00% <100.00%> (ø)
packages/entity/src/EntityMutator.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35db7e9...39093c3. Read the comment docs.

@wschurman wschurman closed this Jan 27, 2021
@ide ide deleted the @wschurman/field-write-validators branch March 7, 2023 06:10
@ide ide restored the @wschurman/field-write-validators branch March 7, 2023 06:11
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