vscode-apollo 2.5.5 → 2.6.0

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 (183) hide show
  1. package/.circleci/config.yml +17 -0
  2. package/.github/workflows/E2E.yml +25 -5
  3. package/.github/workflows/build-prs.yml +2 -1
  4. package/.prettierignore +3 -0
  5. package/.semgrepignore +2 -0
  6. package/.vscode/settings.json +7 -2
  7. package/CHANGELOG.md +14 -0
  8. package/apollo.connectors.mapping.configuration.json +10 -0
  9. package/package.json +39 -5
  10. package/sampleWorkspace/connectors-community/.github/ISSUE_TEMPLATE/connector-bug-report.md +36 -0
  11. package/sampleWorkspace/connectors-community/.github/ISSUE_TEMPLATE/new-connector.md +10 -0
  12. package/sampleWorkspace/connectors-community/.github/renovate.json5 +3 -0
  13. package/sampleWorkspace/connectors-community/.vscode/extensions.json +3 -0
  14. package/sampleWorkspace/connectors-community/.vscode/settings.json +13 -0
  15. package/sampleWorkspace/connectors-community/.vscode/tasks.json +10 -0
  16. package/sampleWorkspace/connectors-community/README.md +108 -0
  17. package/sampleWorkspace/connectors-community/apollo.config.json +5 -0
  18. package/sampleWorkspace/connectors-community/connectors/.template/Dockerfile +5 -0
  19. package/sampleWorkspace/connectors-community/connectors/.template/README +46 -0
  20. package/sampleWorkspace/connectors-community/connectors/.template/connector.graphql +31 -0
  21. package/sampleWorkspace/connectors-community/connectors/.template/router.yaml +18 -0
  22. package/sampleWorkspace/connectors-community/connectors/.template/supergraph.yaml +6 -0
  23. package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/README +12 -0
  24. package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/albums.graphql +48 -0
  25. package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/comments.graphql +54 -0
  26. package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/photos.graphql +54 -0
  27. package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/posts.graphql +51 -0
  28. package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/supergraph.yaml +26 -0
  29. package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/todos.graphql +51 -0
  30. package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/users.graphql +80 -0
  31. package/sampleWorkspace/connectors-community/connectors/TM-Forum/README.md +9 -0
  32. package/sampleWorkspace/connectors-community/connectors/TM-Forum/router.yaml +18 -0
  33. package/sampleWorkspace/connectors-community/connectors/TM-Forum/supergraph.yaml +6 -0
  34. package/sampleWorkspace/connectors-community/connectors/TM-Forum/tmf622-ProductOrdering.graphql +296 -0
  35. package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/README.md +7 -0
  36. package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/addresses.graphql +30 -0
  37. package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/customer.graphql +77 -0
  38. package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/products.graphql +70 -0
  39. package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/router.yaml +24 -0
  40. package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/supergraph.yaml +14 -0
  41. package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/swagger.json +69226 -0
  42. package/sampleWorkspace/connectors-community/connectors/anthropic/Dockerfile +5 -0
  43. package/sampleWorkspace/connectors-community/connectors/anthropic/README +61 -0
  44. package/sampleWorkspace/connectors-community/connectors/anthropic/messages.graphql +258 -0
  45. package/sampleWorkspace/connectors-community/connectors/anthropic/router.yaml +18 -0
  46. package/sampleWorkspace/connectors-community/connectors/anthropic/supergraph.yaml +6 -0
  47. package/sampleWorkspace/connectors-community/connectors/apollo-ecomm-simple/README +3 -0
  48. package/sampleWorkspace/connectors-community/connectors/apollo-ecomm-simple/connector.graphql +38 -0
  49. package/sampleWorkspace/connectors-community/connectors/apollo-ecomm-simple/router.yaml +18 -0
  50. package/sampleWorkspace/connectors-community/connectors/apollo-ecomm-simple/supergraph.yaml +6 -0
  51. package/sampleWorkspace/connectors-community/connectors/apple/README +36 -0
  52. package/sampleWorkspace/connectors-community/connectors/apple/app-store-connect.graphql +100 -0
  53. package/sampleWorkspace/connectors-community/connectors/apple/router.yaml +18 -0
  54. package/sampleWorkspace/connectors-community/connectors/apple/supergraph.yaml +6 -0
  55. package/sampleWorkspace/connectors-community/connectors/aws/README +125 -0
  56. package/sampleWorkspace/connectors-community/connectors/aws/dynamodb.graphql +130 -0
  57. package/sampleWorkspace/connectors-community/connectors/aws/json-responses/product-price.json +10 -0
  58. package/sampleWorkspace/connectors-community/connectors/aws/json-responses/products.json +53 -0
  59. package/sampleWorkspace/connectors-community/connectors/aws/lambda.graphql +179 -0
  60. package/sampleWorkspace/connectors-community/connectors/aws/router.yaml +54 -0
  61. package/sampleWorkspace/connectors-community/connectors/aws/supergraph.yaml +10 -0
  62. package/sampleWorkspace/connectors-community/connectors/bored/README.md +35 -0
  63. package/sampleWorkspace/connectors-community/connectors/bored/bored.graphql +87 -0
  64. package/sampleWorkspace/connectors-community/connectors/bored/supergraph.yaml +6 -0
  65. package/sampleWorkspace/connectors-community/connectors/common-room/README.md +23 -0
  66. package/sampleWorkspace/connectors-community/connectors/common-room/contacts.graphql +141 -0
  67. package/sampleWorkspace/connectors-community/connectors/common-room/json-responses/members_email_.json +61 -0
  68. package/sampleWorkspace/connectors-community/connectors/common-room/router.yaml +18 -0
  69. package/sampleWorkspace/connectors-community/connectors/common-room/supergraph.yaml +6 -0
  70. package/sampleWorkspace/connectors-community/connectors/googlemaps/README.md +58 -0
  71. package/sampleWorkspace/connectors-community/connectors/googlemaps/distancematrix.graphql +155 -0
  72. package/sampleWorkspace/connectors-community/connectors/googlemaps/places-legacy.graphql +117 -0
  73. package/sampleWorkspace/connectors-community/connectors/googlemaps/places.graphql +399 -0
  74. package/sampleWorkspace/connectors-community/connectors/googlemaps/router.yaml +18 -0
  75. package/sampleWorkspace/connectors-community/connectors/googlemaps/supergraph.yaml +18 -0
  76. package/sampleWorkspace/connectors-community/connectors/googlemaps/timezone.graphql +64 -0
  77. package/sampleWorkspace/connectors-community/connectors/heygen/README +105 -0
  78. package/sampleWorkspace/connectors-community/connectors/heygen/avatars.graphql +79 -0
  79. package/sampleWorkspace/connectors-community/connectors/heygen/photo-avatars.graphql +454 -0
  80. package/sampleWorkspace/connectors-community/connectors/heygen/router.yaml +21 -0
  81. package/sampleWorkspace/connectors-community/connectors/heygen/supergraph.yaml +10 -0
  82. package/sampleWorkspace/connectors-community/connectors/jira/README +36 -0
  83. package/sampleWorkspace/connectors-community/connectors/jira/connector.graphql +197 -0
  84. package/sampleWorkspace/connectors-community/connectors/jira/router.yaml +18 -0
  85. package/sampleWorkspace/connectors-community/connectors/jira/supergraph.yaml +6 -0
  86. package/sampleWorkspace/connectors-community/connectors/museums/README.md +40 -0
  87. package/sampleWorkspace/connectors-community/connectors/museums/chicagoArt.graphql +150 -0
  88. package/sampleWorkspace/connectors-community/connectors/museums/met.graphql +119 -0
  89. package/sampleWorkspace/connectors-community/connectors/museums/supergraph.yaml +10 -0
  90. package/sampleWorkspace/connectors-community/connectors/nws/README.md +45 -0
  91. package/sampleWorkspace/connectors-community/connectors/nws/alerts.graphql +598 -0
  92. package/sampleWorkspace/connectors-community/connectors/nws/supergraph.yaml +6 -0
  93. package/sampleWorkspace/connectors-community/connectors/odata/README +18 -0
  94. package/sampleWorkspace/connectors-community/connectors/odata/connector.graphql +171 -0
  95. package/sampleWorkspace/connectors-community/connectors/odata/router.yaml +18 -0
  96. package/sampleWorkspace/connectors-community/connectors/odata/supergraph.yaml +6 -0
  97. package/sampleWorkspace/connectors-community/connectors/openai/README.md +61 -0
  98. package/sampleWorkspace/connectors-community/connectors/openai/assistants.graphql +285 -0
  99. package/sampleWorkspace/connectors-community/connectors/openai/chat-completions.graphql +169 -0
  100. package/sampleWorkspace/connectors-community/connectors/openai/models.graphql +47 -0
  101. package/sampleWorkspace/connectors-community/connectors/openai/router.yaml +24 -0
  102. package/sampleWorkspace/connectors-community/connectors/openai/supergraph.yaml +14 -0
  103. package/sampleWorkspace/connectors-community/connectors/pokeapi/README +45 -0
  104. package/sampleWorkspace/connectors-community/connectors/pokeapi/games.graphql +70 -0
  105. package/sampleWorkspace/connectors-community/connectors/pokeapi/locations.graphql +127 -0
  106. package/sampleWorkspace/connectors-community/connectors/pokeapi/moves.graphql +107 -0
  107. package/sampleWorkspace/connectors-community/connectors/pokeapi/pokemon.graphql +539 -0
  108. package/sampleWorkspace/connectors-community/connectors/pokeapi/router.yaml +18 -0
  109. package/sampleWorkspace/connectors-community/connectors/pokeapi/supergraph.yaml +18 -0
  110. package/sampleWorkspace/connectors-community/connectors/strapi/README.md +75 -0
  111. package/sampleWorkspace/connectors-community/connectors/strapi/router.yaml +19 -0
  112. package/sampleWorkspace/connectors-community/connectors/strapi/supergraph.yaml +6 -0
  113. package/sampleWorkspace/connectors-community/connectors/strapi/users.graphql +227 -0
  114. package/sampleWorkspace/connectors-community/connectors/stripe/README.md +83 -0
  115. package/sampleWorkspace/connectors-community/connectors/stripe/checkout.graphql +112 -0
  116. package/sampleWorkspace/connectors-community/connectors/stripe/core-resources.graphql +868 -0
  117. package/sampleWorkspace/connectors-community/connectors/stripe/payment-methods.graphql +526 -0
  118. package/sampleWorkspace/connectors-community/connectors/stripe/products.graphql +162 -0
  119. package/sampleWorkspace/connectors-community/connectors/stripe/router.yaml +26 -0
  120. package/sampleWorkspace/connectors-community/connectors/stripe/supergraph.yaml +18 -0
  121. package/sampleWorkspace/connectors-community/connectors/supabase/README.md +80 -0
  122. package/sampleWorkspace/connectors-community/connectors/supabase/router.yaml +5 -0
  123. package/sampleWorkspace/connectors-community/connectors/supabase/supabase.graphql +143 -0
  124. package/sampleWorkspace/connectors-community/connectors/supabase/supergraph.yaml +6 -0
  125. package/sampleWorkspace/connectors-community/connectors/thespacedevs/README +46 -0
  126. package/sampleWorkspace/connectors-community/connectors/thespacedevs/agencies.graphql +193 -0
  127. package/sampleWorkspace/connectors-community/connectors/thespacedevs/api-throttle.graphql +33 -0
  128. package/sampleWorkspace/connectors-community/connectors/thespacedevs/astronauts.graphql +237 -0
  129. package/sampleWorkspace/connectors-community/connectors/thespacedevs/celestial-bodies.graphql +131 -0
  130. package/sampleWorkspace/connectors-community/connectors/thespacedevs/docking-events.graphql +3460 -0
  131. package/sampleWorkspace/connectors-community/connectors/thespacedevs/launches.graphql +1156 -0
  132. package/sampleWorkspace/connectors-community/connectors/thespacedevs/supergraph.yaml +77 -0
  133. package/sampleWorkspace/connectors-community/connectors/tint/README +35 -0
  134. package/sampleWorkspace/connectors-community/connectors/tint/accounts.graphql +69 -0
  135. package/sampleWorkspace/connectors-community/connectors/tint/router.yaml +21 -0
  136. package/sampleWorkspace/connectors-community/connectors/tint/social-feeds.graphql +62 -0
  137. package/sampleWorkspace/connectors-community/connectors/tint/supergraph.yaml +10 -0
  138. package/sampleWorkspace/connectors-community/connectors/todoist/README.md +48 -0
  139. package/sampleWorkspace/connectors-community/connectors/todoist/supergraph.yaml +6 -0
  140. package/sampleWorkspace/connectors-community/connectors/todoist/todoist.graphql +381 -0
  141. package/sampleWorkspace/connectors-community/connectors/trimblemaps/README +99 -0
  142. package/sampleWorkspace/connectors-community/connectors/trimblemaps/connector.graphql +66 -0
  143. package/sampleWorkspace/connectors-community/connectors/trimblemaps/router.yaml +18 -0
  144. package/sampleWorkspace/connectors-community/connectors/trimblemaps/supergraph.yaml +6 -0
  145. package/sampleWorkspace/connectors-community/connectors/twilio/README.md +44 -0
  146. package/sampleWorkspace/connectors-community/connectors/twilio/messages.graphql +107 -0
  147. package/sampleWorkspace/connectors-community/connectors/twilio/router.yaml +6 -0
  148. package/sampleWorkspace/connectors-community/connectors/twilio/supergraph.yaml +6 -0
  149. package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes/README.md +44 -0
  150. package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes/earthquakes.graphql +235 -0
  151. package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes/supergraph.yaml +6 -0
  152. package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes-nominatum/README.md +44 -0
  153. package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes-nominatum/earthquake-simple.graphql +87 -0
  154. package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes-nominatum/router.yaml +3 -0
  155. package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes-nominatum/supergraph.yaml +6 -0
  156. package/sampleWorkspace/connectors-community/connectors/usps/README +36 -0
  157. package/sampleWorkspace/connectors-community/connectors/usps/router.yaml +18 -0
  158. package/sampleWorkspace/connectors-community/connectors/usps/supergraph.yaml +6 -0
  159. package/sampleWorkspace/connectors-community/connectors/usps/tracking.graphql +118 -0
  160. package/sampleWorkspace/connectors-community/connectors/zendesk/README +36 -0
  161. package/sampleWorkspace/connectors-community/connectors/zendesk/connector.graphql +98 -0
  162. package/sampleWorkspace/connectors-community/connectors/zendesk/router.yaml +18 -0
  163. package/sampleWorkspace/connectors-community/connectors/zendesk/supergraph.yaml +6 -0
  164. package/sampleWorkspace/connectors-community/file-new/index.js +520 -0
  165. package/sampleWorkspace/connectors-community/package-lock.json +119 -0
  166. package/sampleWorkspace/connectors-community/package.json +20 -0
  167. package/sampleWorkspace/connectors-community/supergraph.yaml +6 -0
  168. package/sampleWorkspace/rover/apollo.config.yaml +1 -1
  169. package/sampleWorkspace/rover/supergraph.yaml +4 -0
  170. package/sampleWorkspace/sampleWorkspace.code-workspace +29 -8
  171. package/src/__tests__/fixtures/textmate/test.apollo.connectors.mapping +213 -0
  172. package/src/__tests__/fixtures/textmate/test.connect.graphql +104 -0
  173. package/src/language-server/__e2e__/configFileTypes.e2e.ts +2 -2
  174. package/src/language-server/__e2e__/rover.e2e.ts +37 -49
  175. package/src/language-server/__tests__/fixtures/documents/functionCall.ts.snap +3 -3
  176. package/src/language-server/config/config.ts +4 -2
  177. package/syntaxes/build.ts +266 -0
  178. package/syntaxes/connectors.mapping.json +532 -0
  179. package/syntaxes/connectors.mapping.yaml +440 -0
  180. package/syntaxes/graphql.connectors.json +426 -0
  181. package/syntaxes/graphql.connectors.yaml +254 -0
  182. package/syntaxes/graphql.json +22 -1
  183. package/syntaxes/tsconfig.json +6 -0
@@ -0,0 +1,539 @@
1
+ extend schema
2
+ @link(url: "https://specs.apollo.dev/federation/v2.11", import: ["@key", "@requires", "@shareable"])
3
+ @link(
4
+ url: "https://specs.apollo.dev/connect/v0.2"
5
+ import: ["@source", "@connect"]
6
+ )
7
+ @source(
8
+ name: "pokeapi"
9
+ http: {
10
+ baseURL: "https://pokeapi.co/api/v2/"
11
+ }
12
+ )
13
+
14
+ type GameIndex @shareable{
15
+ gameIndex: Int
16
+ version: Version
17
+ }
18
+ type HeldItem {
19
+ name: String
20
+ }
21
+ type LocationAreaEncounter {
22
+ locationArea: LocationArea
23
+ versionDetails: [VersionDetails]
24
+ }
25
+ type LocationArea @key(fields: "name",resolvable: false){
26
+ name: String
27
+ }
28
+ type VersionDetails {
29
+ maxChance: Int
30
+ version: Version
31
+ encounterDetails: [EncounterDetails]
32
+ }
33
+ type EncounterDetails {
34
+ chance: Int
35
+ conditionValues: [ConditionValue]
36
+ maxLevel: Int
37
+ method: EncounterMethod
38
+ }
39
+ type ConditionValue {
40
+ name: String
41
+ }
42
+ type EncounterMethod @key(fields: "name",resolvable: false) {
43
+ name: String
44
+ }
45
+ type Move @key(fields: "name", resolvable: false) {
46
+ name: String
47
+ }
48
+ type VersionGroupDetails {
49
+ levelLearnedAt: Int
50
+ moveLearnMethod: MoveLearnMethod
51
+ order: Int
52
+ versionGroup: VersionGroup
53
+ }
54
+ type MoveLearnMethod {
55
+ name: String
56
+ }
57
+ type VersionGroup @key(fields: "name", resolvable: false) {
58
+ name: String
59
+ }
60
+ type Pokemon @key(fields: "name"){
61
+ id: ID!
62
+ name: String
63
+ height: Int
64
+ weight: Int
65
+ "The base experience gained for defeating this Pokémon."
66
+ baseExperience: Int
67
+ "A list of abilities this Pokémon could potentially have."
68
+ abilities: [PokemonAbility]
69
+ "A set of cries used to depict this Pokémon in the game. "
70
+ cries: [PokemonCry]
71
+ "A list of game indices relevent to Pokémon item by generation."
72
+ gameIndices: [GameIndex]
73
+ "A list of items this Pokémon may be holding when encountered."
74
+ heldItems: [HeldItem]
75
+ isDefault: Boolean
76
+ locationAreaEncounters: [LocationAreaEncounter]
77
+ @connect(
78
+ source: "pokeapi"
79
+ http: { GET: "/pokemon/{$this.name}/encounters" }
80
+ selection: """
81
+ locationArea: $.location_area {
82
+ name
83
+ }
84
+ versionDetails: $.version_details {
85
+ maxChance: max_chance
86
+ version {
87
+ name
88
+ }
89
+ encounterDetails: $.encounter_details {
90
+ chance
91
+ conditionValues: condition_values {
92
+ name
93
+ }
94
+ maxLevel: max_level
95
+ method {
96
+ name
97
+ }
98
+ }
99
+ }
100
+ """
101
+ )
102
+ moves: [MoveDetails]
103
+ species: PokemonSpecies
104
+ sprites: PokemonSprites
105
+ stats: [PokemonStat]
106
+ }
107
+ type MoveDetails {
108
+ name: String
109
+ versionGroupDetails: [VersionGroupDetails]
110
+ }
111
+ type PokemonAbility {
112
+ slot: Int
113
+ isHidden: Boolean
114
+ ability: PokemonAbilityDetails
115
+ }
116
+ type PokemonCry {
117
+ latest: String
118
+ legacy: String
119
+ }
120
+ type PokemonAbilityDetails {
121
+ name: String
122
+ }
123
+ type PokemonConnection {
124
+ total: Int
125
+ results: [Pokemon]
126
+ }
127
+ type PokemonSpecies {
128
+ baseHappiness: Int
129
+ captureRate: Int
130
+ color: PokedexColor
131
+ eggGroups: [EggGroup]
132
+ generation: Generation
133
+ growthRate: GrowthRate
134
+ habitat: String
135
+ hasGenderDifferences: Boolean
136
+ hatchCounter: Int
137
+ isBaby: Boolean
138
+ isLegendary: Boolean
139
+ isMythical: Boolean
140
+ name: String
141
+ order: Int
142
+ palParkEncounters: [PalParkEncounter]
143
+ pokedexNumber: [PokedexNumber]
144
+ }
145
+ type EggGroup {
146
+ name: String
147
+ }
148
+ type Generation @key(fields: "name", resolvable: false) {
149
+ name: String
150
+ }
151
+ type GrowthRate {
152
+ name: String
153
+ }
154
+ type PalParkEncounter {
155
+ rate: Int
156
+ baseScore: Int
157
+ area: Area
158
+ }
159
+ type Area {
160
+ name: String
161
+ }
162
+ type PokedexNumber {
163
+ entryNumber: Int
164
+ pokedex: Pokedex
165
+ }
166
+ type Pokedex {
167
+ name: String
168
+ }
169
+ type PokemonSprites {
170
+ backDefault: String
171
+ backFemale: String
172
+ backShiny: String
173
+ backShinyFemale: String
174
+ frontDefault: String
175
+ frontFemale: String
176
+ frontShiny: String
177
+ frontShinyFemale: String
178
+ other: PokemonOtherSprites
179
+ }
180
+ type PokemonOtherSprites {
181
+ dreamWorld: ImageOptions
182
+ home: ImageOptions
183
+ showdown: ShowdownImageOptions
184
+ }
185
+ type ImageOptions {
186
+ frontDefault: String
187
+ frontFemale: String
188
+ frontShiny: String
189
+ frontShinyFemale: String
190
+ }
191
+ type ShowdownImageOptions {
192
+ frontDefault: String
193
+ frontFemale: String
194
+ frontShiny: String
195
+ frontShinyFemale: String
196
+ backDefault: String
197
+ backFemale: String
198
+ backShiny: String
199
+ backShinyFemale: String
200
+ }
201
+ type PokedexColor {
202
+ name: String
203
+ species: [PokemonSpecies]
204
+ }
205
+ type Query {
206
+ pokemon(limit: Int = 20, offset: Int = 0): PokemonConnection
207
+ @connect(
208
+ source: "pokeapi"
209
+ http: { GET: "/pokemon?limit={$args.limit}&offset={$args.offset}" }
210
+ selection: """
211
+ total: count
212
+ results {
213
+ name
214
+ }
215
+ """
216
+ )
217
+ "Colors used for sorting Pokémon in a Pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon's body. No orange category exists; Pokémon that are primarily orange are listed as red or brown."
218
+ pokemonColors(limit: Int = 20, offset: Int = 0): [PokedexColor]
219
+ @connect(
220
+ source: "pokeapi"
221
+ http: { GET: "/pokemon-color?limit={$args.limit}&offset={$args.offset}" }
222
+ selection: """
223
+ $.results {
224
+ name
225
+ }
226
+ """
227
+ )
228
+ "Colors used for sorting Pokémon in a Pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon's body. No orange category exists; Pokémon that are primarily orange are listed as red or brown."
229
+ pokemonColor(name: String!): PokedexColor
230
+ @connect(
231
+ source: "pokeapi"
232
+ http: { GET: "/pokemon-color/{$args.name}" }
233
+ selection: """
234
+ name
235
+ species: $.pokemon_species {
236
+ name
237
+ }
238
+ """
239
+ entity: true
240
+ )
241
+ pokemonByName(name: String!): Pokemon
242
+ @connect(
243
+ source: "pokeapi"
244
+ http: { GET: "/pokemon/{$args.name}" }
245
+ selection: """
246
+ id
247
+ name
248
+ height
249
+ weight
250
+ baseExperience: base_experience
251
+ abilities {
252
+ slot
253
+ isHidden: is_hidden
254
+ ability {
255
+ name
256
+ }
257
+ }
258
+ cries {
259
+ latest
260
+ legacy
261
+ }
262
+ gameIndices: $.game_indices {
263
+ gameIndex: game_index
264
+ version {
265
+ name
266
+ }
267
+ }
268
+ heldItems: $.held_items {
269
+ name
270
+ }
271
+ isDefault: is_default
272
+ moves {
273
+ name
274
+ versionGroupDetails: version_group_details {
275
+ levelLearnedAt: level_learned_at
276
+ moveLearnMethod: move_learn_method {
277
+ name
278
+ }
279
+ order
280
+ versionGroup: $.version_group {
281
+ name
282
+ }
283
+ }
284
+ }
285
+ species {
286
+ name
287
+ }
288
+ sprites {
289
+ backDefault: back_default
290
+ backFemale: back_female
291
+ backShiny: back_shiny
292
+ backShinyFemale: back_shiny_female
293
+ frontDefault: front_default
294
+ frontFemale: front_female
295
+ frontShiny: front_shiny
296
+ frontShinyFemale: front_shiny_female
297
+ other {
298
+ dreamWorld: dream_world {
299
+ frontDefault: front_default
300
+ frontFemale: front_female
301
+ frontShiny: front_shiny
302
+ frontShinyFemale: front_shiny_female
303
+ }
304
+ home {
305
+ frontDefault: front_default
306
+ frontFemale: front_female
307
+ frontShiny: front_shiny
308
+ frontShinyFemale: front_shiny_female
309
+ }
310
+ showdown {
311
+ frontDefault: front_default
312
+ frontFemale: front_female
313
+ frontShiny: front_shiny
314
+ frontShinyFemale: front_shiny_female
315
+ backDefault: back_default
316
+ backFemale: back_female
317
+ backShiny: back_shiny
318
+ backShinyFemale: back_shiny_female
319
+ }
320
+ }
321
+ }
322
+ stats {
323
+ # baseStat: base_stat
324
+ # effort
325
+ name: stat.name
326
+ }
327
+ """
328
+ entity: true
329
+ )
330
+ "Some Pokémon may appear in one of multiple, visually different forms. These differences are purely cosmetic. For variations within a Pokémon species, which do differ in more than just visuals, the 'Pokémon' entity is used to represent such a variety."
331
+ pokemonForm(name: String!): PokemonForm
332
+ @connect(
333
+ source: "pokeapi"
334
+ http: { GET: "/pokemon-form/{$args.name}" }
335
+ selection: """
336
+ name
337
+ formOrder: form_order
338
+ isBattleOnly: is_battle_only
339
+ isDefault: is_default
340
+ isMega: is_mega
341
+ order
342
+ pokemon {
343
+ name
344
+ }
345
+ sprites {
346
+ frontDefault: front_default
347
+ frontFemale: front_female
348
+ frontShiny: front_shiny
349
+ frontShinyFemale: front_shiny_female
350
+ backDefault: back_default
351
+ backFemale: back_female
352
+ backShiny: back_shiny
353
+ backShinyFemale: back_shiny_female
354
+ }
355
+ types {
356
+ slot
357
+ name: type.name
358
+ }
359
+ versionGroup: $.version_group {
360
+ name
361
+ }
362
+ """
363
+ entity: true
364
+ )
365
+ "Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon."
366
+ pokemonHabitat(name: String!): PokemonHabitat
367
+ @connect(
368
+ source: "pokeapi"
369
+ http: { GET: "/pokemon-habitat/{$args.name}" }
370
+ selection: """
371
+ name
372
+ pokemonSpecies: $.pokemon_species {
373
+ name
374
+ }
375
+ """
376
+ entity: true
377
+ )
378
+ "Shapes used for sorting Pokémon in a Pokédex."
379
+ pokemonShape(name: String!): PokemonShape
380
+ @connect(
381
+ source: "pokeapi"
382
+ http: { GET: "/pokemon-shape/{$args.name}" }
383
+ selection: """
384
+ name
385
+ pokemonSpecies: $.pokemon_species {
386
+ name
387
+ }
388
+ """
389
+ entity: true
390
+ )
391
+ "A Pokémon Species forms the basis for at least one Pokémon. Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant."
392
+ pokemonSpecies(name: String!): PokemonSpecies
393
+ @connect(
394
+ source: "pokeapi"
395
+ http: { GET: "/pokemon-species/{$args.name}" }
396
+ selection: """
397
+ baseHappiness: base_happiness
398
+ captureRate: capture_rate
399
+ color {
400
+ name
401
+ }
402
+ eggGroups: $.egg_groups {
403
+ name
404
+ }
405
+ generation {
406
+ name
407
+ }
408
+ growthRate: growth_rate {
409
+ name
410
+ }
411
+ habitat
412
+ hasGenderDifferences: has_gender_differences
413
+ hatchCounter: hatch_counter
414
+ isBaby: is_baby
415
+ isLegendary: is_legendary
416
+ isMythical: is_mythical
417
+ name
418
+ order
419
+ palParkEncounters: pal_park_encounters {
420
+ rate
421
+ baseScore: base_score
422
+ area {
423
+ name
424
+ }
425
+ }
426
+ pokedexNumber: $.pokedex_numbers {
427
+ entryNumber: entry_number
428
+ pokedex {
429
+ name
430
+ }
431
+ }
432
+ """
433
+ entity: true
434
+ )
435
+ stats: [PokemonStat]
436
+ @connect(
437
+ source: "pokeapi"
438
+ http: { GET: "/pokemon-stat" }
439
+ selection: """
440
+ $.results {
441
+ name
442
+ }
443
+ """
444
+ )
445
+ stat(name: String!): PokemonStat
446
+ @connect(
447
+ source: "pokeapi"
448
+ http: { GET: "/pokemon-stat/{$args.name}" }
449
+ selection: """
450
+ affectingMoves: affecting_moves {
451
+ decrease {
452
+ change
453
+ move {
454
+ name
455
+ }
456
+ }
457
+ increase {
458
+ change
459
+ move {
460
+ name
461
+ }
462
+ }
463
+ }
464
+ affectingNatures: affecting_natures {
465
+ decrease {
466
+ name
467
+ }
468
+ increase {
469
+ name
470
+ }
471
+ }
472
+ gameIndex: game_index
473
+ isBattleOnly: is_battle_only
474
+ moveDamageClass: $.move_damage_class {
475
+ name
476
+ }
477
+ name
478
+ """
479
+ entity: true
480
+ )
481
+ }
482
+ type PokemonShape {
483
+ name: String
484
+ pokemonSpecies: [PokemonSpecies]
485
+ }
486
+ type PokemonHabitat {
487
+ name: String
488
+ pokemonSpecies: [PokemonSpecies]
489
+ }
490
+ type PokemonForm {
491
+ name: String
492
+ formOrder: Int
493
+ isBattleOnly: Boolean
494
+ isDefault: Boolean
495
+ isMega: Boolean
496
+ order: Int
497
+ pokemon: Pokemon
498
+ sprites: ShowdownImageOptions
499
+ types: [PokemonType]
500
+ versionGroup: VersionGroup
501
+ }
502
+ type PokemonType {
503
+ slot: Int
504
+ name: String
505
+ }
506
+ # type PokemonStat {
507
+ # baseStat: Int
508
+ # effort: Int
509
+ # name: String
510
+ # }
511
+ type PokemonStat {
512
+ name: String
513
+ affectingMoves: AffectingMoves
514
+ affectingNatures: AffectingNatures
515
+ gameIndex: Int
516
+ isBattleOnly: Boolean
517
+ moveDamageClass: MoveDamageClass
518
+ }
519
+ type AffectingMoves {
520
+ decrease: [AffectingMove]
521
+ increase: [AffectingMove]
522
+ }
523
+ type AffectingMove {
524
+ change: Int
525
+ move: Move
526
+ }
527
+ type AffectingNatures {
528
+ decrease: [Nature]
529
+ increase: [Nature]
530
+ }
531
+ type Nature {
532
+ name: String
533
+ }
534
+ type MoveDamageClass {
535
+ name: String
536
+ }
537
+ type Version @key(fields: "name", resolvable: false) {
538
+ name: String
539
+ }
@@ -0,0 +1,18 @@
1
+ supergraph:
2
+ listen: 0.0.0.0:${env.PORT:-4000}
3
+
4
+ headers:
5
+ all:
6
+ request:
7
+ - propagate:
8
+ matching: .*
9
+ telemetry:
10
+ instrumentation:
11
+ spans:
12
+ mode: spec_compliant
13
+
14
+ # connectors:
15
+ # subgraphs:
16
+ # connector:
17
+ # $config:
18
+ # apiKey: ${env.API_KEY}
@@ -0,0 +1,18 @@
1
+ federation_version: =2.11.0
2
+ subgraphs:
3
+ games:
4
+ routing_url: http://games
5
+ schema:
6
+ file: games.graphql
7
+ locations:
8
+ routing_url: http://locations
9
+ schema:
10
+ file: locations.graphql
11
+ moves:
12
+ routing_url: http://moves
13
+ schema:
14
+ file: moves.graphql
15
+ pokemon:
16
+ routing_url: http://pokemon
17
+ schema:
18
+ file: pokemon.graphql
@@ -0,0 +1,75 @@
1
+ # Strapi REST Connector
2
+
3
+ This connector currently covers the users [content-type](https://docs.strapi.io/cms/backend-customization/models) in Strapi.
4
+
5
+ ## Prerequisites
6
+
7
+ To use the connector, you need a [Strapi API token](https://docs.strapi.io/cms/features/api-tokens).
8
+
9
+ ## Getting started
10
+
11
+ 1. If you haven't already, [create a new graph in GraphOS](https://www.apollographql.com/docs/graphos/get-started/guides/rest#step-1-set-up-your-graphql-api). Once you get to the **Set up your local development environment** modal in the [Create a graph](https://www.apollographql.com/docs/graphos/get-started/guides/rest#create-a-graph) section:
12
+ - Copy the `supergraph.yaml` and `router.yaml` files from this folder instead of the `supergraph.yaml` provided by the modal.
13
+ - Instead of downloading the example schema provided by the modal, copy the `users.graphql` schema file.
14
+ 1. Grab your Strapi API key and set it as an environment variable for your terminal:
15
+
16
+ ```
17
+ export STRAPI_API_KEY=....
18
+ ```
19
+
20
+ 1. Run `rover dev` to start the local development session:
21
+
22
+ ```
23
+ APOLLO_KEY=service:My-Graph-s1ff1u:•••••••••••••••••••••• \
24
+ APOLLO_GRAPH_REF=My-Graph-s1ff1u@main \
25
+ rover dev --supergraph-config supergraph.yaml --router-config router.yaml
26
+ ```
27
+
28
+ You’re all set! Open up http://localhost:4000 to query your graph using Apollo Sandbox.
29
+
30
+ ### Adding to an existing graph in GraphOS
31
+
32
+ To add these connectors to an existing graph, publish the schema files to your graph ref using `rover subgraph publish`:
33
+
34
+ ```
35
+ APOLLO_KEY=service:My-Graph-s1ff1u:•••••••••••••••••••••• \
36
+ rover subgraph publish My-Graph-s1ff1u@main --name users --schema users.graphql --routing-url http://users
37
+ ```
38
+
39
+ ## Additional setup for VS Code task runner
40
+
41
+ Edit your `.vscode/settings.json` to include the following Strapi-specific keys
42
+
43
+ ```
44
+ {
45
+ "terminal.integrated.profiles.osx": {
46
+ "graphos": {
47
+ "path": "zsh",
48
+ "args": ["-l"],
49
+ "env": {
50
+ "STRAPI_URL: "",
51
+ "STRAPI_API_KEY": "",
52
+ }
53
+ }
54
+ },
55
+ "terminal.integrated.defaultProfile.osx": "graphos"
56
+ }
57
+
58
+ ```
59
+
60
+ Once you've set this up, you can execute the `Tasks: Run Task` command in VS Code to run the `rover dev` task.
61
+ Alternatively, you can open a new terminal window in VS Code with the `graphos` profile, then run `rover dev --supergraph-config supergraph.yaml --router-config router.yaml`.
62
+
63
+ ## Contributing
64
+
65
+ The following schema modules can be added to this connector:
66
+
67
+ - [Roles](https://docs.strapi.io/user-docs/users-roles-permissions/configuring-end-users-roles)
68
+
69
+ To contribute them, make sure to:
70
+
71
+ 1. Add a schema designed for the module as a new `.graphql` file.
72
+ 2. Update the `router.yaml` and `supergraph.yaml` files accordingly.
73
+
74
+
75
+ See [REST API reference](https://docs.strapi.io/cms/api/rest) for other modules that can be implemented. You can use the current modules in this folder as examples to work with.
@@ -0,0 +1,19 @@
1
+ supergraph:
2
+ listen: 0.0.0.0:${env.PORT:-4000}
3
+
4
+ headers:
5
+ all:
6
+ request:
7
+ - propagate:
8
+ matching: .*
9
+ connectors:
10
+ subgraphs:
11
+ strapi-users:
12
+ $config:
13
+ apiKey: ${env.STRAPI_API_KEY}
14
+ telemetry:
15
+ instrumentation:
16
+ spans:
17
+ mode: spec_compliant
18
+ override_subgraph_url:
19
+ strapi-users: ${env.STRAPI_URL:-http://localhost:1337/api}
@@ -0,0 +1,6 @@
1
+ federation_version: =2.11.0
2
+ subgraphs:
3
+ strapi-users:
4
+ routing_url: http://apiusers
5
+ schema:
6
+ file: users.graphql