Commit 281109ef authored by Subhojit Paul's avatar Subhojit Paul

Merge branch 'meeting-summary-api' into 'master'

meeting summary query api

See merge request !4
parents 4c3bcde7 96102630
......@@ -47,6 +47,11 @@ class StandUpNotes extends RESTDataSource {
return (response !== null && typeof response === 'object') ? StandUpNotes.standUpNotesReducer(response) : [];
}
async meetingSummary({standUpMeetingId}) {
const response = await this.get('meeting-summary', {meeting: standUpMeetingId, _format: process.env.DEFAULT_FORMAT});
return Array.isArray(response) ? response.map(standUpNote => StandUpNotes.standUpNotesReducer(standUpNote)) : [];
}
static standUpNotesReducer(standUpNote) {
return {
id: standUpNote.nid[0].value,
......
module.exports = {
Query: {
standUpQuestions: (_, {id}, {dataSources}) => dataSources.questionAPI.getQuestionsByStandUp({id: id}),
meetingSummary: (_, {standUpMeetingId}, {dataSources}) => dataSources.standUpNotesAPI.meetingSummary({standUpMeetingId})
},
Mutation: {
createStandUpNote: (_, {input}, {dataSources}) => dataSources.standUpNotesAPI.create({input}),
......
......@@ -3,6 +3,7 @@ const { gql } = require('apollo-server');
const typeDefs = gql`
type Query {
standUpQuestions(id: ID!): [Question]!
meetingSummary(standUpMeetingId: ID!): [StandUpNotes]!
}
type Mutation {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment