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

@graphql-toolkit/common

Package Overview
Dependencies
Maintainers
3
Versions
711
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-toolkit/common - npm Package Compare versions

Comparing version 0.9.13-alpha-ef52b30.9 to 0.9.13-alpha-f1e4c5e.9

15

index.cjs.js

@@ -428,4 +428,3 @@ 'use strict';

};
let errors = graphql.validate(schema, documentToValidate, effectiveRules);
skipUnusedFragmentsInNonOperations(documentToValidate, errors);
const errors = skipUnusedFragmentsInNonOperations(documentToValidate, graphql.validate(schema, documentToValidate, effectiveRules));
if (errors.length > 0) {

@@ -464,9 +463,9 @@ allErrors.push({

function skipUnusedFragmentsInNonOperations(doc, errors) {
if (!errors.length) {
return;
if (errors.length > 0) {
const isFragmentOnly = doc.definitions.some((def) => def.kind === 'OperationDefinition') === false;
if (isFragmentOnly) {
return errors.filter((error) => error.message.includes('is never used') === false);
}
}
const isFragmentOnly = doc.definitions.some((def) => def.kind === 'OperationDefinition') === false;
if (isFragmentOnly) {
errors = errors.filter((error) => error.message.includes('is never used') === false);
}
return errors;
}

@@ -473,0 +472,0 @@

@@ -403,4 +403,3 @@ import { parse, buildASTSchema, isScalarType, isObjectType, isInterfaceType, isEnumType, isUnionType, getDirectiveValues, Kind, defaultFieldResolver, isSpecifiedScalarType, isIntrospectionType, print, printType, specifiedRules, validate, buildSchema, buildClientSchema, Source, isListType, isNonNullType, getNamedType } from 'graphql';

};
let errors = validate(schema, documentToValidate, effectiveRules);
skipUnusedFragmentsInNonOperations(documentToValidate, errors);
const errors = skipUnusedFragmentsInNonOperations(documentToValidate, validate(schema, documentToValidate, effectiveRules));
if (errors.length > 0) {

@@ -439,9 +438,9 @@ allErrors.push({

function skipUnusedFragmentsInNonOperations(doc, errors) {
if (!errors.length) {
return;
if (errors.length > 0) {
const isFragmentOnly = doc.definitions.some((def) => def.kind === 'OperationDefinition') === false;
if (isFragmentOnly) {
return errors.filter((error) => error.message.includes('is never used') === false);
}
}
const isFragmentOnly = doc.definitions.some((def) => def.kind === 'OperationDefinition') === false;
if (isFragmentOnly) {
errors = errors.filter((error) => error.message.includes('is never used') === false);
}
return errors;
}

@@ -448,0 +447,0 @@

{
"name": "@graphql-toolkit/common",
"version": "0.9.13-alpha-ef52b30.9+ef52b30",
"version": "0.9.13-alpha-f1e4c5e.9+f1e4c5e",
"description": "Common package containting utils and types for GraphQL Toolkit",

@@ -5,0 +5,0 @@ "peerDependencies": {

@@ -12,1 +12,2 @@ export interface SchemaPrintOptions {

}
export declare type Maybe<T> = null | undefined | T;
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