Skip to content
This repository was archived by the owner on Sep 2, 2020. It is now read-only.

Commit 9219270

Browse files
committed
some review tweaks
1 parent b06331b commit 9219270

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

packages/interface/src/GraphQLLanguageService.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,6 @@ export class GraphQLLanguageService {
107107
];
108108
}
109109

110-
const schema = await this._graphQLCache
111-
.getSchema(projectConfig.projectName, queryHasExtensions)
112-
.catch(() => null);
113-
114-
if (!schema) {
115-
return [];
116-
}
117-
118110
// If there's a matching config, proceed to prepare to run validation
119111
let source = query;
120112
const fragmentDefinitions = await this._graphQLCache.getFragmentDefinitions(
@@ -155,6 +147,14 @@ export class GraphQLLanguageService {
155147
/* eslint-enable no-implicit-coercion */
156148
}
157149

150+
const schema = await this._graphQLCache
151+
.getSchema(projectConfig.projectName, queryHasExtensions)
152+
.catch(() => null);
153+
154+
if (!schema) {
155+
return [];
156+
}
157+
158158
return validateQuery(validationAst, schema, customRules, isRelayCompatMode);
159159
}
160160

packages/server/src/GraphQLCache.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,9 @@ export class GraphQLCache implements GraphQLCacheInterface {
448448
let schema = null;
449449

450450
if (endpointInfo) {
451-
schemaCacheKey = `${endpointInfo.endpointName}:${projectName}`;
451+
const {endpoint, endpointName} = endpointInfo;
452+
453+
schemaCacheKey = `${endpointName}:${projectName}`;
452454

453455
// Maybe use cache
454456
if (this._schemaMap.has(schemaCacheKey)) {
@@ -460,7 +462,7 @@ export class GraphQLCache implements GraphQLCacheInterface {
460462

461463
// Read schema from network
462464
try {
463-
schema = await endpointInfo.endpoint.resolveSchema();
465+
schema = await endpoint.resolveSchema();
464466
} catch (failure) {
465467
// Never mind
466468
}

0 commit comments

Comments
 (0)