feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
15.03k stars 750 forks source link

feat(schema): Split resolver options and property resolvers #2889

Closed daffl closed 1 year ago

daffl commented 1 year ago

This pull request is a backwards compatible change that allows to define property resolvers at the top level instead in the properties:

const userResolver = resolve<User, MyContext>({
    isDrinkingAge: async (value, user, context) => {
      const drinkingAge = await context.getDrinkingAge(user.country)

      return user.age >= drinkingAge
    },
    fullName: async (value, user, context) => {
      return `${user.firstName} ${user.lastName}`
    }
  },
  {}
)
netlify[bot] commented 1 year ago

Deploy Preview for feathers-dove ready!

Name Link
Latest commit 76bb01c11fdb3974c9caa2defd16171a61eab502
Latest deploy log https://app.netlify.com/sites/feathers-dove/deploys/637ebe7f6afa7c0008a67822
Deploy Preview https://deploy-preview-2889--feathers-dove.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.