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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
subgraphs:
connectors:
routing_url: none
schema:
sdl: |
extend schema
@link(
url: "https://specs.apollo.dev/federation/v2.10"
import: ["@key", "@external", "@requires", "@shareable"]
)
@link(
url: "https://specs.apollo.dev/connect/v0.1"
import: ["@connect", "@source"]
)
@source(
name: "json"
http: {
baseURL: "http://localhost"
headers: [
{ name: "Content-Type" value: "application/x-www-form-urlencoded" }
]
}
)
type Query {
hello: String @connect(http: { GET: "http://localhost/hello" }, selection: "$")
}
type Mutation {
post(input: PostInput!): Post
@connect(
source: "json"
http: {
POST: "/posts"
body: """
$$args.input {
int
str
bool
enum
id
intArr
strArr
boolArr
# enumArr
idArr
obj {
a
b
c
nested {
d
e
f
}
}
objArr {
a
b
c
nested {
d
e
f
}
}
}
"""
}
selection: "id"
)
}
input PostInput {
int: Int
str: String
bool: Boolean
# enum: PostEnum
id: ID
intArr: [Int]
strArr: [String]
boolArr: [Boolean]
# enumArr: [PostEnum]
idArr: [ID]
obj: PostChildInput
objArr: [PostChildInput]
}
input PostChildInput {
a: Int
b: String
c: Boolean
nested: PostNestedInput
}
input PostNestedInput {
d: Int
e: String
f: Boolean
}
# enum PostEnum {
# A
# B
# C
# }
type Post {
id: ID
}