vscode-apollo 1.20.0 → 2.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 (109) hide show
  1. package/.circleci/config.yml +27 -18
  2. package/.git-blame-ignore-revs +2 -0
  3. package/.nvmrc +1 -1
  4. package/.vscode/launch.json +9 -4
  5. package/.vscode/tasks.json +58 -16
  6. package/.vscodeignore +12 -1
  7. package/CHANGELOG.md +84 -0
  8. package/CODEOWNERS +4 -0
  9. package/README.md +97 -48
  10. package/graphql.configuration.json +5 -1
  11. package/images/marketplace/apollo-wordmark.png +0 -0
  12. package/jest.config.ts +14 -4
  13. package/jest.e2e.config.js +17 -0
  14. package/package.json +67 -68
  15. package/renovate.json +7 -0
  16. package/sampleWorkspace/clientSchema/apollo.config.cjs +10 -0
  17. package/sampleWorkspace/clientSchema/src/clientSchema.js +16 -0
  18. package/sampleWorkspace/clientSchema/src/test.js +18 -0
  19. package/sampleWorkspace/fixtures/starwarsSchema.graphql +299 -0
  20. package/sampleWorkspace/httpSchema/apollo.config.ts +8 -0
  21. package/sampleWorkspace/httpSchema/src/test.js +9 -0
  22. package/sampleWorkspace/localSchema/apollo.config.js +8 -0
  23. package/sampleWorkspace/localSchema/src/test.js +8 -0
  24. package/sampleWorkspace/localSchemaArray/apollo.config.js +12 -0
  25. package/sampleWorkspace/localSchemaArray/planets.graphql +20 -0
  26. package/sampleWorkspace/localSchemaArray/src/test.js +12 -0
  27. package/sampleWorkspace/sampleWorkspace.code-workspace +20 -0
  28. package/sampleWorkspace/spotifyGraph/apollo.config.mjs +5 -0
  29. package/sampleWorkspace/spotifyGraph/src/test.js +11 -0
  30. package/src/__e2e__/mockServer.js +117 -0
  31. package/src/__e2e__/mocks.js +13094 -0
  32. package/src/__e2e__/run.js +23 -0
  33. package/src/__e2e__/runTests.js +44 -0
  34. package/src/__e2e__/setup.js +1 -0
  35. package/src/__e2e__/vscode-environment.js +16 -0
  36. package/src/__e2e__/vscode.js +1 -0
  37. package/src/build.js +57 -0
  38. package/src/env/index.ts +0 -3
  39. package/src/extension.ts +251 -225
  40. package/src/language-server/__e2e__/clientSchema.e2e.ts +147 -0
  41. package/src/language-server/__e2e__/httpSchema.e2e.ts +21 -0
  42. package/src/language-server/__e2e__/localSchema.e2e.ts +25 -0
  43. package/src/language-server/__e2e__/localSchemaArray.e2e.ts +31 -0
  44. package/src/language-server/__e2e__/studioGraph.e2e.ts +65 -0
  45. package/src/language-server/__e2e__/utils.ts +151 -0
  46. package/src/language-server/__tests__/diagnostics.test.ts +8 -8
  47. package/src/language-server/__tests__/fileSet.test.ts +1 -1
  48. package/src/language-server/__tests__/fixtures/starwarsSchema.ts +2 -2
  49. package/src/language-server/config/__tests__/config.ts +22 -96
  50. package/src/language-server/config/__tests__/loadConfig.ts +120 -220
  51. package/src/language-server/config/__tests__/utils.ts +22 -29
  52. package/src/language-server/config/config.ts +221 -156
  53. package/src/language-server/config/loadConfig.ts +32 -153
  54. package/src/language-server/config/loadTsConfig.ts +70 -0
  55. package/src/language-server/config/utils.ts +5 -16
  56. package/src/language-server/diagnostics.ts +17 -8
  57. package/src/language-server/document.ts +16 -16
  58. package/src/language-server/engine/index.ts +57 -39
  59. package/src/language-server/engine/operations/frontendUrlRoot.ts +9 -1
  60. package/src/language-server/engine/operations/schemaTagsAndFieldStats.ts +9 -1
  61. package/src/language-server/errors/__tests__/NoMissingClientDirectives.test.ts +10 -5
  62. package/src/language-server/errors/logger.ts +1 -1
  63. package/src/language-server/errors/validation.ts +20 -23
  64. package/src/language-server/fileSet.ts +10 -12
  65. package/src/language-server/format.ts +1 -1
  66. package/src/language-server/graphqlTypes.ts +13020 -3455
  67. package/src/language-server/index.ts +0 -1
  68. package/src/language-server/languageProvider.ts +29 -32
  69. package/src/language-server/loadingHandler.ts +10 -27
  70. package/src/language-server/project/base.ts +32 -25
  71. package/src/language-server/project/client.ts +80 -114
  72. package/src/language-server/project/defaultClientSchema.ts +29 -4
  73. package/src/language-server/providers/schema/__tests__/file.ts +60 -19
  74. package/src/language-server/providers/schema/base.ts +2 -2
  75. package/src/language-server/providers/schema/endpoint.ts +15 -34
  76. package/src/language-server/providers/schema/engine.ts +25 -18
  77. package/src/language-server/providers/schema/file.ts +41 -32
  78. package/src/language-server/providers/schema/index.ts +5 -21
  79. package/src/language-server/server.ts +72 -50
  80. package/src/language-server/typings/graphql.d.ts +3 -3
  81. package/src/language-server/utilities/__tests__/graphql.test.ts +42 -54
  82. package/src/language-server/utilities/debouncer.ts +1 -1
  83. package/src/language-server/utilities/debug.ts +6 -5
  84. package/src/language-server/utilities/graphql.ts +17 -16
  85. package/src/language-server/utilities/source.ts +16 -16
  86. package/src/language-server/utilities/uri.ts +2 -2
  87. package/src/language-server/workspace.ts +29 -37
  88. package/src/languageServerClient.ts +4 -4
  89. package/src/messages.ts +38 -47
  90. package/src/tools/__tests__/buildServiceDefinition.test.ts +2 -2
  91. package/src/tools/buildServiceDefinition.ts +11 -11
  92. package/src/tools/schema/resolveObject.ts +1 -1
  93. package/src/tools/utilities/predicates.ts +1 -1
  94. package/src/utils.ts +7 -6
  95. package/syntaxes/graphql.dart.json +2 -4
  96. package/syntaxes/graphql.ex.json +1 -4
  97. package/tsconfig.build.json +8 -1
  98. package/tsconfig.json +5 -3
  99. package/src/env/fetch/fetch.ts +0 -32
  100. package/src/env/fetch/global.ts +0 -30
  101. package/src/env/fetch/index.d.ts +0 -2
  102. package/src/env/fetch/index.ts +0 -2
  103. package/src/env/fetch/url.ts +0 -9
  104. package/src/env/polyfills/array.ts +0 -17
  105. package/src/env/polyfills/index.ts +0 -2
  106. package/src/env/polyfills/object.ts +0 -7
  107. package/src/language-server/engine/GraphQLDataSource.ts +0 -124
  108. package/src/language-server/project/service.ts +0 -48
  109. package/src/language-server/typings/codemirror.d.ts +0 -4
