logaretm / villus

🏎 A tiny and fast GraphQL client for Vue.js
https://villus.dev
MIT License
790 stars 31 forks source link

feat(mutation): add onData and onError hooks #197

Closed jbaubree closed 1 year ago

jbaubree commented 1 year ago

@logaretm Following https://github.com/logaretm/villus/issues/189 I did not complicate the thing by giving the possibility of having several onData hooks because, as you said, we are with mutations that are usually executed explicitly. I think this simple addition is enough for mutations. Feel free to edit PR as you need.

codecov-commenter commented 1 year ago

Codecov Report

Merging #197 (166167a) into main (2e3152a) will increase coverage by 0.02%. The diff coverage is 100.00%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #197      +/-   ##
==========================================
+ Coverage   94.01%   94.03%   +0.02%     
==========================================
  Files          21       21              
  Lines         551      553       +2     
  Branches      126      128       +2     
==========================================
+ Hits          518      520       +2     
  Misses         33       33              
Impacted Files Coverage Δ
packages/villus/src/useMutation.ts 96.77% <100.00%> (+0.22%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

jbaubree commented 1 year ago

@logaretm

logaretm commented 1 year ago

Thank you and very sorry about the delay, I'm not giving enough time for villus.