vscode-apollo 2.5.3 → 2.5.5

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.
@@ -68,7 +68,7 @@ jobs:
68
68
  gh release upload "v$VERSION" "vscode-apollo-$VERSION.vsix"
69
69
  env:
70
70
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71
- VERSION: ${{steps.changesets.outputs.publishedPackages[0].version}}
71
+ VERSION: ${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}
72
72
 
73
73
  - name: Publish to Open VSX Registry
74
74
  if: steps.changesets.outcome == 'success' && steps.changesets.outputs.published == 'true'
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.5.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#280](https://github.com/apollographql/vscode-graphql/pull/280) [`ce6b4a8`](https://github.com/apollographql/vscode-graphql/commit/ce6b4a840d94c95efa19b645077230c422f0616e) Thanks [@pubmodmatt](https://github.com/pubmodmatt)! - Fix an issue where adding a new Apollo configuration file would not be detected
8
+
9
+ - [#278](https://github.com/apollographql/vscode-graphql/pull/278) [`ff969e6`](https://github.com/apollographql/vscode-graphql/commit/ff969e6d64b6aa8ed865215d71344c41e85da19f) Thanks [@Meschreiber](https://github.com/Meschreiber)! - Update README/Marketplace page
10
+
11
+ ## 2.5.4
12
+
13
+ ### Patch Changes
14
+
15
+ - [#267](https://github.com/apollographql/vscode-graphql/pull/267) [`8706670`](https://github.com/apollographql/vscode-graphql/commit/8706670810493c3574ecc66f9262e8fd025604dc) Thanks [@phryneas](https://github.com/phryneas)! - Adjustments to fix Release process
16
+
3
17
  ## 2.5.3
4
18
 
5
19
  ### Patch Changes
package/README.md CHANGED
@@ -15,24 +15,31 @@ Thanks to its strongly typed schema and query language, GraphQL has the potentia
15
15
 
16
16
  The Apollo GraphQL extension for VS Code brings an all-in-one tooling experience for developing apps with Apollo.
17
17
 
18
- - Add [syntax highlighting](#syntax-highlighting) for GraphQL files and gql templates inside JavaScript files
19
- - Get instant feedback and [intelligent autocomplete](#intelligent-autocomplete) for fields, arguments, types, and variables as you write queries
20
- - Manage client-side schema alongside remote schema
21
- - See [performance information](#performance-insights) inline with your query definitions
22
- - Extra features to help you with [supergraph editing](#supergraph-editing)
23
- - Validate field and argument usage in operations
24
- - [Navigate projects more easily](#navigating-projects) with jump-to and peek-at definitions
25
- - Manage [client-only](#client-only-schemas) schemas
18
+ The extension provides:
19
+
20
+ - [Syntax highlighting](#syntax-highlighting) for GraphQL files and `gql` templates in JavaScript
21
+ - Real-time feedback, including [intelligent autocomplete](#intelligent-autocomplete) for fields, arguments, types, and variables as you write queries
22
+ - Client-side and remote schema management, including [client-only](#client-only-schemas) schemas
23
+ - Inline [performance information](#performance-insights) and [supergraph editing](#supergraph-editing) tool
24
+ - [Streamlined project navigation](#navigating-projects) with jump-to and peek-at definitions
26
25
  - [Switch graph variants](#graph-variant-switching) to work with schemas running on different environments
26
+ - (Experimental) [Apollo Client DevTools](#devtools) in your IDE
27
+
28
+ Starting with version 2.3.3, the extension also works with Apollo Connectors. [Learn more.](#developing-connectors)
27
29
 
28
30
  <h2 id="getting-started">Getting started</h2>
29
31
 
30
- The VS Code plugin must be linked to a published or local schema. To do so, create an `apollo.config.json` file at the root of the project.
32
+
33
+ The VS Code extension must be linked to a published or local schema via a configuration file.
34
+
35
+ <h3 id="configuration">Configuration</h3>
36
+
37
+ The VS Code extension requires a `apollo.config.json` configuration file at the root of the project.
31
38
  Alternatively, you can create a `yaml`, `cjs`, `mjs`, or `ts` file with the same configuration.
32
39
 
33
- For the contents of this configuration file, select one of these options:
40
+ Select one of the options below to define the contents of this configuration file.
34
41
 
35
- <h3>Configure extension for client development with schemas published to Apollo GraphOS</h3>
42
+ <h4>Configure extension for client development with schemas published to Apollo GraphOS</h4>
36
43
  <details>
37
44
  <summary>
38
45
  <i>Expand for instructions.</i>
@@ -70,7 +77,7 @@ Afterward, reload VS Code. The Apollo integration will connect to GraphOS Studio
70
77
 
71
78
  </details>
72
79
 
73
- <h3>Configure extension for supergraph schema development</h3>
80
+ <h4>Configure extension for supergraph schema development</h4>
74
81
  <details>
75
82
  <summary>
76
83
  <i>Expand for instructions.</i>
@@ -107,7 +114,7 @@ Afterward, reload VS Code. The Apollo extension will start using Rover to help y
107
114
 
108
115
  </details>
109
116
 
110
- <h3 id="local-schemas">Configure extension for client development with introspection from a locally running service</h3>
117
+ <h4 id="local-schemas">Configure extension for client development with introspection from a locally running service</h4>
111
118
  <details>
112
119
  <summary>
113
120
  <i>Expand for instructions.</i>
@@ -130,7 +137,7 @@ Linking to local schemas won't provide all extension features, such as switching
130
137
 
131
138
  </details>
132
139
 
133
- <h3 id="local-schema-files">Configure extension for client development with local schema files</h3>
140
+ <h4 id="local-schema-files">Configure extension for client development with local schema files</h4>
134
141
  <details>
135
142
  <summary>
136
143
  <i>Expand for instructions.</i>
@@ -153,7 +160,7 @@ To link to a local schema file, add the following to the `apollo.config.json` fi
153
160
 
154
161
  </details>
155
162
 
156
- <h3 id="client-only-schemas">Bonus: Adding client-only schemas</h3>
163
+ <h4 id="client-only-schemas">Bonus: Adding client-only schemas</h4>
157
164
  <details>
158
165
  <summary>
159
166
  <i>Expand for instructions.</i>
@@ -243,6 +250,64 @@ Navigating large codebases can be difficult, but the Apollo GraphQL extension ma
243
250
 
244
251
  Apollo supports publishing multiple versions ([variants](https://www.apollographql.com/docs/graphos/graphs/#variants)) of a schema. This is useful for developing on a future development schema and preparing your clients to conform to that schema. To switch between graph variants, open the Command Palette (`cmd + shift + p` on mac), search "Apollo" and choose the "Apollo: Select Schema Tag" option.
245
252
 
253
+ <h3 id="developing-connectors">Developing Connectors</h3>
254
+
255
+ Starting with version 2.3.3, the Apollo GraphQL VS Code extension can give you fast feedback on your Apollo Connectors in VS Code. Through it, you can get the _same_ validations that composition provides, with errors and hints highlighted in your schema file on each save.
256
+
257
+ <h4 id="prerequisites">Prerequisites</h4>
258
+
259
+ These composition-based diagnostics are powered by Rover. You'll need Rover version 0.27.0 or later [installed](/rover/getting-started) to use composition-based diagnostics.
260
+
261
+ <h4 id="connector-configuration">Connector Configuration</h4>
262
+
263
+ By default, you need two files in the root of your project to enable connector validations in VS Code:
264
+
265
+ 1. An `apollo.config.yaml` file containing `rover: {}`
266
+ 2. A `supergraph.yaml` file that's the
267
+ [configuration file](/rover/commands/supergraphs#yaml-configuration-file)
268
+ used for `rover dev`, `rover supergraph compose`, and this VS Code extension.
269
+ 1. Make sure to set the composition version to {products.federation.version("connectors").version}.
270
+ 2. Make sure every file you want feedback on is included in the `subgraphs` section.
271
+
272
+ You can use a different location for your `supergraph.yaml` by setting the `rover.supergraphConfig` option in
273
+ `apollo.config.yaml`, like this:
274
+
275
+ ```yaml title="apollo.config.yaml"
276
+ rover:
277
+ supergraphConfig: path/to/supergraph.yaml
278
+ ```
279
+
280
+ <h3 id="devtools">(Experimental) Apollo Client DevTools in your IDE</h3>
281
+
282
+ The Apollo VSCode extension ships with an instance of the [Apollo Client Devtools](https://chromewebstore.google.com/detail/apollo-client-devtools/jdkknkkbebbapilgoeccciglkfbmbnfm).
283
+ You can use it to remotely debug your client, making it easier to debug React Native and Node.js applications.
284
+
285
+ To configure it, follow these steps:
286
+
287
+ 1. In the VS code settings dialog, set the **Apollographql > Dev Tools: Show Panel** setting to `detect` or `always`.
288
+ 1. In your code base, install the `@apollo/client-devtools-vscode` package:
289
+
290
+ ```sh
291
+ npm install @apollo/client-devtools-vscode
292
+ ```
293
+
294
+ 1. After initializing your `ApolloClient` instance, call `connectApolloClientToVSCodeDevTools` with your client instance.
295
+
296
+ ```js
297
+ import { connectApolloClientToVSCodeDevTools } from "@apollo/client-devtools-vscode";
298
+
299
+ const client = new ApolloClient({ /* ... */ });
300
+
301
+ // We recommend wrapping this statement in a check for e.g. process.env.NODE_ENV === "development"
302
+ const devtoolsRegistration = connectApolloClientToVSCodeDevTools(
303
+ client,
304
+ // the default port of the VSCode DevTools is 7095
305
+ "ws://localhost:7095",
306
+ );
307
+ ```
308
+ 1. Open the **Apollo Client DevTools** panel in VS Code.
309
+ 1. Start your application. It should automatically connect to the DevTools.
310
+
246
311
  <h2 id="troubleshooting">Troubleshooting</h2>
247
312
 
248
313
  The most common errors are configuration errors, like a missing `.env` file or incorrect service information in the `apollo.config.json` file. Please see [the Apollo config docs](https://www.apollographql.com/docs/devtools/apollo-config/) for more configuration guidance.
@@ -255,6 +320,30 @@ Sometimes, errors will appear as a notification at the bottom of your editor. Ot
255
320
 
256
321
  If problems persist or the error messages are unhelpful, open an [issue](https://github.com/apollographql/vscode-graphql/issues) in the `vscode-graphql` repository.
257
322
 
323
+ <h3 id="reloading-extension">Reloading the extension</h3>
324
+
325
+ If you aren't seeing diagnostics, try reloading the extension by running the `Apollo: Reload schema` command from the command palette.
326
+
327
+ <h3 id="turn-on-autosave">Turn on autosave</h3>
328
+
329
+ Most diagnostics will only appear when you save your schema file.
330
+ If you enable autosave in VS Code, you'll see feedback each time you finish typing.
331
+
332
+ <h3 id="double-check-rover-version">Double-check your Rover version</h3>
333
+
334
+ If you aren't seeing diagnostics for Apollo Connectors, run `rover --version` in a terminal to ensure you have version 0.27.0 or later.
335
+ You can also specify a path to a specific Rover binary in your `apollo.config.yaml` file:
336
+
337
+ ```yaml title="apollo.config.yaml"
338
+ rover:
339
+ bin: /path/to/rover
340
+ ```
341
+
342
+ <h3 id="debug-logging">Debug logging</h3>
343
+
344
+ If the extension isn't working as expected, you can set the apollographql.trace.server setting to verbose in your VS Code settings.
345
+ This setting adds detailed logs to the output panel of the extension, which can aid in debugging.
346
+
258
347
  <h2 id="additional-apollo-config-options">Additional Apollo config options</h2>
259
348
 
260
349
  You can add these configurations to your [Apollo config file](#setting-up-an-apollo-config).
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "vscode-apollo",
3
3
  "displayName": "Apollo GraphQL",
4
4
  "description": "Rich editor support for GraphQL client and server development that seamlessly integrates with the Apollo platform",
5
- "version": "2.5.3",
5
+ "version": "2.5.5",
6
6
  "referenceID": "87197759-7617-40d0-b32e-46d378e907c7",
7
7
  "author": "Apollo GraphQL <opensource@apollographql.com>",
8
8
  "license": "MIT",
@@ -56,7 +56,7 @@
56
56
  "minimatch": "10.0.1",
57
57
  "moment": "2.30.1",
58
58
  "semver": "7.6.3",
59
- "undici": "6.21.0",
59
+ "undici": "6.21.1",
60
60
  "vscode-languageclient": "9.0.1",
61
61
  "vscode-languageserver": "9.0.1",
62
62
  "vscode-languageserver-textdocument": "1.0.12",
@@ -228,12 +228,12 @@ export class GraphQLWorkspace {
228
228
  folder: { uri: folderUri } as WorkspaceFolder,
229
229
  });
230
230
 
231
+ this.reloadService();
231
232
  const existingProjects = this.projectsByFolderUri.get(folderUri) || [];
232
233
  this.projectsByFolderUri.set(folderUri, [
233
234
  ...existingProjects,
234
235
  newProject,
235
236
  ]);
236
- this.reloadService();
237
237
  }
238
238
  }
239
239
 
@@ -52,9 +52,8 @@ export function getLanguageServerClient(
52
52
  documentSelector: supportedLanguageIds,
53
53
  synchronize: {
54
54
  fileEvents: [
55
- workspace.createFileSystemWatcher(
56
- "**/{.env?(.local),apollo.config.{json,yml,yaml}}",
57
- ),
55
+ workspace.createFileSystemWatcher("**/{.env?(.local)}"),
56
+ workspace.createFileSystemWatcher("**/apollo.config.{json,yml,yaml}"),
58
57
  workspace.createFileSystemWatcher(
59
58
  "**/*{" + supportedExtensions.join(",") + "}",
60
59
  ),