phx-node
Version:
PHX NODE
136 lines • 3.45 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GET_STUDENT_INFO_QUERY_V3 = exports.GET_STUDENT_INFO_QUERY = void 0;
const graphql_request_1 = require("graphql-request");
const constant_1 = require("../../lib/constant");
exports.GET_STUDENT_INFO_QUERY = (0, graphql_request_1.gql) `
query GetStudentInfo($student_id: Int!, $studentStatus: [Int!]!) {
users(
where: {
id: { _eq: $student_id }
deleted_at: { _is_null: true }
school_id: { _is_null: false }
profile_student: { student_status: { _in: $studentStatus } }
user_roles: {
deleted_at: { _is_null: true }
role: { role_code: { _eq: ${constant_1.ROLE_STUDENT_CODE} } }
is_active: { _eq: true }
}
}
) {
school_id
classroom_students(
where: {
deleted_at: { _is_null: true }
classroom: {
deleted_at: { _is_null: true }
school_year: { start_at: { _lte: now }, end_at: { _gte: now } }
}
}
) {
classroom {
classroom_id: id
school_year_id
grade {
grade_id: id
educational_level_id
}
program_id
}
}
profile_student {
user_code
is_first_child
student_status
program_educational_id
program_map_educational_level {
program_id
program {
name
}
educational_level_id
educational_level {
name
}
}
}
}
}
`;
exports.GET_STUDENT_INFO_QUERY_V3 = (0, graphql_request_1.gql) `
query GetStudentInfo($student_id: Int!, $studentStatus: [Int!]!) {
users(
where: {
id: { _eq: $student_id }
deleted_at: { _is_null: true }
school_id: { _is_null: false }
profile_student: { student_status: { _in: $studentStatus } }
user_roles: {
deleted_at: { _is_null: true }
role: { role_code: { _eq: "${constant_1.ROLE_STUDENT_CODE}" } }
is_active: { _eq: true }
}
}
) {
school_id
full_name
first_name
last_name
classroom_students(
where: {
deleted_at: { _is_null: true }
classroom: {
deleted_at: { _is_null: true }
school_year: { start_at: { _lte: now }, end_at: { _gte: now } }
}
}
) {
classroom {
classroom_id: id
name
school_year_id
grade {
grade_id: id
name
educational_level_id
}
program_id
}
}
profile_student {
user_code
is_first_child
student_status
admission_date
program_educational_id
grade {
id
name
}
program_map_educational_level {
program_id
program {
name
}
educational_level_id
educational_level {
name
}
}
}
relationshipUsersByStudentId(where: { deleted_at: { _is_null: true } }) {
user {
id
full_name
first_name
last_name
phone_number
email
is_use_email_secondary
email_secondary
}
}
}
}
`;
//# sourceMappingURL=query.js.map