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

graphql-language-service-interface

Package Overview
Dependencies
Maintainers
3
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-language-service-interface - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

25

dist/getDiagnostics.js

@@ -6,2 +6,3 @@ 'use strict';

});
exports.SEVERITY = undefined;
exports.getDiagnostics = getDiagnostics;

@@ -21,3 +22,3 @@

var SEVERITY = {
var SEVERITY = exports.SEVERITY = {
ERROR: 1,

@@ -55,6 +56,16 @@ WARNING: 2,

var errors = schema ? (0, _graphqlLanguageServiceUtils.validateWithCustomRules)(schema, ast, customRules) : [];
return mapCat(errors, function (error) {
return errorAnnotations(error);
// We cannot validate the query unless a schema is provided.
if (!schema) {
return [];
}
var validationErrorAnnotations = mapCat((0, _graphqlLanguageServiceUtils.validateWithCustomRules)(schema, ast, customRules), function (error) {
return annotations(error, SEVERITY.ERROR, 'Validation');
});
// Note: findDeprecatedUsages was added in graphql@0.9.0, but we want to
// support older versions of graphql-js.
var deprecationWarningAnnotations = !_graphql.findDeprecatedUsages ? [] : mapCat((0, _graphql.findDeprecatedUsages)(schema, ast), function (error) {
return annotations(error, SEVERITY.WARNING, 'Deprecation');
});
return validationErrorAnnotations.concat(deprecationWarningAnnotations);
}

@@ -67,3 +78,3 @@

function errorAnnotations(error) {
function annotations(error, severity, type) {
if (!error.nodes) {

@@ -79,5 +90,5 @@ return [];

return {
source: 'GraphQL: Validation',
source: 'GraphQL: ' + type,
message: error.message,
severity: SEVERITY.ERROR,
severity: severity,
range: new _graphqlLanguageServiceUtils.Range(new _graphqlLanguageServiceUtils.Position(loc.line - 1, loc.column - 1), new _graphqlLanguageServiceUtils.Position(loc.line - 1, end))

@@ -84,0 +95,0 @@ };

{
"name": "graphql-language-service-interface",
"repository": "https://github.com/graphql/graphql-language-service",
"version": "0.0.3",
"version": "0.0.4",
"description": "Interface to the GraphQL Language Service",

@@ -6,0 +6,0 @@ "contributors": [

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