-
-
Save sericaia/9228e32b1f30d40888bb5e02bdbd4864 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// resolver code | |
employee: async (root, { where: { email, slackId } }, { dataSources }) => { | |
if (!email && !slackId) { | |
throw new Error('Email or SlackId are required.'); | |
} | |
if (email) { | |
return getEmployeeFromEmail(email, dataSources); | |
} | |
if (slackId) { | |
return getEmployeeFromSlackId(slackId, dataSources); | |
} | |
return null; | |
}, | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment