@graphql-hive/federation-gateway-audit 0.0.0 → 0.0.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.
Files changed (395) hide show
  1. package/.github/workflows/ci.yaml +4 -4
  2. package/.github/workflows/release.yml +3 -3
  3. package/CHANGELOG.md +10 -0
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/package.json +8 -4
  7. package/src/cli.ts +700 -0
  8. package/src/env.ts +13 -0
  9. package/src/index.ts +262 -0
  10. package/src/subgraph.ts +113 -0
  11. package/src/summary.ts +237 -0
  12. package/src/supergraph.ts +195 -0
  13. package/src/test-suites/abstract-types/agency.subgraph.ts +43 -0
  14. package/src/test-suites/abstract-types/books.subgraph.ts +47 -0
  15. package/src/test-suites/abstract-types/data.ts +120 -0
  16. package/src/test-suites/abstract-types/index.ts +23 -0
  17. package/src/test-suites/abstract-types/inventory.subgraph.ts +142 -0
  18. package/src/test-suites/abstract-types/magazines.subgraph.ts +47 -0
  19. package/src/test-suites/abstract-types/products.subgraph.ts +204 -0
  20. package/src/test-suites/abstract-types/reviews.subgraph.ts +159 -0
  21. package/src/test-suites/abstract-types/test.ts +1084 -0
  22. package/src/test-suites/abstract-types/users.subgraph.ts +31 -0
  23. package/src/test-suites/child-type-mismatch/a.subgraph.ts +27 -0
  24. package/src/test-suites/child-type-mismatch/b.subgraph.ts +51 -0
  25. package/src/test-suites/child-type-mismatch/data.ts +6 -0
  26. package/src/test-suites/child-type-mismatch/index.ts +6 -0
  27. package/{dist/index-Ca0FeU7u.js → src/test-suites/child-type-mismatch/test.ts} +79 -178
  28. package/src/test-suites/circular-reference-interface/a.subgraph.ts +55 -0
  29. package/src/test-suites/circular-reference-interface/b.subgraph.ts +35 -0
  30. package/src/test-suites/circular-reference-interface/data.ts +17 -0
  31. package/src/test-suites/circular-reference-interface/index.ts +6 -0
  32. package/src/test-suites/circular-reference-interface/test.ts +78 -0
  33. package/src/test-suites/complex-entity-call/data.ts +27 -0
  34. package/src/test-suites/complex-entity-call/index.ts +12 -0
  35. package/src/test-suites/complex-entity-call/link.subgraph.ts +36 -0
  36. package/src/test-suites/complex-entity-call/list.subgraph.ts +44 -0
  37. package/src/test-suites/complex-entity-call/price.subgraph.ts +107 -0
  38. package/src/test-suites/complex-entity-call/products.subgraph.ts +65 -0
  39. package/src/test-suites/complex-entity-call/test.ts +74 -0
  40. package/src/test-suites/corrupted-supergraph-node-id/a.subgraph.ts +112 -0
  41. package/src/test-suites/corrupted-supergraph-node-id/b.subgraph.ts +113 -0
  42. package/src/test-suites/corrupted-supergraph-node-id/data.ts +16 -0
  43. package/src/test-suites/corrupted-supergraph-node-id/index.ts +6 -0
  44. package/src/test-suites/corrupted-supergraph-node-id/test.ts +223 -0
  45. package/src/test-suites/enum-intersection/a.subgraph.ts +46 -0
  46. package/src/test-suites/enum-intersection/b.subgraph.ts +51 -0
  47. package/src/test-suites/enum-intersection/data.ts +10 -0
  48. package/src/test-suites/enum-intersection/index.ts +6 -0
  49. package/src/test-suites/enum-intersection/test.ts +108 -0
  50. package/src/test-suites/fed1-external-extends/a.subgraph.ts +51 -0
  51. package/src/test-suites/fed1-external-extends/b.subgraph.ts +48 -0
  52. package/src/test-suites/fed1-external-extends/data.ts +14 -0
  53. package/src/test-suites/fed1-external-extends/index.ts +6 -0
  54. package/src/test-suites/fed1-external-extends/test.ts +90 -0
  55. package/src/test-suites/fed1-external-extends-resolvable/a.subgraph.ts +40 -0
  56. package/src/test-suites/fed1-external-extends-resolvable/b.subgraph.ts +52 -0
  57. package/src/test-suites/fed1-external-extends-resolvable/data.ts +9 -0
  58. package/src/test-suites/fed1-external-extends-resolvable/index.ts +6 -0
  59. package/src/test-suites/fed1-external-extends-resolvable/test.ts +28 -0
  60. package/src/test-suites/fed1-external-extension/a.subgraph.ts +51 -0
  61. package/src/test-suites/fed1-external-extension/b.subgraph.ts +48 -0
  62. package/src/test-suites/fed1-external-extension/data.ts +14 -0
  63. package/src/test-suites/fed1-external-extension/index.ts +6 -0
  64. package/src/test-suites/fed1-external-extension/test.ts +90 -0
  65. package/src/test-suites/fed2-external-extends/a.subgraph.ts +57 -0
  66. package/src/test-suites/fed2-external-extends/b.subgraph.ts +54 -0
  67. package/src/test-suites/fed2-external-extends/data.ts +14 -0
  68. package/src/test-suites/fed2-external-extends/index.ts +6 -0
  69. package/src/test-suites/fed2-external-extends/test.ts +90 -0
  70. package/src/test-suites/fed2-external-extension/a.subgraph.ts +57 -0
  71. package/src/test-suites/fed2-external-extension/b.subgraph.ts +54 -0
  72. package/src/test-suites/fed2-external-extension/data.ts +14 -0
  73. package/src/test-suites/fed2-external-extension/index.ts +6 -0
  74. package/src/test-suites/fed2-external-extension/test.ts +90 -0
  75. package/src/test-suites/include-skip/a.subgraph.ts +42 -0
  76. package/src/test-suites/include-skip/b.subgraph.ts +47 -0
  77. package/src/test-suites/include-skip/c.subgraph.ts +65 -0
  78. package/src/test-suites/include-skip/data.ts +6 -0
  79. package/src/test-suites/include-skip/index.ts +7 -0
  80. package/src/test-suites/include-skip/test.ts +74 -0
  81. package/src/test-suites/input-object-intersection/a.subgraph.ts +47 -0
  82. package/src/test-suites/input-object-intersection/b.subgraph.ts +51 -0
  83. package/src/test-suites/input-object-intersection/data.ts +10 -0
  84. package/src/test-suites/input-object-intersection/index.ts +6 -0
  85. package/src/test-suites/input-object-intersection/test.ts +49 -0
  86. package/src/test-suites/interface-object-indirect-extension/author.subgraph.ts +39 -0
  87. package/src/test-suites/interface-object-indirect-extension/index.ts +11 -0
  88. package/src/test-suites/interface-object-indirect-extension/media.subgraph.ts +63 -0
  89. package/src/test-suites/interface-object-indirect-extension/playlist.subgraph.ts +48 -0
  90. package/src/test-suites/interface-object-indirect-extension/test.ts +57 -0
  91. package/src/test-suites/interface-object-with-requires/a.subgraph.ts +68 -0
  92. package/src/test-suites/interface-object-with-requires/b.subgraph.ts +61 -0
  93. package/src/test-suites/interface-object-with-requires/data.ts +14 -0
  94. package/src/test-suites/interface-object-with-requires/index.ts +6 -0
  95. package/src/test-suites/interface-object-with-requires/test.ts +206 -0
  96. package/src/test-suites/keys-mashup/a.subgraph.ts +46 -0
  97. package/src/test-suites/keys-mashup/b.subgraph.ts +118 -0
  98. package/src/test-suites/keys-mashup/data.ts +43 -0
  99. package/src/test-suites/keys-mashup/index.ts +6 -0
  100. package/src/test-suites/keys-mashup/test.ts +32 -0
  101. package/src/test-suites/mutations/a.subgraph.ts +136 -0
  102. package/src/test-suites/mutations/b.subgraph.ts +107 -0
  103. package/src/test-suites/mutations/c.subgraph.ts +26 -0
  104. package/src/test-suites/mutations/data.ts +91 -0
  105. package/src/test-suites/mutations/index.ts +7 -0
  106. package/src/test-suites/mutations/test.ts +94 -0
  107. package/src/test-suites/mysterious-external/data.ts +12 -0
  108. package/src/test-suites/mysterious-external/index.ts +6 -0
  109. package/src/test-suites/mysterious-external/price.subgraph.ts +55 -0
  110. package/src/test-suites/mysterious-external/product.subgraph.ts +45 -0
  111. package/src/test-suites/mysterious-external/test.ts +51 -0
  112. package/src/test-suites/nested-provides/all-products.subgraph.ts +37 -0
  113. package/src/test-suites/nested-provides/category.subgraph.ts +104 -0
  114. package/src/test-suites/nested-provides/data.ts +28 -0
  115. package/src/test-suites/nested-provides/index.ts +11 -0
  116. package/src/test-suites/nested-provides/subcategories.subgraph.ts +89 -0
  117. package/src/test-suites/nested-provides/test.ts +122 -0
  118. package/src/test-suites/node/data.ts +23 -0
  119. package/src/test-suites/node/index.ts +7 -0
  120. package/src/test-suites/node/node-two.ts +49 -0
  121. package/src/test-suites/node/node.subgraph.ts +68 -0
  122. package/src/test-suites/node/test.ts +28 -0
  123. package/src/test-suites/node/types.subgraph.ts +58 -0
  124. package/src/test-suites/non-resolvable-interface-object/a.subgraph.ts +40 -0
  125. package/src/test-suites/non-resolvable-interface-object/b.subgraph.ts +55 -0
  126. package/src/test-suites/non-resolvable-interface-object/data.ts +7 -0
  127. package/src/test-suites/non-resolvable-interface-object/index.ts +6 -0
  128. package/src/test-suites/non-resolvable-interface-object/test.ts +113 -0
  129. package/src/test-suites/null-keys/a.subgraph.ts +40 -0
  130. package/src/test-suites/null-keys/b.subgraph.ts +42 -0
  131. package/src/test-suites/null-keys/c.subgraph.ts +48 -0
  132. package/src/test-suites/null-keys/data.ts +32 -0
  133. package/src/test-suites/null-keys/index.ts +7 -0
  134. package/src/test-suites/null-keys/test.ts +46 -0
  135. package/src/test-suites/override-type-interface/a.subgraph.ts +47 -0
  136. package/src/test-suites/override-type-interface/b.subgraph.ts +73 -0
  137. package/src/test-suites/override-type-interface/data.ts +27 -0
  138. package/src/test-suites/override-type-interface/index.ts +6 -0
  139. package/src/test-suites/override-type-interface/test.ts +94 -0
  140. package/src/test-suites/override-with-requires/a.subgraph.ts +55 -0
  141. package/src/test-suites/override-with-requires/b.subgraph.ts +42 -0
  142. package/src/test-suites/override-with-requires/c.subgraph.ts +55 -0
  143. package/src/test-suites/override-with-requires/data.ts +14 -0
  144. package/src/test-suites/override-with-requires/index.ts +7 -0
  145. package/src/test-suites/override-with-requires/test.ts +98 -0
  146. package/src/test-suites/parent-entity-call/a.subgraph.ts +90 -0
  147. package/src/test-suites/parent-entity-call/b.subgraph.ts +68 -0
  148. package/src/test-suites/parent-entity-call/c.subgraph.ts +56 -0
  149. package/src/test-suites/parent-entity-call/data.ts +34 -0
  150. package/src/test-suites/parent-entity-call/index.ts +7 -0
  151. package/src/test-suites/parent-entity-call/test.ts +52 -0
  152. package/src/test-suites/parent-entity-call-complex/a.subgraph.ts +29 -0
  153. package/src/test-suites/parent-entity-call-complex/b.subgraph.ts +32 -0
  154. package/src/test-suites/parent-entity-call-complex/c.subgraph.ts +22 -0
  155. package/src/test-suites/parent-entity-call-complex/d.subgraph.ts +35 -0
  156. package/src/test-suites/parent-entity-call-complex/index.ts +8 -0
  157. package/src/test-suites/parent-entity-call-complex/test.ts +32 -0
  158. package/src/test-suites/provides-on-interface/a.subgraph.ts +95 -0
  159. package/src/test-suites/provides-on-interface/b.subgraph.ts +65 -0
  160. package/src/test-suites/provides-on-interface/c.subgraph.ts +119 -0
  161. package/src/test-suites/provides-on-interface/data.ts +24 -0
  162. package/src/test-suites/provides-on-interface/index.ts +7 -0
  163. package/src/test-suites/provides-on-interface/test.ts +68 -0
  164. package/src/test-suites/provides-on-union/a.subgraph.ts +41 -0
  165. package/src/test-suites/provides-on-union/b.subgraph.ts +47 -0
  166. package/src/test-suites/provides-on-union/c.subgraph.ts +59 -0
  167. package/src/test-suites/provides-on-union/data.ts +12 -0
  168. package/src/test-suites/provides-on-union/index.ts +7 -0
  169. package/src/test-suites/provides-on-union/test.ts +62 -0
  170. package/src/test-suites/requires-circular/a.subgraph.ts +72 -0
  171. package/src/test-suites/requires-circular/b.subgraph.ts +46 -0
  172. package/src/test-suites/requires-circular/data.ts +25 -0
  173. package/src/test-suites/requires-circular/index.ts +6 -0
  174. package/src/test-suites/requires-circular/test.ts +46 -0
  175. package/src/test-suites/requires-interface/a.subgraph.ts +92 -0
  176. package/src/test-suites/requires-interface/b.subgraph.ts +82 -0
  177. package/src/test-suites/requires-interface/data.ts +27 -0
  178. package/src/test-suites/requires-interface/index.ts +6 -0
  179. package/src/test-suites/requires-interface/test.ts +96 -0
  180. package/src/test-suites/requires-requires/a.subgraph.ts +33 -0
  181. package/src/test-suites/requires-requires/b.subgraph.ts +42 -0
  182. package/src/test-suites/requires-requires/c.subgraph.ts +65 -0
  183. package/src/test-suites/requires-requires/d.subgraph.ts +71 -0
  184. package/src/test-suites/requires-requires/data.ts +7 -0
  185. package/src/test-suites/requires-requires/index.ts +8 -0
  186. package/src/test-suites/requires-requires/test.ts +88 -0
  187. package/src/test-suites/requires-with-argument/a.subgraph.ts +68 -0
  188. package/src/test-suites/requires-with-argument/b.subgraph.ts +55 -0
  189. package/src/test-suites/requires-with-argument/c.subgraph.ts +71 -0
  190. package/src/test-suites/requires-with-argument/d.subgraph.ts +97 -0
  191. package/src/test-suites/requires-with-argument/data.ts +81 -0
  192. package/src/test-suites/requires-with-argument/index.ts +8 -0
  193. package/src/test-suites/requires-with-argument/test.ts +192 -0
  194. package/src/test-suites/requires-with-argument-conflict/a.subgraph.ts +79 -0
  195. package/src/test-suites/requires-with-argument-conflict/b.subgraph.ts +60 -0
  196. package/src/test-suites/requires-with-argument-conflict/data.ts +20 -0
  197. package/src/test-suites/requires-with-argument-conflict/index.ts +6 -0
  198. package/src/test-suites/requires-with-argument-conflict/test.ts +37 -0
  199. package/src/test-suites/requires-with-fragments/a.subgraph.ts +81 -0
  200. package/src/test-suites/requires-with-fragments/b.subgraph.ts +151 -0
  201. package/src/test-suites/requires-with-fragments/data.ts +30 -0
  202. package/src/test-suites/requires-with-fragments/index.ts +6 -0
  203. package/src/test-suites/requires-with-fragments/test.ts +138 -0
  204. package/src/test-suites/shared-root/category.subgraph.ts +45 -0
  205. package/src/test-suites/shared-root/data.ts +22 -0
  206. package/src/test-suites/shared-root/index.ts +7 -0
  207. package/src/test-suites/shared-root/name.subgraph.ts +46 -0
  208. package/src/test-suites/shared-root/price.subgraph.ts +46 -0
  209. package/src/test-suites/shared-root/test.ts +94 -0
  210. package/src/test-suites/simple-entity-call/data.ts +12 -0
  211. package/src/test-suites/simple-entity-call/email.subgraph.ts +42 -0
  212. package/src/test-suites/simple-entity-call/index.ts +6 -0
  213. package/src/test-suites/simple-entity-call/nickname.subgraph.ts +32 -0
  214. package/src/test-suites/simple-entity-call/test.ts +23 -0
  215. package/src/test-suites/simple-inaccessible/age.subgraph.ts +45 -0
  216. package/src/test-suites/simple-inaccessible/data.ts +12 -0
  217. package/src/test-suites/simple-inaccessible/friends.subgraph.ts +68 -0
  218. package/src/test-suites/simple-inaccessible/index.ts +6 -0
  219. package/src/test-suites/simple-inaccessible/test.ts +124 -0
  220. package/src/test-suites/simple-interface-object/a.subgraph.ts +163 -0
  221. package/src/test-suites/simple-interface-object/b.subgraph.ts +89 -0
  222. package/src/test-suites/simple-interface-object/c.subgraph.ts +48 -0
  223. package/src/test-suites/simple-interface-object/data.ts +38 -0
  224. package/src/test-suites/simple-interface-object/index.ts +7 -0
  225. package/src/test-suites/simple-interface-object/test.ts +367 -0
  226. package/src/test-suites/simple-override/a.subgraph.ts +49 -0
  227. package/src/test-suites/simple-override/b.subgraph.ts +46 -0
  228. package/src/test-suites/simple-override/data.ts +10 -0
  229. package/src/test-suites/simple-override/index.ts +6 -0
  230. package/src/test-suites/simple-override/test.ts +51 -0
  231. package/src/test-suites/simple-requires-provides/accounts.subgraph.ts +48 -0
  232. package/src/test-suites/simple-requires-provides/data.ts +44 -0
  233. package/src/test-suites/simple-requires-provides/index.ts +12 -0
  234. package/src/test-suites/simple-requires-provides/inventory.subgraph.ts +59 -0
  235. package/src/test-suites/simple-requires-provides/products.subgraph.ts +48 -0
  236. package/src/test-suites/simple-requires-provides/reviews.subgraph.ts +106 -0
  237. package/src/test-suites/simple-requires-provides/test.ts +372 -0
  238. package/src/test-suites/typename/a.subgraph.ts +76 -0
  239. package/src/test-suites/typename/b.subgraph.ts +50 -0
  240. package/src/test-suites/typename/data.ts +14 -0
  241. package/src/test-suites/typename/index.ts +6 -0
  242. package/src/test-suites/typename/test.ts +132 -0
  243. package/src/test-suites/unavailable-override/a.subgraph.ts +46 -0
  244. package/src/test-suites/unavailable-override/b.subgraph.ts +46 -0
  245. package/src/test-suites/unavailable-override/data.ts +10 -0
  246. package/src/test-suites/unavailable-override/index.ts +6 -0
  247. package/src/test-suites/unavailable-override/test.ts +51 -0
  248. package/src/test-suites/union-interface-distributed/a.subgraph.ts +126 -0
  249. package/src/test-suites/union-interface-distributed/b.subgraph.ts +39 -0
  250. package/src/test-suites/union-interface-distributed/data.ts +26 -0
  251. package/src/test-suites/union-interface-distributed/index.ts +6 -0
  252. package/src/test-suites/union-interface-distributed/test.ts +244 -0
  253. package/src/test-suites/union-intersection/README.md +3 -0
  254. package/src/test-suites/union-intersection/a.subgraph.ts +83 -0
  255. package/src/test-suites/union-intersection/b.subgraph.ts +79 -0
  256. package/src/test-suites/union-intersection/data.ts +7 -0
  257. package/src/test-suites/union-intersection/index.ts +6 -0
  258. package/{dist/index-Ytb942t9.js → src/test-suites/union-intersection/test.ts} +74 -260
  259. package/src/test.ts +98 -0
  260. package/src/testkit.ts +31 -0
  261. package/.changeset/@graphql-hive_federation-gateway-audit-293-dependencies.md +0 -5
  262. package/.changeset/funky-times-cry.md +0 -5
  263. package/dist/index--3rcSZqA.js +0 -227
  264. package/dist/index-0MDIXUzP.cjs +0 -589
  265. package/dist/index-2oy7cA9A.js +0 -225
  266. package/dist/index-3BM15w2Y.mjs +0 -234
  267. package/dist/index-3CyAnc7j.js +0 -234
  268. package/dist/index-4swHVe9x.cjs +0 -507
  269. package/dist/index-6qNpP2wc.mjs +0 -238
  270. package/dist/index-A2YbwKzc.mjs +0 -288
  271. package/dist/index-B0coRevy.mjs +0 -337
  272. package/dist/index-B1NAc0TI.cjs +0 -215
  273. package/dist/index-B1WvIzTg.js +0 -371
  274. package/dist/index-B55AdoQy.js +0 -273
  275. package/dist/index-B7cr8XE-.js +0 -194
  276. package/dist/index-B7zN3YzE.cjs +0 -683
  277. package/dist/index-B9T896rB.mjs +0 -163
  278. package/dist/index-BEMScD_X.cjs +0 -173
  279. package/dist/index-BGC0_vWj.cjs +0 -335
  280. package/dist/index-BGUm947D.cjs +0 -229
  281. package/dist/index-BKcwbRZx.cjs +0 -339
  282. package/dist/index-BKpVb_h9.cjs +0 -236
  283. package/dist/index-BPFol6Ww.mjs +0 -129
  284. package/dist/index-BPza8i2Q.mjs +0 -213
  285. package/dist/index-BS7JyQSU.js +0 -250
  286. package/dist/index-BSWSgZCO.cjs +0 -252
  287. package/dist/index-BSwOAvti.js +0 -288
  288. package/dist/index-BWO8QbMB.mjs +0 -587
  289. package/dist/index-B_u5Boud.js +0 -333
  290. package/dist/index-BaH3FI9i.cjs +0 -361
  291. package/dist/index-BaluTf1I.cjs +0 -707
  292. package/dist/index-BcoW0aPo.cjs +0 -165
  293. package/dist/index-BdNZKlDU.js +0 -284
  294. package/dist/index-Bf81cAA1.mjs +0 -444
  295. package/dist/index-Bg3H3fgZ.js +0 -259
  296. package/dist/index-Bgl_1Y6Q.mjs +0 -681
  297. package/dist/index-BgryMCqm.mjs +0 -213
  298. package/dist/index-BiTzMTFn.js +0 -304
  299. package/dist/index-BjbmOyBP.cjs +0 -215
  300. package/dist/index-Bm8hqSRd.cjs +0 -168
  301. package/dist/index-BmQrhPXB.cjs +0 -131
  302. package/dist/index-BndUB2KV.mjs +0 -381
  303. package/dist/index-BpJZCoVH.mjs +0 -250
  304. package/dist/index-Br-Y1qC_.cjs +0 -446
  305. package/dist/index-BrFtcRgi.mjs +0 -194
  306. package/dist/index-Bu8SXnTf.mjs +0 -227
  307. package/dist/index-Bwh8HVkw.cjs +0 -384
  308. package/dist/index-BxK3Y72_.js +0 -227
  309. package/dist/index-BxPUzymh.cjs +0 -208
  310. package/dist/index-ByZa9qm8.mjs +0 -273
  311. package/dist/index-Bz_LTy1A.mjs +0 -222
  312. package/dist/index-C1GgHOiD.js +0 -228
  313. package/dist/index-C4Pk-zTm.mjs +0 -227
  314. package/dist/index-C6nkQ480.js +0 -225
  315. package/dist/index-C8Mu4K9Q.cjs +0 -383
  316. package/dist/index-CAJ9YPxc.js +0 -681
  317. package/dist/index-CD03pVUt.cjs +0 -373
  318. package/dist/index-CD8GiuIg.js +0 -227
  319. package/dist/index-CHB_0VqK.mjs +0 -333
  320. package/dist/index-CNvZCDZa.js +0 -166
  321. package/dist/index-COGhiFjk.mjs +0 -284
  322. package/dist/index-COIlelpZ.mjs +0 -262
  323. package/dist/index-CPu_XkjY.mjs +0 -304
  324. package/dist/index-CUFKuE64.js +0 -550
  325. package/dist/index-CW8h3l6M.js +0 -262
  326. package/dist/index-CWrng7Hd.mjs +0 -550
  327. package/dist/index-CXviN8qZ.cjs +0 -224
  328. package/dist/index-C_qaNb-X.mjs +0 -225
  329. package/dist/index-Cb3ImEjd.cjs +0 -165
  330. package/dist/index-Cc3vrs6_.mjs +0 -228
  331. package/dist/index-CcIXvx40.mjs +0 -171
  332. package/dist/index-CdaeeF3f.cjs +0 -306
  333. package/dist/index-Cj2ocjXI.cjs +0 -227
  334. package/dist/index-CkWEXzTN.js +0 -129
  335. package/dist/index-Ckhb9QAu.cjs +0 -264
  336. package/dist/index-CklJfQlf.cjs +0 -220
  337. package/dist/index-Cn0ZJkAv.mjs +0 -280
  338. package/dist/index-Cuw9ylL-.mjs +0 -371
  339. package/dist/index-CwOULUAt.mjs +0 -382
  340. package/dist/index-D-1dDKiZ.mjs +0 -227
  341. package/dist/index-D1Ip6ro6.js +0 -458
  342. package/dist/index-D5tEp8IU.js +0 -337
  343. package/dist/index-D7WuGKYY.cjs +0 -227
  344. package/dist/index-D8Dp6TnQ.cjs +0 -1837
  345. package/dist/index-D9OKpqgG.js +0 -381
  346. package/dist/index-DBMI2EcB.cjs +0 -170
  347. package/dist/index-DBRUKV0U.mjs +0 -225
  348. package/dist/index-DHRqE92a.cjs +0 -290
  349. package/dist/index-DJ3ndv3i.mjs +0 -705
  350. package/dist/index-DJXP-Gmp.js +0 -218
  351. package/dist/index-DJlXDQOY.cjs +0 -200
  352. package/dist/index-DLW4GEJl.cjs +0 -229
  353. package/dist/index-DM4ddIL6.js +0 -382
  354. package/dist/index-DN-ScBql.mjs +0 -458
  355. package/dist/index-DS86eFsI.mjs +0 -1835
  356. package/dist/index-DZws2w4w.cjs +0 -229
  357. package/dist/index-Dbb-jnWf.js +0 -206
  358. package/dist/index-DdXy_-T9.js +0 -444
  359. package/dist/index-DiDq1sL6.cjs +0 -240
  360. package/dist/index-DiuJQ9Mq.js +0 -198
  361. package/dist/index-Dk0q-ENv.mjs +0 -166
  362. package/dist/index-DlFElztE.mjs +0 -163
  363. package/dist/index-DlkxQ-B5.mjs +0 -359
  364. package/dist/index-Du5MxO_2.mjs +0 -505
  365. package/dist/index-DxHMqS-W.js +0 -117
  366. package/dist/index-DyTApTHI.cjs +0 -282
  367. package/dist/index-DzAewrkw.js +0 -238
  368. package/dist/index-EuKHpnHv.mjs +0 -117
  369. package/dist/index-FP6hvgSw.cjs +0 -552
  370. package/dist/index-GDSrKnPp.mjs +0 -198
  371. package/dist/index-GMCZo-KH.js +0 -222
  372. package/dist/index-IawHHRZX.mjs +0 -206
  373. package/dist/index-Jk7MG7tE.cjs +0 -286
  374. package/dist/index-KAC20a9r.js +0 -359
  375. package/dist/index-Ls2fI7y4.js +0 -163
  376. package/dist/index-NIEZaRYg.cjs +0 -261
  377. package/dist/index-PyaLRKuk.mjs +0 -168
  378. package/dist/index-QXYDkAsQ.cjs +0 -119
  379. package/dist/index-SmEIf5jz.mjs +0 -259
  380. package/dist/index-UVyXzNlG.js +0 -705
  381. package/dist/index-VvuhRvnC.mjs +0 -218
  382. package/dist/index-XZiO6uje.cjs +0 -275
  383. package/dist/index-YOlsBREZ.cjs +0 -230
  384. package/dist/index-_2dg_MWu.cjs +0 -460
  385. package/dist/index-eFEW10em.js +0 -213
  386. package/dist/index-f7FiDQMk.js +0 -171
  387. package/dist/index-fdDnq3vQ.js +0 -163
  388. package/dist/index-l8e8ip4U.js +0 -168
  389. package/dist/index-rn-_7-wp.cjs +0 -196
  390. package/dist/index-s27DHpTG.js +0 -1835
  391. package/dist/index-sbc7nDv3.js +0 -213
  392. package/dist/index-vHngHSlz.js +0 -280
  393. package/dist/testkit-C920qivh.js +0 -281
  394. package/dist/testkit-C920qivh.mjs +0 -281
  395. package/dist/testkit-D0rTQ6MD.cjs +0 -286
@@ -1,333 +0,0 @@
1
- import { c as createSubgraph, a as createTest, s as serve } from './testkit-C920qivh.js';
2
- import '@apollo/composition';
3
- import 'graphql';
4
- import 'fets';
5
- import '@apollo/subgraph';
6
- import 'graphql-yoga';
7
-
8
- const medias = [
9
- {
10
- __typename: "Book",
11
- id: "m1",
12
- animals: ["a1", "a2"]
13
- }
14
- ];
15
- const animals = [
16
- {
17
- __typename: "Dog",
18
- id: "a1",
19
- name: "Fido",
20
- age: 3
21
- },
22
- {
23
- __typename: "Cat",
24
- id: "a2",
25
- name: "Whiskers",
26
- age: 6
27
- }
28
- ];
29
-
30
- var a = createSubgraph("a", {
31
- typeDefs: (
32
- /* GraphQL */
33
- `
34
- extend schema
35
- @link(
36
- url: "https://specs.apollo.dev/federation/v2.3"
37
- import: ["@key", "@shareable", "@external", "@provides"]
38
- )
39
-
40
- type Query {
41
- media: Media @shareable
42
- book: Book @provides(fields: "animals { ... on Dog { name } }")
43
- }
44
-
45
- interface Media {
46
- id: ID!
47
- }
48
-
49
- interface Animal {
50
- id: ID!
51
- }
52
-
53
- type Book implements Media @key(fields: "id") {
54
- id: ID!
55
- animals: [Animal] @shareable
56
- }
57
-
58
- type Dog implements Animal @key(fields: "id") {
59
- id: ID! @external
60
- name: String @external
61
- }
62
-
63
- type Cat implements Animal @key(fields: "id") {
64
- id: ID! @external
65
- }
66
- `
67
- ),
68
- resolvers: {
69
- Query: {
70
- media() {
71
- {
72
- throw new Error("You should be using the 'a' subgraph!");
73
- }
74
- },
75
- book() {
76
- const book = medias[0];
77
- return {
78
- __typename: "Book",
79
- id: book.id,
80
- animals: book.animals.map((animalId) => {
81
- const animal = animals.find((a) => a.id === animalId);
82
- if (!animal) {
83
- return null;
84
- }
85
- if (animal.__typename === "Dog") {
86
- return {
87
- __typename: "Dog",
88
- id: animal.id,
89
- name: animal.name
90
- };
91
- }
92
- return {
93
- __typename: animal.__typename,
94
- id: animal.id
95
- };
96
- })
97
- };
98
- }
99
- }
100
- }
101
- });
102
-
103
- var b = createSubgraph("b", {
104
- typeDefs: (
105
- /* GraphQL */
106
- `
107
- extend schema
108
- @link(
109
- url: "https://specs.apollo.dev/federation/v2.3"
110
- import: ["@key", "@shareable", "@provides", "@external"]
111
- )
112
-
113
- type Query {
114
- media: Media @shareable @provides(fields: "animals { id name }")
115
- }
116
-
117
- interface Media {
118
- id: ID!
119
- animals: [Animal]
120
- }
121
-
122
- interface Animal {
123
- id: ID!
124
- name: String
125
- }
126
-
127
- type Book implements Media {
128
- id: ID! @shareable
129
- animals: [Animal] @external
130
- }
131
-
132
- type Dog implements Animal {
133
- id: ID! @external
134
- name: String @external
135
- }
136
-
137
- type Cat implements Animal {
138
- id: ID! @external
139
- name: String @external
140
- }
141
- `
142
- ),
143
- resolvers: {
144
- Query: {
145
- media() {
146
- const media = medias[0];
147
- return {
148
- __typename: media.__typename,
149
- id: media.id,
150
- animals: media.animals.map((animalId) => {
151
- const animal = animals.find((a) => a.id === animalId);
152
- if (!animal) {
153
- return null;
154
- }
155
- return {
156
- __typename: animal.__typename,
157
- id: animal.id,
158
- name: animal.name
159
- };
160
- })
161
- };
162
- }
163
- }
164
- }
165
- });
166
-
167
- var c = createSubgraph("c", {
168
- typeDefs: (
169
- /* GraphQL */
170
- `
171
- extend schema
172
- @link(
173
- url: "https://specs.apollo.dev/federation/v2.3"
174
- import: ["@key", "@shareable"]
175
- )
176
-
177
- interface Media {
178
- id: ID!
179
- animals: [Animal]
180
- }
181
-
182
- interface Animal {
183
- id: ID!
184
- name: String
185
- }
186
-
187
- type Book implements Media @key(fields: "id") {
188
- id: ID!
189
- animals: [Animal] @shareable
190
- }
191
-
192
- type Dog implements Animal @key(fields: "id") {
193
- id: ID!
194
- name: String @shareable
195
- age: Int
196
- }
197
-
198
- type Cat implements Animal @key(fields: "id") {
199
- id: ID!
200
- name: String @shareable
201
- age: Int
202
- }
203
- `
204
- ),
205
- resolvers: {
206
- Query: {
207
- media() {
208
- {
209
- throw new Error("You should be using the 'a' subgraph!");
210
- }
211
- }
212
- },
213
- Book: {
214
- __resolveReference(key) {
215
- const media = medias.find((media2) => media2.id === key.id);
216
- return media ? {
217
- __typename: "Book",
218
- id: media.id,
219
- animals: media.animals
220
- } : null;
221
- },
222
- animals(book) {
223
- return book.animals.map((animalId) => {
224
- const animal = animals.find((a) => a.id === animalId);
225
- return animal ? {
226
- __typename: animal.__typename,
227
- id: animal.id,
228
- name: animal.name
229
- } : null;
230
- });
231
- }
232
- },
233
- Cat: {
234
- __resolveReference(key) {
235
- const animal = animals.find((animal2) => animal2.id === key.id);
236
- return animal ? {
237
- __typename: "Cat",
238
- id: animal.id,
239
- name: animal.name,
240
- age: animal.age
241
- } : null;
242
- },
243
- age(cat) {
244
- const animal = animals.find((a) => a.id === cat.id);
245
- return animal ? animal.age : null;
246
- }
247
- },
248
- Dog: {
249
- __resolveReference(key) {
250
- {
251
- throw new Error("You should be using the 'c' subgraph!");
252
- }
253
- },
254
- age(dog) {
255
- const animal = animals.find((a) => a.id === dog.id);
256
- return animal ? animal.age : null;
257
- }
258
- }
259
- }
260
- });
261
-
262
- var test = [
263
- createTest(
264
- /* GraphQL */
265
- `
266
- query {
267
- media {
268
- id
269
- animals {
270
- id
271
- name
272
- }
273
- }
274
- }
275
- `,
276
- {
277
- data: {
278
- media: {
279
- id: "m1",
280
- animals: [
281
- {
282
- id: "a1",
283
- name: "Fido"
284
- },
285
- {
286
- id: "a2",
287
- name: "Whiskers"
288
- }
289
- ]
290
- }
291
- }
292
- }
293
- ),
294
- createTest(
295
- /* GraphQL */
296
- `
297
- query {
298
- media {
299
- id
300
- animals {
301
- id
302
- name
303
- ... on Cat {
304
- age
305
- }
306
- }
307
- }
308
- }
309
- `,
310
- {
311
- data: {
312
- media: {
313
- id: "m1",
314
- animals: [
315
- {
316
- id: "a1",
317
- name: "Fido"
318
- },
319
- {
320
- id: "a2",
321
- name: "Whiskers",
322
- age: 6
323
- }
324
- ]
325
- }
326
- }
327
- }
328
- )
329
- ];
330
-
331
- var index = serve("provides-on-interface", [a, b, c], test);
332
-
333
- export { index as default };
@@ -1,361 +0,0 @@
1
- 'use strict';
2
-
3
- var testkit = require('./testkit-D0rTQ6MD.cjs');
4
- require('@apollo/composition');
5
- require('graphql');
6
- require('fets');
7
- require('@apollo/subgraph');
8
- require('graphql-yoga');
9
-
10
- const users = [
11
- {
12
- id: "u1",
13
- name: "u1-name",
14
- username: "u1-username",
15
- age: 11
16
- },
17
- {
18
- id: "u2",
19
- name: "u2-name",
20
- username: "u2-username",
21
- age: 22
22
- }
23
- ];
24
-
25
- var a = testkit.createSubgraph("a", {
26
- typeDefs: (
27
- /* GraphQL */
28
- `
29
- extend schema
30
- @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@key"])
31
-
32
- type Query {
33
- users: [NodeWithName!]!
34
- }
35
-
36
- interface NodeWithName @key(fields: "id") {
37
- id: ID!
38
- name: String
39
- }
40
-
41
- type User implements NodeWithName @key(fields: "id") {
42
- id: ID!
43
- name: String
44
- age: Int
45
- }
46
- `
47
- ),
48
- resolvers: {
49
- NodeWithName: {
50
- __resolveReference(key) {
51
- const node = users.find((u) => u.id === key.id);
52
- if (!node) {
53
- return null;
54
- }
55
- return {
56
- __typename: "User",
57
- id: node.id,
58
- name: node.name,
59
- age: node.age
60
- };
61
- }
62
- },
63
- User: {
64
- __resolveReference(key) {
65
- const user = users.find((u) => u.id === key.id);
66
- if (!user) {
67
- return null;
68
- }
69
- return {
70
- __typename: "User",
71
- id: user.id,
72
- name: user.name,
73
- age: user.age
74
- };
75
- }
76
- },
77
- Query: {
78
- users() {
79
- return users.map((u) => ({
80
- __typename: "User",
81
- id: u.id,
82
- name: u.name,
83
- age: u.age
84
- }));
85
- }
86
- }
87
- }
88
- });
89
-
90
- var b = testkit.createSubgraph("b", {
91
- typeDefs: (
92
- /* GraphQL */
93
- `
94
- extend schema
95
- @link(
96
- url: "https://specs.apollo.dev/federation/v2.3"
97
- import: ["@key", "@interfaceObject", "@external", "@requires"]
98
- )
99
-
100
- type Query {
101
- anotherUsers: [NodeWithName]
102
- }
103
-
104
- type NodeWithName @key(fields: "id") @interfaceObject {
105
- id: ID!
106
- name: String @external
107
- username: String @requires(fields: "name")
108
- }
109
- `
110
- ),
111
- resolvers: {
112
- NodeWithName: {
113
- __resolveReference(key) {
114
- const node = users.find((u) => u.id === key.id);
115
- if (!node) {
116
- return null;
117
- }
118
- return {
119
- __typename: "User",
120
- id: node.id,
121
- name: "name" in key ? key.name : void 0
122
- };
123
- },
124
- username(node) {
125
- const user = users.find((u) => u.id === node.id);
126
- if (!user) {
127
- return null;
128
- }
129
- if (!node.name) {
130
- throw new Error("Requires field 'name' not provided");
131
- }
132
- return user.username;
133
- }
134
- },
135
- Query: {
136
- anotherUsers() {
137
- return users.map((u) => ({
138
- __typename: "User",
139
- id: u.id,
140
- username: u.username
141
- }));
142
- }
143
- }
144
- }
145
- });
146
-
147
- var test = [
148
- testkit.createTest(
149
- /* GraphQL */
150
- `
151
- query {
152
- anotherUsers {
153
- id
154
- name
155
- username
156
- }
157
- }
158
- `,
159
- {
160
- data: {
161
- anotherUsers: [
162
- {
163
- id: "u1",
164
- name: "u1-name",
165
- username: "u1-username"
166
- },
167
- {
168
- id: "u2",
169
- name: "u2-name",
170
- username: "u2-username"
171
- }
172
- ]
173
- }
174
- }
175
- ),
176
- testkit.createTest(
177
- /* GraphQL */
178
- `
179
- query {
180
- users {
181
- id
182
- name
183
- username
184
- }
185
- }
186
- `,
187
- {
188
- data: {
189
- users: [
190
- {
191
- id: "u1",
192
- name: "u1-name",
193
- username: "u1-username"
194
- },
195
- {
196
- id: "u2",
197
- name: "u2-name",
198
- username: "u2-username"
199
- }
200
- ]
201
- }
202
- }
203
- ),
204
- testkit.createTest(
205
- /* GraphQL */
206
- `
207
- query {
208
- anotherUsers {
209
- ... on User {
210
- age
211
- }
212
- }
213
- }
214
- `,
215
- {
216
- data: {
217
- anotherUsers: [
218
- {
219
- age: 11
220
- },
221
- {
222
- age: 22
223
- }
224
- ]
225
- }
226
- }
227
- ),
228
- testkit.createTest(
229
- /* GraphQL */
230
- `
231
- query {
232
- users {
233
- ... on User {
234
- age
235
- }
236
- }
237
- }
238
- `,
239
- {
240
- data: {
241
- users: [
242
- {
243
- age: 11
244
- },
245
- {
246
- age: 22
247
- }
248
- ]
249
- }
250
- }
251
- ),
252
- testkit.createTest(
253
- /* GraphQL */
254
- `
255
- query {
256
- anotherUsers {
257
- ... on User {
258
- age
259
- id
260
- name
261
- username
262
- }
263
- id
264
- name
265
- }
266
- }
267
- `,
268
- {
269
- data: {
270
- anotherUsers: [
271
- {
272
- age: 11,
273
- id: "u1",
274
- name: "u1-name",
275
- username: "u1-username"
276
- },
277
- {
278
- age: 22,
279
- id: "u2",
280
- name: "u2-name",
281
- username: "u2-username"
282
- }
283
- ]
284
- }
285
- }
286
- ),
287
- testkit.createTest(
288
- /* GraphQL */
289
- `
290
- query {
291
- users {
292
- ... on User {
293
- age
294
- id
295
- name
296
- username
297
- }
298
- id
299
- name
300
- }
301
- }
302
- `,
303
- {
304
- data: {
305
- users: [
306
- {
307
- age: 11,
308
- id: "u1",
309
- name: "u1-name",
310
- username: "u1-username"
311
- },
312
- {
313
- age: 22,
314
- id: "u2",
315
- name: "u2-name",
316
- username: "u2-username"
317
- }
318
- ]
319
- }
320
- }
321
- ),
322
- testkit.createTest(
323
- /* GraphQL */
324
- `
325
- query {
326
- users {
327
- ... on User {
328
- age
329
- id
330
- name
331
- username
332
- }
333
- id
334
- name
335
- }
336
- }
337
- `,
338
- {
339
- data: {
340
- users: [
341
- {
342
- age: 11,
343
- id: "u1",
344
- name: "u1-name",
345
- username: "u1-username"
346
- },
347
- {
348
- age: 22,
349
- id: "u2",
350
- name: "u2-name",
351
- username: "u2-username"
352
- }
353
- ]
354
- }
355
- }
356
- )
357
- ];
358
-
359
- var index = testkit.serve("interface-object-with-requires", [a, b], test);
360
-
361
- exports.default = index;