@@ -7,7 +7,6 @@ export { LoadingHandler } from "./loadingHandler";
7
7
  // projects
8
8
  export { GraphQLProject } from "./project/base";
9
9
  export { isClientProject, GraphQLClientProject } from "./project/client";
10
- export { isServiceProject, GraphQLServiceProject } from "./project/service";
11
10
 
12
11
  // GraphQLSchemaProvider
13
12
  export {
@@ -16,15 +16,12 @@ import {
16
16
  CodeActionKind,
17
17
  MarkupKind,
18
18
  CompletionItemKind,
19
- } from "vscode-languageserver";
19
+ } from "vscode-languageserver/node";
20
20
 
21
21
  // should eventually be moved into this package, since we're overriding a lot of the existing behavior here
22
- import { getAutocompleteSuggestions } from "graphql-language-service-interface";
23
- import { Position as GraphQlPosition } from "graphql-language-service-utils";
24
- import {
25
- getTokenAtPosition,
26
- getTypeInfo,
27
- } from "graphql-language-service-interface/dist/getAutocompleteSuggestions";
22
+ import { getAutocompleteSuggestions } from "graphql-language-service";
23
+ import { Position as GraphQlPosition } from "graphql-language-service";
24
+ import { getTokenAtPosition, getTypeInfo } from "graphql-language-service";
28
25
  import type { GraphQLWorkspace } from "./workspace";
