-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathschema.graphql
224 lines (175 loc) · 3.88 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
"""A animal interface"""
interface Animal {
"""The id of the animal"""
id: ID!
"""The name of the animal"""
name: String!
"""Breed of the animal"""
breed: String!
}
"""Type of animal manage by the app"""
type Bear implements Animal {
"""The id of the animal"""
id: ID!
"""The name of the animal"""
name: String!
"""Breed of the animal"""
breed: String!
}
scalar BirthDate
"""Type of vehicle manage by the app"""
type Car implements Vehicle {
"""Internal identifier"""
id: ID!
"""The manufacturer of the car"""
manufacturer: String!
"""The model of the car"""
model: String!
"""Number of seats in the car"""
seats_number: Int!
}
input CarInput {
id: ID!
manufacturer: String!
model: String!
seats_number: Int!
}
"""Type of animal manage by the app"""
type Cat implements Animal {
"""The id of the animal"""
id: ID!
"""The name of the animal"""
name: String!
"""Breed of the animal"""
breed: String!
}
scalar DateTime
"""Type of animal manage by the app"""
type Dog implements Animal {
"""The id of the animal"""
id: ID!
"""The name of the animal"""
name: String!
"""Breed of the animal"""
breed: String!
}
input IdInput {
id: String!
}
type Mutation {
CreateCar(input: CarInput!): Car!
UpdateCar(input: CarInput!): Car!
DeleteCar(input: IdInput!): ID!
CreateTruck(input: TruckInput!): Truck!
UpdateTruck(input: TruckInput!): Truck!
DeleteTruck(input: IdInput!): ID!
}
"""Information about pagination in a connection."""
type PageInfo {
"""When paginating forwards, are there more items?"""
hasNextPage: Boolean!
"""When paginating backwards, are there more items?"""
hasPreviousPage: Boolean!
"""When paginating backwards, the cursor to continue."""
startCursor: String
"""When paginating forwards, the cursor to continue."""
endCursor: String
}
"""Person manage by the app"""
type Person {
"""Internal identifier"""
id: ID!
"""Name of the person"""
name: String!
"""Title of the person"""
title: PersonTitle!
"""Birth date of the person"""
birth_date: BirthDate
"""Date of creation of the person in database"""
created_at: DateTime!
"""Vehicles of the person"""
vehicles(
"""Resolves vehicle using its id."""
id: String
): [Vehicle]
"""Pet of the person"""
pet: Pet
}
"""Title of a person"""
enum PersonTitle {
unknown
Miss
Mrs
Ms
Mr
}
"""Animals available as pet"""
union Pet = Dog | Cat | Bear
type Query {
persons(
"""Resolves person using its id."""
id: ID
): [Person]
person(
"""Resolves person using its id."""
id: ID!
): Person
vehicles(
after: String
first: Int
"""Resolves vehicle using its owner id."""
owner: ID
"""Resolves vehicle using its id."""
id: String
): VehicleConnection
car(
"""Resolves car using its id."""
id: ID!
): Car
truck(
"""Resolves truck using its id."""
id: ID!
): Truck
}
"""Type of vehicle manage by the app"""
type Truck implements Vehicle {
"""Internal identifier"""
id: ID!
"""The manufacturer of the truck"""
manufacturer: String!
"""The model of the truck"""
model: String!
"""Maximum load of the truck"""
maximum_load: Int!
}
input TruckInput {
id: ID!
manufacturer: String!
model: String!
maximum_load: Int!
}
"""A vehicle interface"""
interface Vehicle {
"""The id of the vehicle"""
id: ID!
"""The manufacturer of the vehicle"""
manufacturer: String!
"""The model of the vehicle"""
model: String!
}
"""A connection to a list of items."""
type VehicleConnection {
"""Number of items in the connection"""
totalCount: Int
"""Information to aid in pagination."""
pageInfo: PageInfo!
"""Information to aid in pagination."""
edges: [VehicleEdge]
}
"""An edge in a connection."""
type VehicleEdge {
"""The item at the end of the edge."""
node: Vehicle
"""A cursor for use in pagination."""
cursor: String!
}