Last active
September 12, 2017 09:37
-
-
Save michaellee8/4854443c01b7f5ada94b899c3c4f95fb to your computer and use it in GitHub Desktop.
graphl script for query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"includeAll": [ | |
{ | |
"model": "User", | |
"as": "user", | |
"where": { | |
"userId": 1 | |
} | |
} | |
], | |
"includeCorrect": [ | |
{ | |
"model": "User", | |
"as": "user", | |
"where": { | |
"userId": 1 | |
} | |
}, | |
{ | |
"model": "QuestionAnswer", | |
"as": "questionAnswer", | |
"where": { | |
"questionAnswerIsCorrect": true | |
} | |
} | |
], | |
"includeWrong": [ | |
{ | |
"model": "User", | |
"as": "user", | |
"where": { | |
"userId": 1 | |
} | |
}, | |
{ | |
"model": "QuestionAnswer", | |
"as": "questionAnswer", | |
"where": { | |
"questionAnswerIsCorrect": false | |
} | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query getQuestionStats($includeAll: SequelizeJSON, $includeCorrect: SequelizeJSON, $includeWrong: SequelizeJSON) { | |
total: questionSumbitsCount(include: $includeAll) | |
all: questionSumbits(include: $includeAll) { | |
user { | |
userName | |
} | |
questionAnswer { | |
questionAnswerText | |
questionAnswerIsCorrect | |
} | |
} | |
correct: questionSumbitsCount(include: $includeCorrect) | |
wrong: questionSumbitsCount(include: $includeWrong) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment