import { graphql } from "@/gql";

export const UPSERT_ASSIGNMENT_COMPLETION_MUTATION = graphql(`
  mutation UpsertAssignmentCompletion(
    $assignmentId: ID!
    $courseSessionId: ID!
    $assignmentUserId: ID
    $completionStatus: String!
    $completionDataString: String!
    $evaluationGrade: Float
    $evaluationPoints: Float
  ) {
    upsert_assignment_completion(
      assignment_id: $assignmentId
      course_session_id: $courseSessionId
      assignment_user_id: $assignmentUserId
      completion_status: $completionStatus
      completion_data_string: $completionDataString
      evaluation_grade: $evaluationGrade
      evaluation_points: $evaluationPoints
    ) {
      assignment_completion {
        id
        completion_status
        submitted_at
        evaluation_submitted_at
        evaluation_grade
        evaluation_points
        completion_data
      }
    }
  }
`);
