Class: SlsAdf::Mutation
Overview
Make GraphQL mutation calls to SLS ADF through Ruby methods.
Sample Usage:
response = SlsAdf::Mutation.delete_assignment('Assignment-1234')
Class Method Summary collapse
-
.create_assignment(assignment_input) ⇒ GraphQL::Client::Response
Makes a call to create assignment.
-
.create_notification(notification_input) ⇒ GraphQL::Client::Response
Makes a call to create a notification.
-
.delete_assignment(uuid) ⇒ GraphQL::Client::Response
Makes a call to delete the assignment with the given UUID.
-
.update_assignment(uuid, assignment_input) ⇒ GraphQL::Client::Response
Makes a call to update assignment.
-
.update_task(uuid, status) ⇒ GraphQL::Client::Response
Makes a call to update the task.
Class Method Details
.create_assignment(assignment_input) ⇒ GraphQL::Client::Response
Makes a call to create assignment. assignment_input has the following shape:
{
title: 'Test',
start: '2017-11-30T10:15:30+01:00', #ISO8601 format
end: '2017-12-30T12:15:30Z', #ISO8601 format
createdBy: 'MOE-1234',
type: 'QUIZ',
subjectGroupUuid: 'subject-group-uuid',
assignees: ['MOE-1235', 'MOE-1236', ...]
}
@param assignment_input
26 27 28 29 |
# File 'lib/sls_adf/mutation.rb', line 26 def create_assignment(assignment_input) execute_query(SlsAdf::Template::Mutation::Assignment::Create, assignment_input: assignment_input) end |
.create_notification(notification_input) ⇒ GraphQL::Client::Response
Makes a call to create a notification. notification_input has the following shape:
{
message: 'Assignment 1 has started!',
scope: 'SUBJECT_GROUP', #
scopeId: '', #
eventType: '', #
eventTypeId: '' # UUID,
receipient: ['', '', ...] # User ID.
}
@param notification_input
74 75 76 77 |
# File 'lib/sls_adf/mutation.rb', line 74 def create_notification(notification_input) execute_query(SlsAdf::Template::Mutation::Notification::Add, notification_input: notification_input) end |
.delete_assignment(uuid) ⇒ GraphQL::Client::Response
Makes a call to delete the assignment with the given UUID
@param uuid UUID of the subject_group to be modified
46 47 48 |
# File 'lib/sls_adf/mutation.rb', line 46 def delete_assignment(uuid) execute_query(SlsAdf::Template::Mutation::Assignment::Delete, uuid: uuid) end |
.update_assignment(uuid, assignment_input) ⇒ GraphQL::Client::Response
37 38 39 40 |
# File 'lib/sls_adf/mutation.rb', line 37 def update_assignment(uuid, assignment_input) execute_query(SlsAdf::Template::Mutation::Assignment::Update, uuid: uuid, assignment_input: assignment_input) end |
.update_task(uuid, status) ⇒ GraphQL::Client::Response
56 57 58 59 |
# File 'lib/sls_adf/mutation.rb', line 56 def update_task(uuid, status) execute_query(SlsAdf::Template::Mutation::Task::Update, uuid: uuid, task_status: status) end |