graph_weaver 0.6.1 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +8 -0
- data/Gemfile.lock +153 -4
- data/README.md +45 -79
- data/docs/alternatives.md +195 -0
- data/docs/cassettes.md +61 -50
- data/docs/editors.md +32 -47
- data/docs/errors.md +360 -103
- data/docs/federation.md +692 -473
- data/docs/generated_modules.md +441 -314
- data/docs/getting_started.md +370 -194
- data/docs/i18n.md +171 -0
- data/docs/logging.md +197 -50
- data/docs/real_world.md +42 -27
- data/docs/scalars.md +307 -176
- data/docs/testing.md +473 -220
- data/docs/transports.md +224 -151
- data/docs/upgrading.md +258 -305
- data/examples/README.md +38 -0
- data/examples/countries.rb +39 -0
- data/examples/federation.rb +62 -0
- data/examples/github/generate.rb +20 -0
- data/examples/github/generated/star_mutation.rb +126 -0
- data/examples/github/generated/stargazers_query.rb +232 -0
- data/examples/github/generated/starred_query.rb +151 -0
- data/examples/github/queries/star.graphql +8 -0
- data/examples/github/queries/stargazers.graphql +22 -0
- data/examples/github/queries/starred.graphql +11 -0
- data/examples/github/run.rb +43 -0
- data/examples/github/setup.rb +18 -0
- data/examples/rick_and_morty.rb +57 -0
- data/graph_weaver.gemspec +19 -3
- data/lib/generators/graph_weaver/install_generator.rb +138 -4
- data/lib/graph_weaver/client.rb +69 -11
- data/lib/graph_weaver/codegen/aliases.rb +7 -5
- data/lib/graph_weaver/codegen/emit.rb +98 -29
- data/lib/graph_weaver/codegen/enum_type.rb +2 -1
- data/lib/graph_weaver/codegen/nodes.rb +39 -6
- data/lib/graph_weaver/codegen/registry.rb +175 -0
- data/lib/graph_weaver/codegen/scalar_type.rb +123 -30
- data/lib/graph_weaver/codegen/type_helpers.rb +56 -11
- data/lib/graph_weaver/codegen.rb +406 -195
- data/lib/graph_weaver/coerce.rb +155 -26
- data/lib/graph_weaver/context_seam.rb +54 -0
- data/lib/graph_weaver/errors.rb +284 -46
- data/lib/graph_weaver/federation.rb +129 -27
- data/lib/graph_weaver/graph.rb +315 -0
- data/lib/graph_weaver/hints.rb +100 -24
- data/lib/graph_weaver/in_process.rb +27 -15
- data/lib/graph_weaver/input_struct.rb +119 -32
- data/lib/graph_weaver/internal/endpoint.rb +80 -0
- data/lib/graph_weaver/internal/headers.rb +70 -0
- data/lib/graph_weaver/internal/overrides.rb +67 -5
- data/lib/graph_weaver/internal/planner.rb +45 -15
- data/lib/graph_weaver/internal/refusal.rb +49 -0
- data/lib/graph_weaver/internal/schemas.rb +23 -9
- data/lib/graph_weaver/internal/selection.rb +34 -0
- data/lib/graph_weaver/internal/server_input.rb +251 -0
- data/lib/graph_weaver/internal/test_clients.rb +276 -0
- data/lib/graph_weaver/internal/unused.rb +287 -0
- data/lib/graph_weaver/internal/values.rb +40 -4
- data/lib/graph_weaver/internal.rb +249 -14
- data/lib/graph_weaver/log_subscriber.rb +74 -0
- data/lib/graph_weaver/logging.rb +163 -19
- data/lib/graph_weaver/query_module.rb +44 -3
- data/lib/graph_weaver/railtie.rb +237 -17
- data/lib/graph_weaver/representation.rb +55 -17
- data/lib/graph_weaver/result_struct.rb +90 -0
- data/lib/graph_weaver/retry.rb +45 -13
- data/lib/graph_weaver/rspec.rb +404 -93
- data/lib/graph_weaver/schema_loader.rb +266 -56
- data/lib/graph_weaver/tasks.rb +380 -89
- data/lib/graph_weaver/testing/cassette.rb +34 -10
- data/lib/graph_weaver/testing/endpoint.rb +107 -0
- data/lib/graph_weaver/testing/failure.rb +69 -12
- data/lib/graph_weaver/testing/fake_client.rb +164 -45
- data/lib/graph_weaver/testing/router.rb +64 -13
- data/lib/graph_weaver/testing.rb +200 -58
- data/lib/graph_weaver/transport/faraday.rb +41 -8
- data/lib/graph_weaver/transport/http.rb +48 -6
- data/lib/graph_weaver/transport.rb +134 -27
- data/lib/graph_weaver/version.rb +1 -1
- data/lib/graph_weaver.rb +495 -106
- metadata +71 -3
- data/CHANGELOG.md +0 -2355
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e0ae9c23b2566bfa26c786e07703e4fad357cbd09a29112d3e0c9dd5d3af916c
|
|
4
|
+
data.tar.gz: fb5f4534174e5ba9cb7b9d323af26c2a13456c022f8682bcc3ccae5e512a1c96
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dc780e4f155ea89b9977822a7bb62ed9880d3b7e707fd5046229b1c91c843a9c1ec37c39fb5e2039e71c9095dfb7a0df006347a19ce4544f75f2b3fe13a35a5c
|
|
7
|
+
data.tar.gz: 3dcc86b06e670408ebc18eaaaad7447d5825d1d580b9640ed8860133ba29908eb42553d52da4a2619eb23f072f4999f5aceb622271fafc8d5431fd57a3106ed3
|
data/Gemfile
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
source "https://rubygems.org"
|
|
2
2
|
|
|
3
3
|
gemspec
|
|
4
|
+
|
|
5
|
+
# Mutation testing — not in the gemspec: it is a local quality tool, not a
|
|
6
|
+
# development dependency contributors need to install the gem's suite.
|
|
7
|
+
# Proprietary EULA, free for opensource projects (see `usage:` in mutant.yml).
|
|
8
|
+
group :development do
|
|
9
|
+
gem "mutant", "0.16.3"
|
|
10
|
+
gem "mutant-rspec", "0.16.3"
|
|
11
|
+
end
|
data/Gemfile.lock
CHANGED
|
@@ -1,24 +1,63 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
graph_weaver (0.
|
|
4
|
+
graph_weaver (0.7.1)
|
|
5
5
|
graphql (>= 2.6.7)
|
|
6
6
|
sorbet-runtime
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
+
actionpack (8.1.3.1)
|
|
12
|
+
actionview (= 8.1.3.1)
|
|
13
|
+
activesupport (= 8.1.3.1)
|
|
14
|
+
nokogiri (>= 1.8.5)
|
|
15
|
+
rack (>= 2.2.4)
|
|
16
|
+
rack-session (>= 1.0.1)
|
|
17
|
+
rack-test (>= 0.6.3)
|
|
18
|
+
rails-dom-testing (~> 2.2)
|
|
19
|
+
rails-html-sanitizer (~> 1.6)
|
|
20
|
+
useragent (~> 0.16)
|
|
21
|
+
actionview (8.1.3.1)
|
|
22
|
+
activesupport (= 8.1.3.1)
|
|
23
|
+
builder (~> 3.1)
|
|
24
|
+
erubi (~> 1.11)
|
|
25
|
+
rails-dom-testing (~> 2.2)
|
|
26
|
+
rails-html-sanitizer (~> 1.6)
|
|
27
|
+
activesupport (8.1.3.1)
|
|
28
|
+
base64
|
|
29
|
+
bigdecimal
|
|
30
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
31
|
+
connection_pool (>= 2.2.5)
|
|
32
|
+
drb
|
|
33
|
+
i18n (>= 1.6, < 2)
|
|
34
|
+
json
|
|
35
|
+
logger (>= 1.4.2)
|
|
36
|
+
minitest (>= 5.1)
|
|
37
|
+
securerandom (>= 0.3)
|
|
38
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
39
|
+
uri (>= 0.13.1)
|
|
40
|
+
addressable (2.9.0)
|
|
41
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
11
42
|
apollo-federation (3.10.3)
|
|
12
43
|
google-protobuf (< 5)
|
|
13
44
|
graphql
|
|
45
|
+
ast (2.4.3)
|
|
14
46
|
base64 (0.3.0)
|
|
15
47
|
benchmark (0.5.0)
|
|
16
48
|
bigdecimal (4.1.2)
|
|
49
|
+
builder (3.3.0)
|
|
17
50
|
concurrent-ruby (1.3.7)
|
|
51
|
+
connection_pool (3.0.2)
|
|
52
|
+
crack (1.0.1)
|
|
53
|
+
bigdecimal
|
|
54
|
+
rexml
|
|
55
|
+
crass (1.0.7)
|
|
18
56
|
debug (1.11.1)
|
|
19
57
|
irb (~> 1.10)
|
|
20
58
|
reline (>= 0.3.8)
|
|
21
59
|
diff-lcs (1.6.2)
|
|
60
|
+
drb (2.2.3)
|
|
22
61
|
erb (6.0.4)
|
|
23
62
|
erubi (1.13.1)
|
|
24
63
|
faker (3.8.0)
|
|
@@ -46,6 +85,7 @@ GEM
|
|
|
46
85
|
base64
|
|
47
86
|
fiber-storage
|
|
48
87
|
logger
|
|
88
|
+
hashdiff (1.2.1)
|
|
49
89
|
i18n (1.15.2)
|
|
50
90
|
concurrent-ruby (~> 1.0)
|
|
51
91
|
io-console (0.8.2)
|
|
@@ -56,14 +96,68 @@ GEM
|
|
|
56
96
|
reline (>= 0.4.2)
|
|
57
97
|
json (2.21.2)
|
|
58
98
|
logger (1.7.0)
|
|
99
|
+
loofah (2.25.2)
|
|
100
|
+
crass (~> 1.0.2)
|
|
101
|
+
nokogiri (>= 1.12.0)
|
|
102
|
+
minitest (6.0.6)
|
|
103
|
+
drb (~> 2.0)
|
|
104
|
+
prism (~> 1.5)
|
|
105
|
+
mutant (0.16.3)
|
|
106
|
+
diff-lcs (>= 1.6, < 3)
|
|
107
|
+
irb (~> 1.15)
|
|
108
|
+
parser (~> 3.3.10)
|
|
109
|
+
regexp_parser (~> 2.10)
|
|
110
|
+
securerandom (>= 0.3)
|
|
111
|
+
sorbet-runtime (~> 0.6.0)
|
|
112
|
+
unparser (>= 0.8.2, < 0.10)
|
|
113
|
+
mutant-rspec (0.16.3)
|
|
114
|
+
mutant (= 0.16.3)
|
|
115
|
+
rspec-core (>= 3.8.0, < 5.0.0)
|
|
59
116
|
net-http (0.9.1)
|
|
60
117
|
uri (>= 0.11.1)
|
|
61
118
|
netrc (0.11.0)
|
|
119
|
+
nokogiri (1.19.4-aarch64-linux-gnu)
|
|
120
|
+
racc (~> 1.4)
|
|
121
|
+
nokogiri (1.19.4-arm64-darwin)
|
|
122
|
+
racc (~> 1.4)
|
|
123
|
+
nokogiri (1.19.4-x86_64-darwin)
|
|
124
|
+
racc (~> 1.4)
|
|
125
|
+
nokogiri (1.19.4-x86_64-linux-gnu)
|
|
126
|
+
racc (~> 1.4)
|
|
62
127
|
parallel (2.1.0)
|
|
128
|
+
parser (3.3.12.0)
|
|
129
|
+
ast (~> 2.4.1)
|
|
130
|
+
racc
|
|
63
131
|
pp (0.6.4)
|
|
64
132
|
prettyprint
|
|
65
133
|
prettyprint (0.2.0)
|
|
66
134
|
prism (1.9.0)
|
|
135
|
+
public_suffix (7.0.5)
|
|
136
|
+
racc (1.8.1)
|
|
137
|
+
rack (3.2.7)
|
|
138
|
+
rack-session (2.1.2)
|
|
139
|
+
base64 (>= 0.1.0)
|
|
140
|
+
rack (>= 3.0.0)
|
|
141
|
+
rack-test (2.2.0)
|
|
142
|
+
rack (>= 1.3)
|
|
143
|
+
rackup (2.3.1)
|
|
144
|
+
rack (>= 3)
|
|
145
|
+
rails-dom-testing (2.3.0)
|
|
146
|
+
activesupport (>= 5.0.0)
|
|
147
|
+
minitest
|
|
148
|
+
nokogiri (>= 1.6)
|
|
149
|
+
rails-html-sanitizer (1.7.1)
|
|
150
|
+
loofah (~> 2.25, >= 2.25.2)
|
|
151
|
+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
152
|
+
railties (8.1.3.1)
|
|
153
|
+
actionpack (= 8.1.3.1)
|
|
154
|
+
activesupport (= 8.1.3.1)
|
|
155
|
+
irb (~> 1.13)
|
|
156
|
+
rackup (>= 1.0.0)
|
|
157
|
+
rake (>= 12.2)
|
|
158
|
+
thor (~> 1.0, >= 1.2.2)
|
|
159
|
+
tsort (>= 0.2)
|
|
160
|
+
zeitwerk (~> 2.6)
|
|
67
161
|
rake (13.4.2)
|
|
68
162
|
rbi (0.3.14)
|
|
69
163
|
prism (~> 1.0)
|
|
@@ -78,6 +172,7 @@ GEM
|
|
|
78
172
|
rbs (>= 4.0.0)
|
|
79
173
|
tsort
|
|
80
174
|
redcarpet (3.6.1)
|
|
175
|
+
regexp_parser (2.12.0)
|
|
81
176
|
reline (0.6.3)
|
|
82
177
|
io-console (~> 0.5)
|
|
83
178
|
require-hooks (0.4.0)
|
|
@@ -99,6 +194,7 @@ GEM
|
|
|
99
194
|
rubydex (0.2.7-arm64-darwin)
|
|
100
195
|
rubydex (0.2.7-x86_64-darwin)
|
|
101
196
|
rubydex (0.2.7-x86_64-linux)
|
|
197
|
+
securerandom (0.4.1)
|
|
102
198
|
simplecov (1.2.0)
|
|
103
199
|
sorbet (0.6.13485)
|
|
104
200
|
sorbet-static (= 0.6.13485)
|
|
@@ -131,9 +227,21 @@ GEM
|
|
|
131
227
|
tsort
|
|
132
228
|
thor (1.5.0)
|
|
133
229
|
tsort (0.2.0)
|
|
230
|
+
tzinfo (2.0.6)
|
|
231
|
+
concurrent-ruby (~> 1.0)
|
|
232
|
+
unparser (0.9.0)
|
|
233
|
+
diff-lcs (>= 1.6, < 3)
|
|
234
|
+
parser (>= 3.3.0)
|
|
235
|
+
prism (>= 1.5.1)
|
|
134
236
|
uri (1.1.1)
|
|
237
|
+
useragent (0.16.11)
|
|
238
|
+
webmock (3.26.4)
|
|
239
|
+
addressable (>= 2.8.0)
|
|
240
|
+
crack (>= 0.3.2)
|
|
241
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
|
135
242
|
webrick (1.9.2)
|
|
136
|
-
yard (0.9.
|
|
243
|
+
yard (0.9.45)
|
|
244
|
+
zeitwerk (2.8.3)
|
|
137
245
|
|
|
138
246
|
PLATFORMS
|
|
139
247
|
aarch64-linux
|
|
@@ -149,23 +257,38 @@ DEPENDENCIES
|
|
|
149
257
|
faker
|
|
150
258
|
faraday
|
|
151
259
|
graph_weaver!
|
|
260
|
+
mutant (= 0.16.3)
|
|
261
|
+
mutant-rspec (= 0.16.3)
|
|
262
|
+
rack
|
|
263
|
+
railties
|
|
152
264
|
rake
|
|
153
265
|
redcarpet
|
|
154
266
|
rspec
|
|
155
267
|
simplecov
|
|
156
268
|
sorbet
|
|
157
269
|
tapioca
|
|
270
|
+
webmock
|
|
158
271
|
webrick
|
|
159
272
|
yard
|
|
160
273
|
|
|
161
274
|
CHECKSUMS
|
|
275
|
+
actionpack (8.1.3.1) sha256=974cb7154548e81f470b1b0f247b99cb38e87825899dca58610596e2817723d0
|
|
276
|
+
actionview (8.1.3.1) sha256=2da68b8414c47b43bfbed1ce69c5afe1c04f78c267aacb5660a4cab5ca12cfb6
|
|
277
|
+
activesupport (8.1.3.1) sha256=85458765f25ea48b9019c46b6bb3fa5683197bf4280d9f06710a6e8d7a831376
|
|
278
|
+
addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af
|
|
162
279
|
apollo-federation (3.10.3) sha256=61e6d8e1fd695ee45bab5d84f86f586d99c296ad77a86c6f1e7b964ac17be3d7
|
|
280
|
+
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
|
163
281
|
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
164
282
|
benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c
|
|
165
283
|
bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd
|
|
284
|
+
builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f
|
|
166
285
|
concurrent-ruby (1.3.7) sha256=4412caec3a5ea2e5fdc52076724c071a81f2c0593d83b2ac8cbb8ca63b3151b0
|
|
286
|
+
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
|
|
287
|
+
crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e
|
|
288
|
+
crass (1.0.7) sha256=94868719948664c89ddcaf0a37c65048413dfcb1c869470a5f7a7ceb5390b295
|
|
167
289
|
debug (1.11.1) sha256=2e0b0ac6119f2207a6f8ac7d4a73ca8eb4e440f64da0a3136c30343146e952b6
|
|
168
290
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
291
|
+
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
169
292
|
erb (6.0.4) sha256=38e3803694be357fe2bfe312487c74beaf9fb4e5beb3e22498952fe1645b95d9
|
|
170
293
|
erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
|
|
171
294
|
faker (3.8.0) sha256=c147b308df73a90f27a4fc84f18d4c22ef0ad9c2a64b2b61c86fd0ca71753efc
|
|
@@ -176,24 +299,44 @@ CHECKSUMS
|
|
|
176
299
|
google-protobuf (4.35.1-arm64-darwin) sha256=d9c957df04fa89c749fa9a72a7b383eb4296efc9b2303dc6fd6fbe39c698ad6b
|
|
177
300
|
google-protobuf (4.35.1-x86_64-darwin) sha256=66b62b4df00931018a692806df66393efa960d6d2b7da69735187249f950d3ee
|
|
178
301
|
google-protobuf (4.35.1-x86_64-linux-gnu) sha256=c786439087512a3fbd199e9897d265b855f951d4027e218ea55e858d45969edd
|
|
179
|
-
graph_weaver (0.
|
|
302
|
+
graph_weaver (0.7.1)
|
|
180
303
|
graphql (2.6.10) sha256=9b7c8633767f516ff9d48a8d6305b2a00a2101c82aa871b92e69086944f9f83e
|
|
304
|
+
hashdiff (1.2.1) sha256=9c079dbc513dfc8833ab59c0c2d8f230fa28499cc5efb4b8dd276cf931457cd1
|
|
181
305
|
i18n (1.15.2) sha256=00f9eb62412fe593b2a65a97daa75300d37abb8f7202ec748e94b6d46a9dd1b5
|
|
182
306
|
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
|
|
183
307
|
irb (1.18.0) sha256=de9454a0703a54704b9811a5ef31a60c86949fbf4013fcf244fabc7c775248e3
|
|
184
308
|
json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a
|
|
185
309
|
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
310
|
+
loofah (2.25.2) sha256=2007f746959ac65552456e04b433e83deb22759ab38c838b4445c70e43425918
|
|
311
|
+
minitest (6.0.6) sha256=153ea36d1d987a62942382b61075745042a2b3123b1cd48f4c3675af9cc7d6f1
|
|
312
|
+
mutant (0.16.3) sha256=7e10fb09b80a78d82f8e38283fc1e4d562cbb1392451e2a21611ea2bc44b5023
|
|
313
|
+
mutant-rspec (0.16.3) sha256=006ee9640800f205278604bb2160ca4b1d0013464fb216a48b7c09571a1fc547
|
|
186
314
|
net-http (0.9.1) sha256=25ba0b67c63e89df626ed8fac771d0ad24ad151a858af2cc8e6a716ca4336996
|
|
187
315
|
netrc (0.11.0) sha256=de1ce33da8c99ab1d97871726cba75151113f117146becbe45aa85cb3dabee3f
|
|
316
|
+
nokogiri (1.19.4-aarch64-linux-gnu) sha256=1269fb644a6de405057a53dd5c762b1209b43ca7424f839454d3dbc677c31a8f
|
|
317
|
+
nokogiri (1.19.4-arm64-darwin) sha256=a46db9853286e6597b36ebc6953817d15acf3a299583eb3f89fdc6f91dd63527
|
|
318
|
+
nokogiri (1.19.4-x86_64-darwin) sha256=7fd17057d3e1f00e9954a74b3cd76595d3d4a5ef233b7ed9599047c204f70551
|
|
319
|
+
nokogiri (1.19.4-x86_64-linux-gnu) sha256=379fae440b28915e3f19d752ce2dcf8465ed2b2fbefd2a7ca0dd497bc981a06a
|
|
188
320
|
parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356
|
|
321
|
+
parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828
|
|
189
322
|
pp (0.6.4) sha256=dfcb0fce700c41456265922884f9fe195d7fbb0674a3578e6c0f69588e82b570
|
|
190
323
|
prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
|
|
191
324
|
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
|
|
325
|
+
public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
|
|
326
|
+
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
327
|
+
rack (3.2.7) sha256=93e13e1c24f93556671d85d2d79fa228c3485815c50d7e2f265b5330c6528fb7
|
|
328
|
+
rack-session (2.1.2) sha256=595434f8c0c3473ae7d7ac56ecda6cc6dfd9d37c0b2b5255330aa1576967ffe8
|
|
329
|
+
rack-test (2.2.0) sha256=005a36692c306ac0b4a9350355ee080fd09ddef1148a5f8b2ac636c720f5c463
|
|
330
|
+
rackup (2.3.1) sha256=6c79c26753778e90983761d677a48937ee3192b3ffef6bc963c0950f94688868
|
|
331
|
+
rails-dom-testing (2.3.0) sha256=8acc7953a7b911ca44588bf08737bc16719f431a1cc3091a292bca7317925c1d
|
|
332
|
+
rails-html-sanitizer (1.7.1) sha256=e797a7c9b01e567307e317c576b49ab4168017e63eea4dba9ce3cb587e2f22c2
|
|
333
|
+
railties (8.1.3.1) sha256=2388a232579a00cefea4487de66c8553c3408c1300abdc6cf1799d86ffb04487
|
|
192
334
|
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
|
|
193
335
|
rbi (0.3.14) sha256=932ed904adbb5ca645c285c8b36da1b7ff6321ec1870d187d6325248cb637658
|
|
194
336
|
rbs (4.0.3) sha256=5a7bf70e2628549d9a1f44eae447b2cfe55968a9c60cfff52693a4bdcc020e14
|
|
195
337
|
rdoc (8.0.0) sha256=03bf8c08a9639658855a0cfd77c0abca8325c227693f7f33f82957811348c469
|
|
196
338
|
redcarpet (3.6.1) sha256=d444910e6aa55480c6bcdc0cdb057626e8a32c054c29e793fa642ba2f155f445
|
|
339
|
+
regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb
|
|
197
340
|
reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
|
|
198
341
|
require-hooks (0.4.0) sha256=005f4c6435b4edae73e358cdbaba48370a4121f9ce893d5d2a3c66fce855677d
|
|
199
342
|
rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
|
|
@@ -206,6 +349,7 @@ CHECKSUMS
|
|
|
206
349
|
rubydex (0.2.7-arm64-darwin) sha256=f0d28bbf4153568be79b671642424750053e0bea971b60ddf5cec19bf4563990
|
|
207
350
|
rubydex (0.2.7-x86_64-darwin) sha256=b002b259d118ac69de44470eff1597143318402c45630c47371f9542631447dc
|
|
208
351
|
rubydex (0.2.7-x86_64-linux) sha256=dacfade9fa42ce4469618da6dac07e69d5f3ac6a313b4caced5234c8f052419a
|
|
352
|
+
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
|
|
209
353
|
simplecov (1.2.0) sha256=ea6acd05eece5a41990e2a5171c57d15700d329326c7666c85ee8c6a0dd0977e
|
|
210
354
|
sorbet (0.6.13485) sha256=b885d6a2fcde57bc46c3cdd597b9014b82619dee0f811a6fdf36f57c8f82c380
|
|
211
355
|
sorbet-runtime (0.6.13485) sha256=2982504e662eb424e515b3aa1c8139070451a014b6c1af2302250ed82495b4cc
|
|
@@ -217,9 +361,14 @@ CHECKSUMS
|
|
|
217
361
|
tapioca (0.19.2) sha256=938731b07811aee8d23871b1aee8861d464fbaf2cfffbf79a62b0c869a5120ec
|
|
218
362
|
thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
|
|
219
363
|
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
|
|
364
|
+
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
|
|
365
|
+
unparser (0.9.0) sha256=4331f174a73a23b69250b13d47da3794ed1449711ee0f9ed8947dc020ba76067
|
|
220
366
|
uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6
|
|
367
|
+
useragent (0.16.11) sha256=700e6413ad4bb954bb63547fa098dddf7b0ebe75b40cc6f93b8d54255b173844
|
|
368
|
+
webmock (3.26.4) sha256=8d8da206d217ebe6968cfb09c77f4533c23074e1432bad865f3994eacbaad50d
|
|
221
369
|
webrick (1.9.2) sha256=beb4a15fc474defed24a3bda4ffd88a490d517c9e4e6118c3edce59e45864131
|
|
222
|
-
yard (0.9.
|
|
370
|
+
yard (0.9.45) sha256=52e211493f7cb8a3ebf7e104a25a1e73937a3103092545d34cb88fafebb3dc51
|
|
371
|
+
zeitwerk (2.8.3) sha256=2c85125a8467ce069e20123d1e709a08955c9d29c118c25b46b7b7fafdbb92e5
|
|
223
372
|
|
|
224
373
|
BUNDLED WITH
|
|
225
374
|
4.0.10
|
data/README.md
CHANGED
|
@@ -39,17 +39,15 @@ result.person&.nmae
|
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
`person` is `T.nilable` because the schema says the field is nullable — the `&.`
|
|
42
|
-
isn't defensive, it's the schema talking.
|
|
43
|
-
|
|
42
|
+
isn't defensive, it's the schema talking. Static Sorbet is optional:
|
|
43
|
+
`sorbet-runtime` is the only Sorbet gem this one needs, so in an app that doesn't
|
|
44
|
+
run `srb tc` the same typo surfaces as a `NoMethodError` the first time the line
|
|
45
|
+
runs, rather than in CI — [Sorbet, with or
|
|
46
|
+
without](docs/getting_started.md#sorbet-with-or-without).
|
|
44
47
|
|
|
45
48
|
## Start here
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
# Gemfile
|
|
49
|
-
gem "graph_weaver"
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
In Rails, setup is one command:
|
|
50
|
+
Add `gem "graph_weaver"` to your Gemfile. In Rails, the rest is one command:
|
|
53
51
|
|
|
54
52
|
```sh
|
|
55
53
|
rails g graph_weaver:install https://api.example.com/graphql
|
|
@@ -59,42 +57,25 @@ which writes the initializer, the `app/graphql` layout, the editor config and th
|
|
|
59
57
|
schema dump. **[Getting started](docs/getting_started.md)** walks the production
|
|
60
58
|
setup end to end.
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
anything holding a schema parses, and the module runs on what parsed it:
|
|
68
|
-
|
|
69
|
-
```ruby
|
|
70
|
-
api = GraphWeaver.new("https://countries.trevorblades.com/")
|
|
71
|
-
CountryQuery = api.parse("queries/country.graphql") # a path or a raw string
|
|
72
|
-
CountryQuery.execute!(code: "JP").country&.capital # => "Tokyo"
|
|
73
|
-
|
|
74
|
-
api.run!("query { continents { name } }").continents # or no module at all
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
The **[examples](examples/)** run that path for real, smallest first: a public API
|
|
78
|
-
in 30 lines, a paginated search, the production path against GitHub, and the
|
|
60
|
+
Or skip the build step and poke at an API from a console: `GraphWeaver.new(url)`
|
|
61
|
+
parses a query into a module on the spot, and `run!` executes one without a module
|
|
62
|
+
at all — [against a real API](docs/real_world.md). The
|
|
63
|
+
**[examples](examples/)** run that path for real, smallest first: a public API in
|
|
64
|
+
30 lines, a paginated search, the production path against GitHub, and the
|
|
79
65
|
federated graph below.
|
|
80
66
|
|
|
81
67
|
## Precise types are expensive to fake, so it fakes them for you
|
|
82
68
|
|
|
83
69
|
Generation makes result types exact, which makes them tedious to build by hand —
|
|
84
70
|
and most generators stop there and leave you the fixtures. GraphWeaver ships the
|
|
85
|
-
fakes. One line in the spec helper
|
|
86
|
-
|
|
87
|
-
```ruby
|
|
88
|
-
require "graph_weaver/rspec"
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
then one tag says what an example runs against:
|
|
71
|
+
fakes. One line in the spec helper (`require "graph_weaver/rspec"`), then one tag
|
|
72
|
+
says what an example runs against:
|
|
92
73
|
|
|
93
74
|
```ruby
|
|
94
75
|
it "shows the profile", graphql: :fake do
|
|
95
76
|
person = PersonQuery.execute!(id: "1").person
|
|
96
77
|
|
|
97
|
-
person.name # => "Shakita Stark"
|
|
78
|
+
person.name # => "Shakita Stark" with faker installed; "name-1" without
|
|
98
79
|
person.birthday # => #<Date: 2024-12-16> custom scalars included
|
|
99
80
|
person.pets.size # => 2
|
|
100
81
|
end
|
|
@@ -104,68 +85,51 @@ No fixture, no stub, no HTTP — and the values are seeded from rspec's own seed
|
|
|
104
85
|
`--seed 4242` hands back that same person and a failure reproduces.
|
|
105
86
|
|
|
106
87
|
Random data answers "does this render". When the example is *about* the data, pin
|
|
107
|
-
the fields it's about
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
person.name # => "Ada"
|
|
113
|
-
person.pets.first.name # => "Shelby" — the second pet is still fabricated
|
|
114
|
-
person.pets.size # => 2 — a pinned list is as long as you write it
|
|
115
|
-
```
|
|
88
|
+
the fields it's about — `graphql_fake("Person.name" => "Ada")`, or a whole type
|
|
89
|
+
off your factory — and everything else in the selection stays fabricated. Pins are
|
|
90
|
+
schema names, checked and spellchecked, so a typo raises rather than leaving the
|
|
91
|
+
example green against random data.
|
|
116
92
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
federated graph. Field-level failure simulation and record/replay cassettes with
|
|
123
|
-
anonymization are in [testing](docs/testing.md).
|
|
93
|
+
The tag also picks a *real* client when you want one: `:in_process` runs your
|
|
94
|
+
resolvers, `:router` runs them across a federated graph, and `:wire` serves either
|
|
95
|
+
at your own endpoint, so the transport you ship runs too. Field-level failure
|
|
96
|
+
simulation and record/replay cassettes with anonymization are in
|
|
97
|
+
[testing](docs/testing.md).
|
|
124
98
|
|
|
125
99
|
## Federation without a gateway
|
|
126
100
|
|
|
127
101
|
When your app is both a GraphQL client and a subgraph, the local router plans a
|
|
128
102
|
query across the composed supergraph and runs your **real resolvers** over the
|
|
129
|
-
boundary — no gateway process, no node, no sockets.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
fetches:
|
|
135
|
-
→ accounts root fields
|
|
136
|
-
→ reviews _entities × 1 User
|
|
137
|
-
→ products _entities × 2 Product
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
The trace is the query plan: every node at a level goes in one `_entities` call,
|
|
141
|
-
so two products cost one fetch. Anything it can't answer *faithfully* it refuses
|
|
142
|
-
at plan time rather than guessing — the example prints one of those too, naming
|
|
143
|
-
the coordinate that stopped it and what to rename. And it's diffed against a real
|
|
144
|
-
`@apollo/gateway` over the same supergraph:
|
|
145
|
-
currently 73 queries identical, 2 refused, 0 wrong
|
|
103
|
+
boundary — no gateway process, no node, no sockets. It prints the plan as it
|
|
104
|
+
fetches, batching every node at a level into one `_entities` call, and anything it
|
|
105
|
+
can't answer *faithfully* it refuses at plan time rather than guessing, naming the
|
|
106
|
+
coordinate that stopped it. It is diffed against a real `@apollo/gateway` over the
|
|
107
|
+
same supergraph: currently 73 queries identical, 2 refused, 0 wrong
|
|
146
108
|
([`spec/integration/router_parity_spec.rb`](spec/integration/router_parity_spec.rb)).
|
|
147
|
-
|
|
109
|
+
[`examples/federation.rb`](examples/federation.rb) runs the whole thing with no
|
|
110
|
+
network; see [federation](docs/federation.md).
|
|
148
111
|
|
|
149
112
|
## The schema keeps itself honest
|
|
150
113
|
|
|
151
114
|
The lifecycle is rake tasks, not a CI pipeline you assemble yourself:
|
|
152
115
|
`schema:refresh` re-introspects the committed dump, `schema:diff` names what
|
|
153
|
-
changed when
|
|
154
|
-
drift broke and where,
|
|
155
|
-
|
|
156
|
-
|
|
116
|
+
changed when whatever that dump came from has moved past it, `queries:check` names
|
|
117
|
+
the queries that drift broke and where, `unused` names the selections your app
|
|
118
|
+
stopped reading, and `verify` fails when the checked-in Ruby is stale. Generation
|
|
119
|
+
is deterministic — same schema and queries, byte-identical files — so regenerating
|
|
120
|
+
never shows a diff you didn't earn. See
|
|
157
121
|
[getting started](docs/getting_started.md#5-verify-in-ci).
|
|
158
122
|
|
|
159
|
-
**Any release can change what codegen emits**, patch releases included
|
|
160
|
-
|
|
161
|
-
|
|
123
|
+
**Any release can change what codegen emits**, patch releases included. So `rake
|
|
124
|
+
graph_weaver:generate` is part of every upgrade, and `verify` is what tells you
|
|
125
|
+
when you've skipped it.
|
|
162
126
|
|
|
163
127
|
#### Also in the box
|
|
164
128
|
|
|
165
|
-
- **
|
|
166
|
-
- **Fragments
|
|
167
|
-
- **Any transport
|
|
168
|
-
- **Structured errors
|
|
129
|
+
- **Typed variable kwargs** — enums as `T::Enum`s, input objects as `T::Struct`s, required vs optional falling out of nullability and defaults
|
|
130
|
+
- **Fragments**, **unions and interfaces** (member structs, `__typename` dispatch), `@skip`/`@include` nullability
|
|
131
|
+
- **Any transport** — in-process, a zero-dependency HTTP client, or Faraday with your own middleware, plus a composable `Retry`
|
|
132
|
+
- **Structured errors** — an envelope that keeps partial data and extensions, a hierarchy split by failure site, field-level reports, stale-schema detection
|
|
169
133
|
|
|
170
134
|
#### Dig deeper
|
|
171
135
|
|
|
@@ -175,12 +139,14 @@ upgrade, and `verify` is what tells you when you've skipped it.
|
|
|
175
139
|
- **[Federation](docs/federation.md)** — supergraph vs API schema, the local router, what it refuses
|
|
176
140
|
- **[Transports](docs/transports.md)** — the execute contract, Faraday, retries and backoff
|
|
177
141
|
- **[Errors](docs/errors.md)** — the Response envelope, the error hierarchy, field-level reports
|
|
142
|
+
- **[Translating input errors](docs/i18n.md)** — stable keys and data for bad input, on either side of the wire
|
|
178
143
|
- **[Custom scalars](docs/scalars.md)** — what's registered already, codec inference, input coercion
|
|
179
144
|
- **[Cassettes](docs/cassettes.md)** — capture and replay real responses, anonymized
|
|
180
145
|
- **[Editor support](docs/editors.md)** — five lines of YAML for schema autocomplete in `.graphql` files, no JS project
|
|
181
146
|
- **[Against a real API](docs/real_world.md)** — introspecting a live endpoint, GitHub end to end
|
|
182
147
|
- **[Logging](docs/logging.md)** — point `GraphWeaver.logger` at any Logger
|
|
183
|
-
- **[Upgrading](docs/upgrading.md)** — regenerate on every bump, and what
|
|
148
|
+
- **[Upgrading](docs/upgrading.md)** — regenerate on every bump, and what each release moved
|
|
149
|
+
- **[Alternatives](docs/alternatives.md)** — graphql-client, graphlient, artemis, hand-rolled: what each is good at, and where this one loses
|
|
184
150
|
|
|
185
151
|
----
|
|
186
152
|
## Development
|