Skip to content
This repository was archived by the owner on Mar 7, 2018. It is now read-only.

Implement MessageSchema.event resolver - #29

Merged
c-w merged 4 commits into
masterfrom
messages-resolver
Jul 3, 2017
Merged

c-w merged 4 commits into
masterfrom
messages-resolver

Conversation

@c-w

@c-w c-w commented Jul 3, 2017 •

Copy link
Copy Markdown
Contributor

@c-w
c-w requested review from Smarker and erikschlegel July 3, 2017 17:27

@Smarker Smarker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with small comments

* @param {string[]} params
* @returns {Promise.<object[]>}
*/
function executeQuery(query, params) { // eslint-disable-line no-unused-vars

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do this as a follow-up.

}
});
})
.catch(err => reject(err));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could do catch(reject); too right? The way you have it now is more explicit, so I like that way, too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do this as a follow-up.

@jcjimenez jcjimenez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@c-w
c-w merged commit 094b1b4 into master Jul 3, 2017

@erikschlegel erikschlegel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants