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!: allow async $resolve #50

Merged
merged 2 commits into from Sep 12, 2022
Merged

feat!: allow async $resolve #50

merged 2 commits into from Sep 12, 2022

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Sep 12, 2022

Context: nuxt/framework#7439

This PR Allows $resolve function return a promise.

While it is possible to try to make sync version of resolvers, in the future it would be harder and harder to do this.

Breaking change: resolveSchema and applyDefaults returns a Promise now.

Breaking change: get function passed to $resolve also returns a Promise. $resolve: (val, get) => get('key') should be $resolve: async (val, get) => await get('key')

@codecov
Copy link

codecov bot commented Sep 12, 2022

Codecov Report

Merging #50 (1502bc5) into main (40a4035) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 1502bc5 differs from pull request most recent head 90c7a27. Consider uploading reports for the commit 90c7a27 to get more accurate results

@@           Coverage Diff           @@
##             main      #50   +/-   ##
=======================================
  Coverage   84.64%   84.64%           
=======================================
  Files           8        8           
  Lines         918      918           
  Branches      239      239           
=======================================
  Hits          777      777           
  Misses        141      141           
Impacted Files Coverage Δ
src/schema.ts 100.00% <100.00%> (ø)
src/types.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

src/types.ts Outdated Show resolved Hide resolved
Co-authored-by: Daniel Roe <daniel@roe.dev>
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.

None yet

2 participants