-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathschema.graphql
119 lines (107 loc) · 2.01 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
type Coordinate @aws_iam @aws_cognito_user_pools {
lat: Float
lng: Float
}
input CoordinateInput {
lat: Float
lng: Float
}
type Driver @aws_iam @aws_cognito_user_pools {
id: ID
email: AWSEmail
fullName: String
deliveryType: String
deviceId: String
deviceType: String
status: DriverStatus
createdAt: AWSDateTime
updatedAt: AWSDateTime
trips: [Trip]
}
input DriverInput {
id: ID
email: AWSEmail
fullName: String
deliveryType: String
deviceId: String
deviceType: String
status: DriverStatus
createdAt: AWSDateTime
updatedAt: AWSDateTime
trips: [TripInput]
}
enum DriverStatus {
active
inactive
banned
}
type PaginatedDrivers {
drivers: [Driver!]!
nextToken: String
}
type PaginatedTrips @aws_iam
@aws_cognito_user_pools {
trips: [Trip!]!
nextToken: String
}
type Trip @aws_iam
@aws_cognito_user_pools {
id: ID
driver: Driver
labelStart: String
geoStart: Coordinate
labelEnd: String
geoEnd: Coordinate
duration: Float
distance: Float
geoFenceId: ID
clientphone: String
expireAt: Float
status: TripStatus
createdAt: AWSDateTime
updatedAt: AWSDateTime
}
input TripInput {
id: ID
driver: DriverInput
geoStart: CoordinateInput
geoEnd: CoordinateInput
labelStart: String
labelEnd: String
duration: Float
distance: Float
geoFenceId: ID
clientPhone: String
expireAt: Float
status: TripStatus
createdAt: AWSTimestamp
updatedAt: AWSTimestamp
}
enum TripStatus {
completed
inroute
accepted
error
onhold
}
type Mutation {
saveDriver(input: DriverInput): Driver
delDriver(id: ID!): Driver
saveTrip(input: TripInput): Trip
delTrip(id: ID!): Trip
}
type Query {
getDriver(id: ID!): Driver
listDrivers(limit: Int, nextToken: String): PaginatedDrivers
addDriverTrip(driverId: ID!, tripId: ID!): Driver
removeDriverTrip(driverId: ID!, tripId: ID!): Driver
getTrip(id: ID!): Trip
listTrips(limit: Int, nextToken: String): PaginatedTrips
statusTrips(status: TripStatus, limit: Int, nextToken: String): PaginatedTrips
@aws_iam
@aws_cognito_user_pools
}
schema {
query: Query
mutation: Mutation
}