-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathquerys.js
executable file
·41 lines (41 loc) · 1.23 KB
/
querys.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// function that return a mailing list of the students that have unfinished toad games.
function unfishinedToadMail ()
{
let unfinishedToad = `{
games: toad_sessions(
where: {
_and: [
{ started_at: { _is_null: false } },
{ final_score: { _is_null: true } },
]
}
) {
updatedAt: updated_at
candidate {
login
}
}
}`;
return unfinishedToad;
}
function secondChanceMail ()
{
let secondChance = `{
user(
where: {
_and: [
{ progresses: { path: { _eq: "/rouen/onboarding/games" }, grade: { _eq: 0 } } }
{ _not: { progresses: { path: { _eq: "/rouen/onboarding/games" }, grade: { _neq: 0 } } } }
{ _not: { progresses: { path: { _eq: "/rouen/onboarding/games" }, grade: { _is_null: true } } } }
]
}
) {
login
progress: progresses_aggregate(where: { path: { _eq: "/rouen/onboarding/games"} }) {
games: aggregate { count }
}
}
}`;
return secondChance;
}
module.exports = { unfishinedToadMail, secondChanceMail };