forked from trevorblades/countries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.js
43 lines (38 loc) · 800 Bytes
/
schema.js
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
import {gql} from 'apollo-server';
export default gql`
type Continent {
code: String
name: String
countries: [Country]
}
type Country {
code: String
name: String
native: String
phone: String
continent: Continent
currency: String
languages: [Language]
emoji: String
emojiU: String
isFavorite: Boolean
}
type Language {
code: String
name: String
native: String
rtl: Int
}
type Query {
continents: [Continent]
continent(code: String): Continent
countries(offset: Int, first: Int): [Country]
country(code: String): Country
languages: [Language]
language(code: String): Language
}
type Mutation {
markAsFavorite(code: String): Country
unmarkAsFavorite(code: String): Country
}
`;