-
Notifications
You must be signed in to change notification settings - Fork 4
/
testSchema.graphql
59 lines (49 loc) · 1.35 KB
/
testSchema.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
# It's an example schema:
#
# * Proxies some endpoints from the http://swapi.co
# * Merges and delegates execution for 2 GraphQL external GraphQL API
extend schema
@includeSchema(name: "starWars", url: "http://try.sangria-graphql.org/graphql")
@includeSchema(name: "db", url: "https://developer.deutschebahn.com/free1bahnql/graphql")
"""
The root query type.
"""
type Query
@includeFields(schema: "starWars", type: "Query")
@includeFields(schema: "db", type: "Query") {
"A character from the StarWars (REST API)"
person(id: Int!): Person
@httpGet(url: "https://swapi.co/api/people/${arg.id}/")
"A list of characters from the StarWars (REST API)"
people(page: Int): [Person]
@httpGet(
url: "http://swapi.co/api/people"
query: {name: "page", value: "${arg.page}"})
@value(name: "results")
fruits: [Fruit!]! @fake(min: 5)
}
type Film {
title: String
}
type Person {
name: String
address: String! @fake(expr: "#{address.fullAddress}")
birthday: DateTime! @fake(past: true)
size: Int @value(name: "height")
homeworld: Planet @httpGet(url: "${value.homeworld}")
films: [Film] @httpGet(forAll: "$.films", url: "${elem.$}")
}
"A planet from the StarWars universe"
type Planet {
name: String
}
type Fruit {
weight: Int!
description: String! @fake(expr: "#{hipster.word}")
color: Color!
}
enum Color {
RED
BLUE
MAGENTA
}