Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

daffl
Copy link
Member

@daffl daffl commented Nov 23, 2022

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
Copy link

netlify bot commented Nov 23, 2022

Deploy Preview for feathers-dove ready!

Name Link
🔨 Latest commit 76bb01c
🔍 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.

@daffl daffl force-pushed the resolver-properties branch from 5e2ebe0 to 76bb01c Compare November 24, 2022 00:44
@daffl daffl merged commit 4822c94 into dove Nov 24, 2022
@daffl daffl deleted the resolver-properties branch November 24, 2022 01:04
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant