-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
83 lines (72 loc) · 2.11 KB
/
schema.graphql
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
schema {
query: Query
mutation: Mutation
}
"""
Defines the allowed range of the
"""
directive @range(min: Float, max:Float, maxPrecision: Float = 1) on SCALAR|OBJECT|FIELD_DEFINITION|ARGUMENT_DEFINITION|INTERFACE|UNION|ENUM|ENUM_VALUE|INPUT_OBJECT|INPUT_FIELD_DEFINITION
"""
Represents a <b>year</b><br/>
And more
"""
scalar Year
"A named object <img src='hello'/> <h1>definition</h1>"
interface Named {
"name of the object"
name(num: Int! @deprecated(reason: "use family instead")): String!
}
"Represents a student. This is a very important object for understanding how this repo works af therefore needs a very very long description so we know it's important"
type Student implements Named @deprecated (reason: "yup") {
"The name of the student"
name(num: Int!): String! @deprecated(reason: "Bad idea") @range(min: 7, maxPrecision: 0.01)
"Current age"
age: Year
"The average grade"
grade: Float
}
"Course difficulty"
enum Difficulty{
"Easier then eating pizza"
EASY,
"Harder then eating just one slice of pizza"
HARD @deprecated(reason: "קשה יש רק בלחם")
}
"A course"
type Course implements Named {
"The name of the course"
name(num: Int!): String!
"All the students that study the course"
students(
"Show only students above this grade"
minimumGrade: Int): [Student]
difficulty: Difficulty
}
"desc desc"
union UniversityObject = Student | Course
"Services for querying data"
type Query{
"get all students"
students(
"get only the first <code>max</code> results"
first: Int @range(max: 500),
"Starts with this letter"
letter: String! @length(min:1, max: 1)
): [Student]
"get all courses"
courses: [Course]
"get all the named objects"
namedObjects: [Named]
"desc desc"
universityThingies: [UniversityObject]
}
"Student input info"
input InputStudent{
"Student name"
name: String @mask(simpleMask: "ddd", regExp: "^[a-zA-Z]+$")
}
"desc desc"
type Mutation{
"Add a student. Returns ID of the student"
addStudent("Student name" name: String, x: [InputStudent]): Int
}