-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupward-ssr.yml
61 lines (55 loc) · 1.1 KB
/
upward-ssr.yml
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
status: response.status # [Go to 1]
headers: response.headers # [Go to 1]
body: response.body # [Go to 1]
# 1
response:
when:
- matches: request.url.pathname
pattern: '^/pokemon/graphql'
use: pokemonGQL # [Go to 2]
- matches: request.url.pathname
pattern: '^/countries/graphql'
use: countriesGQL # [Go to 3]
default: pokemon # [Go to 4]
# 2
pokemonGQL:
target: env.POKEMON_GRAPHQL_URL
# 3
countriesGQL:
target: env.COUNTRIES_GRAPHQL_URL
# 4
pokemon:
inline:
status: 200
headers:
inline:
content-type:
inline: text/html
body:
engine: mustache
template: './templates/pokemon-ssr.mst'
provide:
pokemonData: pokemonData # [Go to 5]
# 5
pokemonData: pokemonResult.data.pokemon # [Go to 6]
# 6
pokemonResult:
url: env.POKEMON_GRAPHQL_URL
query:
resolver: inline
inline: '{
pokemon(name: "Pikachu") {
name
image
types
weight {
minimum
maximum
}
height {
minimum
maximum
}
classification
}
}'