graphql-language-service
Advanced tools
Comparing version 3.0.0-alpha.4 to 3.0.0
@@ -6,2 +6,8 @@ # Change Log | ||
# [3.0.0](https://github.com/graphql/graphiql/compare/graphql-language-service@3.0.0-alpha.4...graphql-language-service@3.0.0) (2020-06-11) | ||
### Features | ||
- standalone monaco API ([#1575](https://github.com/graphql/graphiql/issues/1575)) ([954aa3d](https://github.com/graphql/graphiql/commit/954aa3d7159fd26bba9650824e0f668e417ca64f)) | ||
# [3.0.0-alpha.4](https://github.com/graphql/graphiql/compare/graphql-language-service@3.0.0-alpha.3...graphql-language-service@3.0.0-alpha.4) (2020-06-04) | ||
@@ -8,0 +14,0 @@ |
@@ -0,1 +1,2 @@ | ||
export * from './types'; | ||
export * from './schemaLoader'; | ||
@@ -2,0 +3,0 @@ export * from './LanguageService'; |
import { parse, GraphQLSchema, ParseOptions, ValidationRule } from 'graphql'; | ||
import type { Position } from 'graphql-language-service-types'; | ||
import { RawSchema } from './types'; | ||
import { defaultSchemaLoader, SchemaConfig, SchemaResponse, defaultSchemaBuilder } from './schemaLoader'; | ||
@@ -8,2 +9,4 @@ export declare type GraphQLLanguageConfig = { | ||
schemaBuilder?: typeof defaultSchemaBuilder; | ||
rawSchema?: RawSchema; | ||
parseOptions?: ParseOptions; | ||
schemaConfig: SchemaConfig; | ||
@@ -18,5 +21,8 @@ }; | ||
private _schemaBuilder; | ||
constructor({ parser, schemaLoader, schemaBuilder, schemaConfig, }: GraphQLLanguageConfig); | ||
private _rawSchema; | ||
private _parseOptions; | ||
constructor({ parser, schemaLoader, schemaBuilder, schemaConfig, rawSchema, parseOptions, }: GraphQLLanguageConfig); | ||
get schema(): GraphQLSchema; | ||
getSchema(): Promise<GraphQLSchema>; | ||
setSchema(schema: RawSchema): Promise<GraphQLSchema>; | ||
getSchemaResponse(): Promise<SchemaResponse>; | ||
@@ -23,0 +29,0 @@ loadSchemaResponse(): Promise<SchemaResponse>; |
@@ -45,3 +45,3 @@ "use strict"; | ||
var _this = this; | ||
var parser = _a.parser, schemaLoader = _a.schemaLoader, schemaBuilder = _a.schemaBuilder, schemaConfig = _a.schemaConfig; | ||
var parser = _a.parser, schemaLoader = _a.schemaLoader, schemaBuilder = _a.schemaBuilder, schemaConfig = _a.schemaConfig, rawSchema = _a.rawSchema, parseOptions = _a.parseOptions; | ||
this._parser = graphql_1.parse; | ||
@@ -52,2 +52,4 @@ this._schema = null; | ||
this._schemaBuilder = schemaLoader_1.defaultSchemaBuilder; | ||
this._rawSchema = null; | ||
this._parseOptions = undefined; | ||
this.getCompletion = function (_uri, documentText, position) { return __awaiter(_this, void 0, void 0, function () { var _a; return __generator(this, function (_b) { | ||
@@ -94,2 +96,8 @@ switch (_b.label) { | ||
} | ||
if (rawSchema) { | ||
this._rawSchema = rawSchema; | ||
} | ||
if (parseOptions) { | ||
this._parseOptions = parseOptions; | ||
} | ||
} | ||
@@ -113,2 +121,10 @@ Object.defineProperty(LanguageService.prototype, "schema", { | ||
}; | ||
LanguageService.prototype.setSchema = function (schema) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
this._rawSchema = schema; | ||
return [2, this.loadSchema()]; | ||
}); | ||
}); | ||
}; | ||
LanguageService.prototype.getSchemaResponse = function () { | ||
@@ -131,2 +147,7 @@ return __awaiter(this, void 0, void 0, function () { | ||
case 0: | ||
if (this._rawSchema) { | ||
return [2, typeof this._rawSchema === 'string' | ||
? this.parse(this._rawSchema) | ||
: this._rawSchema]; | ||
} | ||
if (!((_a = this._schemaConfig) === null || _a === void 0 ? void 0 : _a.uri)) { | ||
@@ -161,3 +182,3 @@ throw new Error('uri missing'); | ||
return __generator(this, function (_a) { | ||
return [2, this._parser(text, options)]; | ||
return [2, this._parser(text, options || this._parseOptions)]; | ||
}); | ||
@@ -164,0 +185,0 @@ }); |
@@ -0,1 +1,2 @@ | ||
export * from './types'; | ||
export * from './schemaLoader'; | ||
@@ -2,0 +3,0 @@ export * from './LanguageService'; |
import { parse, GraphQLSchema, ParseOptions, ValidationRule } from 'graphql'; | ||
import type { Position } from 'graphql-language-service-types'; | ||
import { RawSchema } from './types'; | ||
import { defaultSchemaLoader, SchemaConfig, SchemaResponse, defaultSchemaBuilder } from './schemaLoader'; | ||
@@ -8,2 +9,4 @@ export declare type GraphQLLanguageConfig = { | ||
schemaBuilder?: typeof defaultSchemaBuilder; | ||
rawSchema?: RawSchema; | ||
parseOptions?: ParseOptions; | ||
schemaConfig: SchemaConfig; | ||
@@ -18,5 +21,8 @@ }; | ||
private _schemaBuilder; | ||
constructor({ parser, schemaLoader, schemaBuilder, schemaConfig, }: GraphQLLanguageConfig); | ||
private _rawSchema; | ||
private _parseOptions; | ||
constructor({ parser, schemaLoader, schemaBuilder, schemaConfig, rawSchema, parseOptions, }: GraphQLLanguageConfig); | ||
get schema(): GraphQLSchema; | ||
getSchema(): Promise<GraphQLSchema>; | ||
setSchema(schema: RawSchema): Promise<GraphQLSchema>; | ||
getSchemaResponse(): Promise<SchemaResponse>; | ||
@@ -23,0 +29,0 @@ loadSchemaResponse(): Promise<SchemaResponse>; |
@@ -43,3 +43,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
var _this = this; | ||
var parser = _a.parser, schemaLoader = _a.schemaLoader, schemaBuilder = _a.schemaBuilder, schemaConfig = _a.schemaConfig; | ||
var parser = _a.parser, schemaLoader = _a.schemaLoader, schemaBuilder = _a.schemaBuilder, schemaConfig = _a.schemaConfig, rawSchema = _a.rawSchema, parseOptions = _a.parseOptions; | ||
this._parser = parse; | ||
@@ -50,2 +50,4 @@ this._schema = null; | ||
this._schemaBuilder = defaultSchemaBuilder; | ||
this._rawSchema = null; | ||
this._parseOptions = undefined; | ||
this.getCompletion = function (_uri, documentText, position) { return __awaiter(_this, void 0, void 0, function () { var _a; return __generator(this, function (_b) { | ||
@@ -92,2 +94,8 @@ switch (_b.label) { | ||
} | ||
if (rawSchema) { | ||
this._rawSchema = rawSchema; | ||
} | ||
if (parseOptions) { | ||
this._parseOptions = parseOptions; | ||
} | ||
} | ||
@@ -111,2 +119,10 @@ Object.defineProperty(LanguageService.prototype, "schema", { | ||
}; | ||
LanguageService.prototype.setSchema = function (schema) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
this._rawSchema = schema; | ||
return [2, this.loadSchema()]; | ||
}); | ||
}); | ||
}; | ||
LanguageService.prototype.getSchemaResponse = function () { | ||
@@ -129,2 +145,7 @@ return __awaiter(this, void 0, void 0, function () { | ||
case 0: | ||
if (this._rawSchema) { | ||
return [2, typeof this._rawSchema === 'string' | ||
? this.parse(this._rawSchema) | ||
: this._rawSchema]; | ||
} | ||
if (!((_a = this._schemaConfig) === null || _a === void 0 ? void 0 : _a.uri)) { | ||
@@ -159,3 +180,3 @@ throw new Error('uri missing'); | ||
return __generator(this, function (_a) { | ||
return [2, this._parser(text, options)]; | ||
return [2, this._parser(text, options || this._parseOptions)]; | ||
}); | ||
@@ -162,0 +183,0 @@ }); |
{ | ||
"name": "graphql-language-service", | ||
"version": "3.0.0-alpha.4", | ||
"version": "3.0.0", | ||
"description": "The official, runtime independent Language Service for GraphQL", | ||
@@ -25,3 +25,3 @@ "contributors": [ | ||
"module": "esm/index.js", | ||
"typings": "dist/index.d.ts", | ||
"types": "dist/index.d.ts", | ||
"bin": { | ||
@@ -31,3 +31,3 @@ "graphql": "./dist/temp-bin.js" | ||
"peerDependencies": { | ||
"graphql": "^0.13.0 || ^14.0.0 || ^15.0.0" | ||
"graphql": "^14.0.0 || ^15.0.0" | ||
}, | ||
@@ -38,7 +38,6 @@ "devDependencies": { | ||
"dependencies": { | ||
"graphql-config": "3.0.0-rc.2", | ||
"graphql-language-service-interface": "^2.4.0-alpha.11", | ||
"graphql-language-service-types": "^1.6.0-alpha.8" | ||
"graphql-language-service-interface": "^2.4.0", | ||
"graphql-language-service-types": "^1.6.0" | ||
}, | ||
"gitHead": "9ce01b17e5046cf12fba89146cbf70df84d3d6af" | ||
"gitHead": "294fd834efe485132744c0cd9d24690a61b45501" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
55848
3
44
680
0
2
+ Addedis-glob@4.0.3(transitive)
- Removedgraphql-config@3.0.0-rc.2
- Removed@babel/runtime@7.26.0(transitive)
- Removed@graphql-toolkit/common@0.10.7(transitive)
- Removed@graphql-toolkit/core@0.10.7(transitive)
- Removed@graphql-toolkit/graphql-file-loader@0.10.7(transitive)
- Removed@graphql-toolkit/json-file-loader@0.10.7(transitive)
- Removed@graphql-toolkit/schema-merging@0.10.7(transitive)
- Removed@graphql-toolkit/url-loader@0.10.7(transitive)
- Removed@types/parse-json@4.0.2(transitive)
- Removed@wry/equality@0.1.11(transitive)
- Removedaggregate-error@3.0.1(transitive)
- Removedapollo-link@1.2.14(transitive)
- Removedapollo-link-http-common@0.2.16(transitive)
- Removedapollo-upload-client@13.0.0(transitive)
- Removedapollo-utilities@1.3.4(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedcamel-case@4.1.1(transitive)
- Removedclean-stack@2.2.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcosmiconfig@6.0.0(transitive)
- Removedcross-fetch@3.0.4(transitive)
- Removeddeepmerge@4.2.2(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddeprecated-decorator@0.1.6(transitive)
- Removedextract-files@8.1.0(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedform-data@3.0.2(transitive)
- Removedglobby@11.0.0(transitive)
- Removedgraphql-config@3.0.0-rc.2(transitive)
- Removedgraphql-tools@5.0.0(transitive)
- Removedimport-from@3.0.0(transitive)
- Removedindent-string@4.0.0(transitive)
- Removedis-glob@4.0.1(transitive)
- Removediterall@1.3.0(transitive)
- Removedlodash@4.17.15(transitive)
- Removedlower-case@2.0.2(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedminimatch@3.0.4(transitive)
- Removedno-case@3.0.4(transitive)
- Removednode-fetch@2.6.0(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedpascal-case@3.1.2(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedts-invariant@0.4.4(transitive)
- Removedtslib@1.11.21.14.1(transitive)
- Removeduuid@7.0.3(transitive)
- Removedvalid-url@1.0.9(transitive)
- Removedwhatwg-fetch@3.0.0(transitive)
- Removedyaml@1.10.2(transitive)
- Removedzen-observable@0.8.15(transitive)
- Removedzen-observable-ts@0.8.21(transitive)