This repository has been archived by the owner on Jun 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
schema.graphql
144 lines (116 loc) · 3.14 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
# @generated SignedSource<<61eff28ca34068e0d32355fa3790bfc6>>
# <BREAKING-CHANGES-LOG>
# </BREAKING-CHANGES-LOG>
schema {
query: RootQuery
mutation: RootMutation
}
"""Response type indicating an error"""
type AddLocationError implements Error {
message: String
}
"""Input type for creating a location"""
input AddLocationInput {
"""3-letter IATA code of airport or internal city code."""
locationId: String!
name: String!
"""Airport, city or country."""
type: LocationType!
}
union AddLocationOrError = AddLocationError | AddLocationResponse
"""
The newly created location edge that can be automatically added into a connection by Relay
"""
type AddLocationResponse {
locationEdge: LocationEdge
}
"""The currency object. Note this is just mocked data"""
type Currency {
"""The code of the currency """
code: String
"""Format string of the currency"""
format: String
"""
The globally unique ID of an object. You can unmask this ID to get original value but please note that this unmasked ID is not globally unique anymore and therefore it cannot be used as a cache key.
"""
id(opaque: Boolean = true): ID!
"""Currency rate compared to Euro"""
rate: Float
}
"""Interface to describe an error"""
interface Error {
message: String
}
"""Location type"""
type Location {
airportsCount: Int
code: String
country: LocationArea
countryFlagURL: String
"""
The globally unique ID of an object. You can unmask this ID to get original value but please note that this unmasked ID is not globally unique anymore and therefore it cannot be used as a cache key.
"""
id(opaque: Boolean = true): ID!
"""3-letter IATA code of airport or internal city code."""
locationId: String
name: String
rank: Int
slug: String
stationsCount: Int
timezone: String
"""Airport, city or country."""
type: String
}
"""Area of a location"""
type LocationArea {
code: String
locationId: String
name: String
slug: String
}
"""A connection to a list of items."""
type LocationConnection {
"""A list of edges."""
edges: [LocationEdge]
"""Information to aid in pagination."""
pageInfo: PageInfo!
}
"""An edge in a connection."""
type LocationEdge {
"""A cursor for use in pagination"""
cursor: String!
"""The item at the end of the edge"""
node: Location
}
enum LocationType {
AIRPORT
CITY
COUNTRY
}
"""Information about pagination in a connection."""
type PageInfo {
"""When paginating forwards, the cursor to continue."""
endCursor: String
"""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
}
"""Root Mutation."""
type RootMutation {
"""Add a new location"""
addLocation(location: AddLocationInput!): AddLocationOrError
}
"""Root Query"""
type RootQuery {
"""
Detail of a currency. Please note: This is not real data, only Math.random() is return
"""
currency(
"""The currency code"""
code: String!
): Currency
locations(after: String, before: String, first: Int, last: Int): LocationConnection
}