Repository navigation
Expand file tree
/
Copy pathswapi.graphqls
More file actions
60 lines (56 loc) · 1.58 KB
/
Copy pathswapi.graphqls
File metadata and controls
60 lines (56 loc) · 1.58 KB
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
type Query {
# If episode omitted, returns the hero of the whole saga. If provided, returns the hero of that particular episode
hero(episode: Episode): Character
# Find human by id
human(id: String!): Human
# Find droid by id
droid(id: String!): Droid
# Find character by id
character(id: String!): Character
}
# One of the films in the Star Wars Trilogy
enum Episode {
# Released in 1977
NEWHOPE,
# Released in 1980
EMPIRE,
# Released in 1983
JEDI
}
# A character in the Star Wars Trilogy
interface Character {
# The id of the character
id: String!
# The name of the character
name: String
# The friends of the character, or an empty list if they have none
friends: [Character]
# Which movies they appear in
appearsIn: [Episode]
}
# A humanoid creature in the Star Wars universe
type Human implements Character {
# The id of the human
id: String!
# The name of the human
name: String
# The friends of the human, or an empty list if they have none
friends: [Character]
# Which movies they appear in
appearsIn: [Episode]
# The home planet of the human, or null if unknown
homePlanet: String
}
# A mechanical creature in the Star Wars universe
type Droid implements Character {
# The id of the droid
id: String!
# The name of the droid
name: String
# The friends of the droid, or an empty list if they have none
friends: [Character]
# Which movies they appear in
appearsIn: [Episode]
# The primary function of the droid
primaryFunction: String
}