graphql-language-service-interface
Advanced tools
Comparing version 0.0.22 to 0.0.23
@@ -39,3 +39,3 @@ 'use strict'; | ||
GraphQLLanguageService.prototype.getDiagnostics = function getDiagnostics(query, uri, isRelayCompatMode) { | ||
var source, appName, schema, customRules, fragmentDefinitions, fragmentDependencies, dependenciesSource, customRulesModulePath, rulesPath; | ||
var source, projectConfig, schema, customRules, fragmentDefinitions, fragmentDependencies, dependenciesSource, customRulesModulePath, rulesPath; | ||
return regeneratorRuntime.async(function getDiagnostics$(_context) { | ||
@@ -46,3 +46,3 @@ while (1) { | ||
source = query; | ||
appName = this._graphQLConfig.getAppConfigNameByFilePath(uri); | ||
projectConfig = this._graphQLConfig.getConfigForFile(uri); | ||
// If there's a matching config, proceed to prepare to run validation | ||
@@ -53,3 +53,3 @@ | ||
if (!this._graphQLConfig.getSchemaPath(appName)) { | ||
if (!projectConfig.schemaPath) { | ||
_context.next = 18; | ||
@@ -60,3 +60,3 @@ break; | ||
_context.next = 7; | ||
return regeneratorRuntime.awrap(this._graphQLCache.getSchema(this._graphQLConfig.getSchemaPath(appName), appName)); | ||
return regeneratorRuntime.awrap(this._graphQLCache.getSchema(projectConfig.projectName)); | ||
@@ -66,3 +66,3 @@ case 7: | ||
_context.next = 10; | ||
return regeneratorRuntime.awrap(this._graphQLCache.getFragmentDefinitions(this._graphQLConfig, appName)); | ||
return regeneratorRuntime.awrap(this._graphQLCache.getFragmentDefinitions(projectConfig)); | ||
@@ -84,3 +84,3 @@ case 10: | ||
// Check if there are custom validation rules to be used | ||
customRulesModulePath = this._graphQLConfig.getCustomValidationRulesModulePath(appName); | ||
customRulesModulePath = projectConfig.extensions.customValidationRules; | ||
@@ -109,3 +109,3 @@ if (customRulesModulePath) { | ||
GraphQLLanguageService.prototype.getAutocompleteSuggestions = function getAutocompleteSuggestions(query, position, filePath) { | ||
var appName, schema; | ||
var projectConfig, schema; | ||
return regeneratorRuntime.async(function getAutocompleteSuggestions$(_context2) { | ||
@@ -115,18 +115,13 @@ while (1) { | ||
case 0: | ||
appName = this._graphQLConfig.getAppConfigNameByFilePath(filePath); | ||
schema = void 0; | ||
projectConfig = this._graphQLConfig.getConfigForFile(filePath); | ||
if (!this._graphQLConfig.getSchemaPath(appName)) { | ||
_context2.next = 8; | ||
if (!projectConfig.schemaPath) { | ||
_context2.next = 5; | ||
break; | ||
} | ||
_context2.next = 5; | ||
return regeneratorRuntime.awrap(this._graphQLCache.getSchema(this._graphQLConfig.getSchemaPath(appName), appName)); | ||
schema = projectConfig.getSchema(); | ||
case 5: | ||
schema = _context2.sent; | ||
if (!schema) { | ||
_context2.next = 8; | ||
_context2.next = 5; | ||
break; | ||
@@ -137,6 +132,6 @@ } | ||
case 8: | ||
case 5: | ||
return _context2.abrupt('return', []); | ||
case 9: | ||
case 6: | ||
case 'end': | ||
@@ -150,3 +145,3 @@ return _context2.stop(); | ||
GraphQLLanguageService.prototype.getDefinition = function getDefinition(query, position, filePath) { | ||
var appName, ast, node; | ||
var projectConfig, ast, node; | ||
return regeneratorRuntime.async(function getDefinition$(_context3) { | ||
@@ -156,3 +151,3 @@ while (1) { | ||
case 0: | ||
appName = this._graphQLConfig.getAppConfigNameByFilePath(filePath); | ||
projectConfig = this._graphQLConfig.getConfigForFile(filePath); | ||
ast = void 0; | ||
@@ -183,3 +178,3 @@ _context3.prev = 2; | ||
case 14: | ||
return _context3.abrupt('return', this._getDefinitionForFragmentSpread(query, ast, node, filePath, this._graphQLConfig, appName)); | ||
return _context3.abrupt('return', this._getDefinitionForFragmentSpread(query, ast, node, filePath, projectConfig)); | ||
@@ -200,3 +195,3 @@ case 15: | ||
GraphQLLanguageService.prototype._getDefinitionForFragmentSpread = function _getDefinitionForFragmentSpread(query, ast, node, filePath, graphQLConfig, appName) { | ||
GraphQLLanguageService.prototype._getDefinitionForFragmentSpread = function _getDefinitionForFragmentSpread(query, ast, node, filePath, projectConfig) { | ||
var fragmentDefinitions, dependencies, localFragDefinitions, typeCastedDefs, localFragInfos, result; | ||
@@ -208,3 +203,3 @@ return regeneratorRuntime.async(function _getDefinitionForFragmentSpread$(_context4) { | ||
_context4.next = 2; | ||
return regeneratorRuntime.awrap(this._graphQLCache.getFragmentDefinitions(graphQLConfig, appName)); | ||
return regeneratorRuntime.awrap(this._graphQLCache.getFragmentDefinitions(projectConfig)); | ||
@@ -211,0 +206,0 @@ case 2: |
{ | ||
"name": "graphql-language-service-interface", | ||
"repository": "https://github.com/graphql/graphql-language-service", | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"description": "Interface to the GraphQL Language Service", | ||
@@ -29,8 +29,8 @@ "contributors": [ | ||
"dependencies": { | ||
"graphql": "^0.10.1", | ||
"graphql-language-service-config": "0.0.18", | ||
"graphql-language-service-parser": "0.0.16", | ||
"graphql-language-service-types": "0.0.22", | ||
"graphql-language-service-utils": "0.0.20" | ||
"graphql": "^0.10.5", | ||
"graphql-config": "~1.0.0", | ||
"graphql-language-service-parser": "0.0.17", | ||
"graphql-language-service-types": "0.0.23", | ||
"graphql-language-service-utils": "0.0.21" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
89768
1208
+ Addedgraphql-config@~1.0.0
+ Addedargparse@1.0.10(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedcross-fetch@2.2.2(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedgraphql@0.11.7(transitive)
+ Addedgraphql-config@1.0.9(transitive)
+ Addedgraphql-language-service-parser@0.0.17(transitive)
+ Addedgraphql-language-service-types@0.0.23(transitive)
+ Addedgraphql-language-service-utils@0.0.21(transitive)
+ Addedgraphql-request@1.8.2(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addediterall@1.1.3(transitive)
+ Addedjs-yaml@3.14.1(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addednode-fetch@2.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedsprintf-js@1.0.3(transitive)
+ Addedwhatwg-fetch@2.0.4(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedgraphql-language-service-config@0.0.18(transitive)
- Removedgraphql-language-service-parser@0.0.16(transitive)
- Removedgraphql-language-service-types@0.0.22(transitive)
- Removedgraphql-language-service-utils@0.0.20(transitive)
Updatedgraphql@^0.10.5