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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nullifying other custom method decorators bug #247

merged 3 commits into from Feb 1, 2019


1 participant
Copy link

commented Feb 1, 2019

This PR changes the resolver's function calling mechanism.
Instead of calling the stored reference to original function (captured on decorator evaluation), it now calls the method on target instance - object[methodName].
This allows for the best interoperability with other custom decorators that overwrite the descriptor object to add some functionality.

Closes #166 馃敀

@19majkel94 19majkel94 added this to the 1.0.0 release milestone Feb 1, 2019

@19majkel94 19majkel94 self-assigned this Feb 1, 2019

@19majkel94 19majkel94 added this to In review in Board via automation Feb 1, 2019


This comment has been minimized.

Copy link

commented Feb 1, 2019

Codecov Report

Merging #247 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #247   +/-   ##
  Coverage   95.88%   95.88%           
  Files          67       67           
  Lines        1045     1045           
  Branches      183      182    -1     
  Hits         1002     1002           
  Misses         42       42           
  Partials        1        1
Impacted Files Coverage 螖
src/decorators/Field.ts 100% <酶> (酶) 猬嗭笍
src/decorators/FieldResolver.ts 93.33% <酶> (酶) 猬嗭笍
src/resolvers/create.ts 100% <100%> (酶) 猬嗭笍
src/helpers/resolver-metadata.ts 80% <100%> (酶)
src/decorators/Mutation.ts 100% <100%> (酶) 猬嗭笍
src/decorators/Subscription.ts 100% <100%> (酶) 猬嗭笍
src/decorators/Query.ts 100% <100%> (酶) 猬嗭笍

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 3e5ea9d...5cbd321. Read the comment docs.

@19majkel94 19majkel94 force-pushed the fix/custom-decorators-bug branch from 1954736 to 5cbd321 Feb 1, 2019

@19majkel94 19majkel94 merged commit 13165d8 into master Feb 1, 2019

4 checks passed

codecov/patch 100% of diff hit (target 95.88%)
codecov/project 95.88% (+0%) compared to 3e5ea9d
continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

Board automation moved this from In review to Done Feb 1, 2019

@19majkel94 19majkel94 deleted the fix/custom-decorators-bug branch Feb 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.