Basic schooling GQL
This commit is contained in:
parent
e884b0e97d
commit
c797cb9f24
102
graphs/schooling.htm
Normal file
102
graphs/schooling.htm
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
==
|
||||||
|
<?php
|
||||||
|
function resolveExamMemberRanks() {
|
||||||
|
return \GermanAirlinesVa\Schooling\Models\ExamMemberRank::with([
|
||||||
|
'exam_questions' => function ($query) {
|
||||||
|
$query->groupBy('id');
|
||||||
|
}
|
||||||
|
])->get();
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveExamTyperatings() {
|
||||||
|
return \GermanAirlinesVa\Schooling\Models\ExamTyperating::with([
|
||||||
|
'exam_questions' => function ($query) {
|
||||||
|
$query->groupBy('id');
|
||||||
|
}
|
||||||
|
])->get();
|
||||||
|
}
|
||||||
|
==
|
||||||
|
# Content
|
||||||
|
extend type Query {
|
||||||
|
typeratings: [Typerating] @all(model: "GermanAirlinesVa\\Schooling\\Models\\Typerating")
|
||||||
|
memberRanks: [MemberRank] @all(model: "GermanAirlinesVa\\Schooling\\Models\\MemberRank")
|
||||||
|
examMemberRanks: [ExamMemberRank]
|
||||||
|
examTyperatings: [ExamTyperating]
|
||||||
|
}
|
||||||
|
|
||||||
|
type MemberRank {
|
||||||
|
id: ID!
|
||||||
|
name: String!
|
||||||
|
description: String!
|
||||||
|
points: Int!
|
||||||
|
price: Int!
|
||||||
|
badge: String!
|
||||||
|
region: String!
|
||||||
|
exam_questions: [ExamMemberRankQuestion]!
|
||||||
|
exams: [ExamMemberRank]!
|
||||||
|
}
|
||||||
|
type Typerating {
|
||||||
|
id: ID!
|
||||||
|
name: String!
|
||||||
|
price: Int!
|
||||||
|
exam_questions: [ExamTyperatingQuestion]!
|
||||||
|
exams: [ExamTyperating]!
|
||||||
|
}
|
||||||
|
type ExamMemberRank {
|
||||||
|
id: ID!
|
||||||
|
member_id: ID!
|
||||||
|
member_rank: MemberRank!
|
||||||
|
start: DateTime!
|
||||||
|
status: ExamStatus!
|
||||||
|
exam_questions: [ExamMemberRankQuestion]!
|
||||||
|
exam_answers: [ExamMemberRankAnswer]!
|
||||||
|
}
|
||||||
|
type ExamTyperating {
|
||||||
|
id: ID!
|
||||||
|
member_id: ID!
|
||||||
|
typerating: Typerating!
|
||||||
|
start: DateTime!
|
||||||
|
status: ExamStatus!
|
||||||
|
exam_questions: [ExamTyperatingQuestion]!
|
||||||
|
exam_answers: [ExamTyperatingAnswer]!
|
||||||
|
}
|
||||||
|
type ExamMemberRankQuestion {
|
||||||
|
id: ID!
|
||||||
|
member_rank: MemberRank!
|
||||||
|
in_use: Boolean!
|
||||||
|
mandatory: Boolean!
|
||||||
|
text: String!
|
||||||
|
picture: String!
|
||||||
|
exam_answers: [ExamMemberRankAnswer]!
|
||||||
|
}
|
||||||
|
type ExamTyperatingQuestion {
|
||||||
|
id: ID!
|
||||||
|
typerating: Typerating!
|
||||||
|
in_use: Boolean!
|
||||||
|
mandatory: Boolean!
|
||||||
|
text: String!
|
||||||
|
picture: String!
|
||||||
|
exam_answers: [ExamTyperatingAnswer]!
|
||||||
|
}
|
||||||
|
type ExamMemberRankAnswer {
|
||||||
|
id: ID!
|
||||||
|
exam_question: ExamMemberRankQuestion!
|
||||||
|
text: String!
|
||||||
|
is_correct: Boolean!
|
||||||
|
}
|
||||||
|
type ExamTyperatingAnswer {
|
||||||
|
id: ID!
|
||||||
|
exam_question: ExamTyperatingQuestion!
|
||||||
|
text: String!
|
||||||
|
is_correct: Boolean!
|
||||||
|
}
|
||||||
|
|
||||||
|
enum ExamStatus {
|
||||||
|
open
|
||||||
|
pending
|
||||||
|
closed
|
||||||
|
validated
|
||||||
|
}
|
||||||
|
|
||||||
|
scalar DateTime
|
||||||
|
@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime")
|
||||||
Loading…
x
Reference in New Issue
Block a user