This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
graphql-link.yaml
89 lines (82 loc) · 2.01 KB
/
graphql-link.yaml
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
# Configure the host and port the service will listen on
listen: 0.0.0.0:8080
#policy-agent:
# insecure-client: true
# address: 127.0.0.1:10000
#
# Configure the GraphQL upstream servers you will be accessing
upstreams:
character:
url: http://localhost:8081/graphql
prefix: Characters
show:
url: http://localhost:8082/graphql
prefix: Shows
starShip:
url: http://localhost:8084/graphql
prefix: StarShip
# weather:
# type: openapi
# prefix: Weather
# spec:
# url: https://weather.com/swagger-docs/sun/v1/sunV1DailyForecast.json
# api:
# api-key: please configure me
types:
- name: Query
actions:
# mounts the root anilist query to the bestFriend field
- type: mount
field: bestFriend
upstream: character
query: query {}
# mounts the root show query to the name field
- type: mount
field: name
upstream: show
query: query {}
# mounts the root starship query to the id field
- type: mount
field: id
upstream: starShip
query: query {}
# - type: mount
# field: weather
# upstream: weather
# query: query {}
- name: Character
actions:
# mounts the root anilist query to the anime field
- type: link
field: name
# vars:
# $fullname: name { full }
upstream: show
# query: query { show(name:$fullname) }
#
# The above link lets you do queries that access data from both the anilist and pokemon services. Example:
# query {
# anime {
# Character(search: "Pikachu") {
# description
# image {
# medium
# }
# pokemon {
# attacks {
# special {
# name
# type
# damage
# }
# }
# }
# }
# }
#}
- name: Mutation
actions:
# mounts all the fields of the root character mutation
- type: mount
upstream: character
query: mutation {}