29
26
  import type { DocumentUri } from "./project/base";
30
27
 
@@ -65,7 +62,7 @@ import { GraphQLClientProject, isClientProject } from "./project/client";
65
62
  import { isNotNullOrUndefined } from "../tools";
66
63
  import type { CodeActionInfo } from "./errors/validation";
67
64
  import { GraphQLDiagnostic } from "./diagnostics";
68
- import type { ProjectStats } from "src/messages";
65
+ import type { ProjectStats } from "../messages";
69
66
  import { isInterfaceType } from "graphql";
70
67
 
71
68
  const DirectiveLocations = Object.keys(DirectiveLocation);
@@ -93,7 +90,7 @@ function locationForASTNode(node: ASTNode): Location | null {
93
90
  }
94
91
 
95
92
  function symbolForFieldDefinition(
96
- definition: FieldDefinitionNode
93
+ definition: FieldDefinitionNode,
97
94
  ): DocumentSymbol {
98
95
  return {
99
96
  name: definition.name.value,
@@ -118,7 +115,7 @@ export class GraphQLLanguageProvider {
118
115
  async provideCompletionItems(
119
116
  uri: DocumentUri,
120
117
  position: Position,
121
- _token: CancellationToken
118
+ _token: CancellationToken,
122
119
  ): Promise<CompletionItem[]> {
123
120
  const project = this.workspace.projectForFile(uri);
124
121
  if (!(project && project instanceof GraphQLClientProject)) return [];
@@ -130,11 +127,11 @@ export class GraphQLLanguageProvider {
130
127
 
131
128
  const rawPositionInDocument = positionFromPositionInContainingDocument(
132
129
  document.source,
133
- position
130
+ position,
134
131
  );
135
132
  const positionInDocument = new GraphQlPosition(
136
133
  rawPositionInDocument.line,
137
- rawPositionInDocument.character
134
+ rawPositionInDocument.character,
138
135
  );
139
136
 
140
137
  const token = getTokenAtPosition(document.source.body, positionInDocument);
@@ -152,7 +149,7 @@ export class GraphQLLanguageProvider {
152
149
  const suggestions = getAutocompleteSuggestions(
153
150
  project.schema,
154
151
  document.source.body,
155
- positionInDocument
152
+ positionInDocument,
156
153
  );
157
154
 
158
155
  if (
@@ -185,7 +182,7 @@ export class GraphQLLanguageProvider {
185
182
  return suggest;
186
183
  } else {
187
184
  const requiredArgs = suggestedField.args.filter((a) =>
188
- isNonNullType(a.type)
185
+ isNonNullType(a.type),
189
186
  );
190
187
  const paramsSection =
191
188
  requiredArgs.length > 0
@@ -239,7 +236,7 @@ export class GraphQLLanguageProvider {
239
236
 
240
237
  const content = [
241
238
  [`\`\`\`graphql`, `@${suggest.label}${argsString}`, `\`\`\``].join(
242
- "\n"
239
+ "\n",
243
240
  ),
244
241
  ];
245
242
 
@@ -273,7 +270,7 @@ export class GraphQLLanguageProvider {
273
270
  async provideHover(
274
271
  uri: DocumentUri,
275
272
  position: Position,
276
- _token: CancellationToken
273
+ _token: CancellationToken,
277
274
  ): Promise<Hover | null> {
278
275
  const project = this.workspace.projectForFile(uri);
279
276
  if (!(project && project instanceof GraphQLClientProject)) return null;
@@ -285,14 +282,14 @@ export class GraphQLLanguageProvider {
285
282
 
286
283
  const positionInDocument = positionFromPositionInContainingDocument(
287
284
  document.source,
288
- position
285
+ position,
289
286
  );
290
287
 
291
288
  const nodeAndTypeInfo = getASTNodeAndTypeInfoAtPosition(
292
289
  document.source,
293
290
  positionInDocument,
294
291
  document.ast,
295
- project.schema
292
+ project.schema,
296
293
  );
297
294
 
298
295
  if (nodeAndTypeInfo) {
@@ -332,7 +329,7 @@ export class GraphQLLanguageProvider {
332
329
  const isResolvedLocally =
333
330
  node.directives &&
334
331
  node.directives.some(
335
- (directive) => directive.name.value === "client"
332
+ (directive) => directive.name.value === "client",
336
333
  );
337
334
 
338
335
  const content = [
@@ -370,7 +367,7 @@ export class GraphQLLanguageProvider {
370
367
 
371
368
  case Kind.NAMED_TYPE: {
372
369
  const type = project.schema.getType(
373
- node.name.value
370
+ node.name.value,
374
371
  ) as GraphQLNamedType | void;
375
372
  if (!type) break;
376
373
 
@@ -436,7 +433,7 @@ export class GraphQLLanguageProvider {
436
433
  async provideDefinition(
437
434
  uri: DocumentUri,
438
435
  position: Position,
439
- _token: CancellationToken
436
+ _token: CancellationToken,
440
437
  ): Promise<Definition | null> {
441
438
  const project = this.workspace.projectForFile(uri);
442
439
  if (!(project && project instanceof GraphQLClientProject)) return null;
@@ -448,14 +445,14 @@ export class GraphQLLanguageProvider {
448
445
 
449
446
  const positionInDocument = positionFromPositionInContainingDocument(
450
447
  document.source,
451
- position
448
+ position,
452
449
  );
453
450
 
454
451
  const nodeAndTypeInfo = getASTNodeAndTypeInfoAtPosition(
455
452
  document.source,
456
453
  positionInDocument,
457
454
  document.ast,
458
- project.schema
455
+ project.schema,
459
456
  );
460
457
 
461
458
  if (nodeAndTypeInfo) {
@@ -500,7 +497,7 @@ export class GraphQLLanguageProvider {
500
497
  uri: DocumentUri,
501
498
  position: Position,
502
499
  _context: ReferenceContext,
503
- _token: CancellationToken
500
+ _token: CancellationToken,
504
501
  ): Promise<Location[] | null> {
505
502
  const project = this.workspace.projectForFile(uri);
506
503
  if (!project) return null;
@@ -511,14 +508,14 @@ export class GraphQLLanguageProvider {
511
508
 
512
509
  const positionInDocument = positionFromPositionInContainingDocument(
513
510
  document.source,
514
- position
511
+ position,
515
512
  );
516
513
 
517
514
  const nodeAndTypeInfo = getASTNodeAndTypeInfoAtPosition(
518
515
  document.source,
519
516
  positionInDocument,
520
517
  document.ast,
521
- project.schema
518
+ project.schema,
522
519
  );
523
520
 
524
521
  if (nodeAndTypeInfo) {
@@ -579,7 +576,7 @@ export class GraphQLLanguageProvider {
579
576
 
580
577
  async provideDocumentSymbol(
581
578
  uri: DocumentUri,
582
- _token: CancellationToken
579
+ _token: CancellationToken,
583
580
  ): Promise<DocumentSymbol[]> {
584
581
  const project = this.workspace.projectForFile(uri);
585
582
  if (!project) return [];
@@ -628,7 +625,7 @@ export class GraphQLLanguageProvider {
628
625
 
629
626
  async provideWorkspaceSymbol(
630
627
  query: string,
631
- _token: CancellationToken
628
+ _token: CancellationToken,
632
629
  ): Promise<SymbolInformation[]> {
633
630
  const symbols: SymbolInformation[] = [];
634
631
  for (const project of this.workspace.projects) {
@@ -650,7 +647,7 @@ export class GraphQLLanguageProvider {
650
647
 
651
648
  async provideCodeLenses(
652
649
  uri: DocumentUri,
653
- _token: CancellationToken
650
+ _token: CancellationToken,
654
651
  ): Promise<CodeLens[]> {
655
652
  const project = this.workspace.projectForFile(uri);
656
653
  if (!(project && project instanceof GraphQLClientProject)) return [];
@@ -736,7 +733,7 @@ export class GraphQLLanguageProvider {
736
733
  async provideCodeAction(
737
734
  uri: DocumentUri,
738
735
  range: Range,
739
- _token: CancellationToken
736
+ _token: CancellationToken,
740
737
  ): Promise<CodeAction[]> {
741
738
  function isPositionLessThanOrEqual(a: Position, b: Position) {
742
739
  return a.line !== b.line ? a.line < b.line : a.character <= b.character;
@@ -782,12 +779,12 @@ export class GraphQLLanguageProvider {
782
779
  const { extensions } = error;
783
780
  if (!extensions || !extensions.codeAction) continue;
784
781
 
785
- const { message, edits }: CodeActionInfo = extensions.codeAction;
782
+ const { message, edits }: CodeActionInfo = extensions.codeAction as any;
786
783
 
787
784
  const codeAction = CodeAction.create(
788
785
  message,
789
786
  { changes: { [uri]: edits } },
790
- CodeActionKind.QuickFix
787
+ CodeActionKind.QuickFix,
791
788
  );
792
789
 
793
790
  result.push(codeAction);
@@ -1,4 +1,5 @@
1
- import { IConnection, NotificationType } from "vscode-languageserver";
1
+ import { LanguageServerNotifications as Notifications } from "../messages";
2
+ import { Connection, NotificationType } from "vscode-languageserver/node";
2
3
 
3
4
  // XXX I think we want to combine this into an interface
4
5
  // with the errors tooling as well
@@ -10,27 +11,18 @@ export interface LoadingHandler {
10
11
  }
11
12
 
12
13
  export class LanguageServerLoadingHandler implements LoadingHandler {
13
- constructor(private connection: IConnection) {}
14
+ constructor(private connection: Connection) {}
14
15
  private latestLoadingToken = 0;
15
16
  async handle<T>(message: string, value: Promise<T>): Promise<T> {
16
17
  const token = this.latestLoadingToken;
17
18
  this.latestLoadingToken += 1;
18
- this.connection.sendNotification(
19
- new NotificationType<any, void>("apollographql/loading"),
20
- { message, token }
21
- );
19
+ this.connection.sendNotification(Notifications.Loading, { message, token });
22
20
  try {
23
21
  const ret = await value;
24
- this.connection.sendNotification(
25
- new NotificationType<any, void>("apollographql/loadingComplete"),
26
- token
27
- );
22
+ this.connection.sendNotification(Notifications.LoadingComplete, token);
28
23
  return ret;
29
24
  } catch (e) {
30
- this.connection.sendNotification(
31
- new NotificationType<any, void>("apollographql/loadingComplete"),
32
- token
33
- );
25
+ this.connection.sendNotification(Notifications.LoadingComplete, token);
34
26
  this.showError(`Error in "${message}": ${e}`);
35
27
  throw e;
36
28
  }
@@ -38,23 +30,14 @@ export class LanguageServerLoadingHandler implements LoadingHandler {
38
30
  handleSync<T>(message: string, value: () => T): T {
39
31
  const token = this.latestLoadingToken;
40
32
  this.latestLoadingToken += 1;
41
- this.connection.sendNotification(
42
- new NotificationType<any, void>("apollographql/loading"),
43
- { message, token }
44
- );
33
+ this.connection.sendNotification(Notifications.Loading, { message, token });
45
34
  try {
46
35
  const ret = value();
47
- this.connection.sendNotification(
48
- new NotificationType<any, void>("apollographql/loadingComplete"),
49
- token
50
- );
36
+ this.connection.sendNotification(Notifications.LoadingComplete, token);
51
37
  return ret;
52
38
  } catch (e) {
53
- this.connection.sendNotification(
54
- new NotificationType<any, void>("apollographql/loadingComplete"),
55
- token
56
- );
57
- this.showError(`Error in "${message}": ${e}`);
39
+ Notifications.LoadingComplete,
40
+ this.showError(`Error in "${message}": ${e}`);
58
41
  throw e;
59
42
  }
60
43
  }
@@ -1,6 +1,6 @@
1
1
  import path, { extname } from "path";
2
2
  import { lstatSync, readFileSync } from "fs";
3
- import URI from "vscode-uri";
3
+ import { URI } from "vscode-uri";
4
4
 
5
5
  import {
6
6
  TypeSystemDefinitionNode,
@@ -17,7 +17,7 @@ import {
17
17
  NotificationHandler,
18
18
  PublishDiagnosticsParams,
19
19
  Position,
20
- } from "vscode-languageserver";
20
+ } from "vscode-languageserver/node";
21
21
 
22
22
  import { GraphQLDocument, extractGraphQLDocuments } from "../document";
23
23
 
@@ -28,9 +28,8 @@ import {
28
28
  ClientConfig,
29
29
  isClientConfig,
30
30
  isLocalServiceConfig,
31
- isServiceConfig,
32
31
  keyEnvVar,
33
- ServiceConfig,
32
+ RoverConfig,
34
33
  } from "../config";
35
34
  import {
36
35
  schemaProviderFromConfig,
@@ -38,7 +37,7 @@ import {
38
37
  SchemaResolveConfig,
39
38
  } from "../providers/schema";
40
39
  import { ApolloEngineClient, ClientIdentity } from "../engine";
41
- import type { ProjectStats } from "src/messages";
40
+ import type { ProjectStats } from "../../messages";
42
41
 
43
42
  export type DocumentUri = string;
44
43
 
@@ -60,8 +59,8 @@ const fileAssociations: { [extension: string]: string } = {
60
59
  };
61
60
 
62
61
  interface GraphQLProjectConfig {
63
- clientIdentity?: ClientIdentity;
64
- config: ClientConfig | ServiceConfig;
62
+ clientIdentity: ClientIdentity;
63
+ config: ClientConfig | RoverConfig;
65
64
  configFolderURI: URI;
66
65
  loadingHandler: LoadingHandler;
67
66
  }
@@ -98,12 +97,21 @@ export abstract class GraphQLProject implements GraphQLSchemaProvider {
98
97
  // if a config doesn't have a uri associated, we can assume the `rootURI` is the project's root.
99
98
  this.rootURI = config.configDirURI || configFolderURI;
100
99
 
101
- const { includes, excludes } = config.isClient
100
+ const { includes = [], excludes = [] } = isClientConfig(config)
102
101
  ? config.client
103
- : config.service;
102
+ : {
103
+ /** TODO */
104
+ };
104
105
  const fileSet = new FileSet({
105
106
  rootURI: this.rootURI,
106
- includes: [...includes, ".env", "apollo.config.js", "apollo.config.cjs"],
107
+ includes: [
108
+ ...includes,
109
+ ".env",
110
+ "apollo.config.js",
111
+ "apollo.config.cjs",
112
+ "apollo.config.mjs",
113
+ "apollo.config.ts",
114
+ ],
107
115
  // We do not want to include the local schema file in our list of documents
108
116
  excludes: [...excludes, ...this.getRelativeLocalSchemaFilePaths()],
109
117
  configURI: config.configURI,
@@ -116,7 +124,7 @@ export abstract class GraphQLProject implements GraphQLSchemaProvider {
116
124
  this.engineClient = new ApolloEngineClient(
117
125
  engine.apiKey!,
118
126
  engine.endpoint,
119
- clientIdentity
127
+ clientIdentity,
120
128
  );
121
129
  }
122
130
 
@@ -130,7 +138,7 @@ export abstract class GraphQLProject implements GraphQLSchemaProvider {
130
138
  .catch((error) => {
131
139
  console.error(error);
132
140
  this.loadingHandler.showError(
133
- `Error initializing Apollo GraphQL project "${this.displayName}": ${error}`
141
+ `Error initializing Apollo GraphQL project "${this.displayName}": ${error}`,
134
142
  );
135
143
  });
136
144
  }
@@ -202,7 +210,7 @@ export abstract class GraphQLProject implements GraphQLSchemaProvider {
202
210
 
203
211
  this.fileDidChange(uri);
204
212
  }
205
- })()
213
+ })(),
206
214
  );
207
215
  }
208
216
 
@@ -231,7 +239,7 @@ export abstract class GraphQLProject implements GraphQLSchemaProvider {
231
239
  documentDidChange(document: TextDocument) {
232
240
  const documents = extractGraphQLDocuments(
233
241
  document,
234
- this.config.client && this.config.client.tagName
242
+ this.config.client && this.config.client.tagName,
235
243
  );
236
244
  if (documents) {
237
245
  this.documentsByFile.set(document.uri, documents);
@@ -258,7 +266,7 @@ export abstract class GraphQLProject implements GraphQLSchemaProvider {
258
266
  const conflictingFilePath =
259
267
  filePathForOperationName[operationName];
260
268
  throw new Error(
261
- `️️There are multiple definitions for the \`${definition.name.value}\` operation. Please fix all naming conflicts before continuing.\nConflicting definitions found at ${filePath} and ${conflictingFilePath}.`
269
+ `️️There are multiple definitions for the \`${definition.name.value}\` operation. Please fix all naming conflicts before continuing.\nConflicting definitions found at ${filePath} and ${conflictingFilePath}.`,
262
270
  );
263
271
  }
264
272
  filePathForOperationName[operationName] = filePath;
@@ -298,13 +306,12 @@ export abstract class GraphQLProject implements GraphQLSchemaProvider {
298
306
  }
299
307
 
300
308
  private getRelativeLocalSchemaFilePaths(): string[] {
301
- const serviceConfig = isServiceConfig(this.config)
302
- ? this.config.service
303
- : isClientConfig(this.config) &&
304
- typeof this.config.client.service === "object" &&
305
- isLocalServiceConfig(this.config.client.service)
306
- ? this.config.client.service
307
- : undefined;
309
+ const serviceConfig =
310
+ isClientConfig(this.config) &&
311
+ typeof this.config.client.service === "object" &&
312
+ isLocalServiceConfig(this.config.client.service)
313
+ ? this.config.client.service
314
+ : undefined;
308
315
  const localSchemaFile = serviceConfig?.localSchemaFile;
309
316
  return (
310
317
  localSchemaFile === undefined
@@ -313,7 +320,7 @@ export abstract class GraphQLProject implements GraphQLSchemaProvider {
313
320
  ? localSchemaFile
314
321
  : [localSchemaFile]
315
322
  ).map((filePath) =>
316
- path.relative(this.rootURI.fsPath, path.join(process.cwd(), filePath))
323
+ path.relative(this.rootURI.fsPath, path.join(process.cwd(), filePath)),
317
324
  );
318
325
  }
319
326
 
@@ -333,13 +340,13 @@ export abstract class GraphQLProject implements GraphQLSchemaProvider {
333
340
 
334
341
  documentAt(
335
342
  uri: DocumentUri,
336
- position: Position
343
+ position: Position,
337
344
  ): GraphQLDocument | undefined {
338
345
  const queryDocuments = this.documentsByFile.get(uri);
339
346
  if (!queryDocuments) return undefined;
340
347
 
341
348
  return queryDocuments.find((document) =>
342
- document.containsPosition(position)
349
+ document.containsPosition(position),
343
350
  );
344
351
  }
345
352