Skip to content
This repository has been archived by the owner. 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

project-fortis#48

@c-w c-w requested review from Smarker and erikschlegel Jul 3, 2017
Smarker
Smarker approved these changes Jul 3, 2017
Copy link
Contributor

@Smarker Smarker left a comment

LGTM with small comments

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

@Smarker Smarker Jul 3, 2017

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

@Smarker Smarker Jul 3, 2017

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

@c-w c-w Jul 3, 2017

I'll do this as a follow-up.

}
});
})
.catch(err => reject(err));
Copy link
Contributor

@Smarker Smarker Jul 3, 2017

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

@c-w c-w Jul 3, 2017

I'll do this as a follow-up.

Copy link
Contributor

@jcjimenez jcjimenez left a comment

LGTM

@c-w c-w merged commit 094b1b4 into master Jul 3, 2017
2 checks passed
Copy link
Collaborator

@erikschlegel erikschlegel left a comment

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants