Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql-language-service

Package Overview
Dependencies
Maintainers
8
Versions
243
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-language-service - npm Package Compare versions

Comparing version 3.0.0-alpha.4 to 3.0.0

dist/types/index.d.ts

6

CHANGELOG.md

@@ -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 @@

1

dist/index.d.ts

@@ -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 @@ });

13

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc