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

Implement MessageSchema.event resolver #29

Merged
merged 4 commits into from Jul 3, 2017
Merged

Implement MessageSchema.event resolver #29

merged 4 commits into from Jul 3, 2017

Conversation

c-w
Copy link
Contributor

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

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

@Smarker Smarker left a comment

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
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
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
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
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
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.

Copy link
Contributor

@jcjimenez jcjimenez left a comment

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

@erikschlegel erikschlegel left a comment

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.

None yet

4 participants