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

Fix nullifying other custom method decorators bug #247

Merged
merged 3 commits into from
Feb 1, 2019

Conversation

MichalLytek
Copy link
Owner

@MichalLytek MichalLytek 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 🔒

@MichalLytek MichalLytek added Bug 🐛 Something isn't working Internal 🏠 All the things related to internal parts labels Feb 1, 2019
@MichalLytek MichalLytek added this to the 1.0.0 release milestone Feb 1, 2019
@MichalLytek MichalLytek self-assigned this Feb 1, 2019
@codecov
Copy link

codecov bot 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Something isn't working Internal 🏠 All the things related to internal parts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

type-graphql decorators nullify other custom method decorators
1 participant