This repository was archived by the owner on Mar 7, 2018. It is now read-only.
Repository navigation
Implement MessageSchema.event resolver - #29
Merged
Merged
Conversation
Smarker
approved these changes
Jul 3, 2017
Smarker
left a comment
Contributor
There was a problem hiding this comment.
LGTM with small comments
| * @param {string[]} params | ||
| * @returns {Promise.<object[]>} | ||
| */ | ||
| function executeQuery(query, params) { // eslint-disable-line no-unused-vars |
Contributor
There was a problem hiding this comment.
I agree this needs 2 parameters rather than passing in an unnecessary object with query and params properties.
| return new Promise((resolve, reject) => { | ||
| const eventId = args && args.messageId; | ||
| if (!eventId) { | ||
| reject('No event id to fetch specified'); |
Contributor
There was a problem hiding this comment.
If you would like I believe you can also just do return reject('No event id to fetch specified'); and it should still prevent the below lines from executing.
Contributor
Author
There was a problem hiding this comment.
I'll do this as a follow-up.
| } | ||
| }); | ||
| }) | ||
| .catch(err => reject(err)); |
Contributor
There was a problem hiding this comment.
I think you could do catch(reject); too right? The way you have it now is more explicit, so I like that way, too.
Contributor
Author
There was a problem hiding this comment.
I'll do this as a follow-up.
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
project-fortis#48