コード例 #1
0
    def resolve_upcoming_meetings(self, info):
        user = info.context.user
        if isinstance(user, DomainInstructor):
            meetings = meeting_api(info).get_meetings_of_instructor(
                user.user_name)
        else:
            meetings = meeting_api(info).get_meetings_of_student(
                user.student_number)

        return [Meeting.from_domain(meeting) for meeting in meetings]
コード例 #2
0
 def mutate(self, info, instructor, office_hour_id, index, start_time):
     student = info.context.user
     instructor = instructor_api(info).get_instructor(instructor).unwrap()
     return (meeting_api(info).create_meeting(
         instructor, student, office_hour_id, index,
         start_time).map(Meeting.from_domain).unwrap())
コード例 #3
0
 def mutate(self, info, note_id):
     return (meeting_api(info).delete_note(
         note_id, info.context.user).map(DeleteNote).unwrap())
コード例 #4
0
 def mutate(self, info, meeting_id, content_text):
     return (meeting_api(info).create_note(meeting_id, info.context.user,
                                           content_text).map(
                                               Note.from_domain).unwrap())
コード例 #5
0
 def mutate(self, info, meeting_id):
     user = info.context.user
     return (meeting_api(info).delete_meeting(
         meeting_id, user).map(DeleteMeeting).unwrap())
コード例 #6
0
 def resolve_meeting(self, info, meeting_id):
     return (meeting_api(info).get_meeting(meeting_id).map_or(
         Meeting.from_domain, None))
コード例 #7
0
 def resolve_meetings(self, info, office_hour_id, start_time, end_time):
     return [
         Meeting.from_domain(meeting) for meeting in meeting_api(
             info).get_meetings_of_officehour_for_date(
                 office_hour_id, start_time, end_time)
     ]