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

graphql-tag

Package Overview
Dependencies
Maintainers
5
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-tag - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

21

index.js

@@ -26,7 +26,12 @@ var parse = require('./parser').parse;

// Take a unstripped parsed document (query/mutation or even fragment), and
// check all fragment definitions, checking for name->source uniqueness
// check all fragment definitions, checking for name->source uniqueness.
// We also want to make sure only unique fragments exist in the document.
var printFragmentWarnings = true;
function checkFragments(ast) {
function processFragments(ast) {
var astFragmentMap = {};
var definitions = [];
for (var i = 0; i < ast.definitions.length; i++) {
var fragmentDefinition = ast.definitions[i];
if (fragmentDefinition.kind === 'FragmentDefinition') {

@@ -54,4 +59,14 @@ var fragmentName = fragmentDefinition.name.value;

}
if (!astFragmentMap[sourceKey]) {
astFragmentMap[sourceKey] = true;
definitions.push(fragmentDefinition);
}
} else {
definitions.push(fragmentDefinition);
}
}
ast.definitions = definitions;
return ast;
}

@@ -113,3 +128,3 @@

// existing fragments of the same name
checkFragments(parsed);
parsed = processFragments(parsed);
parsed = stripLoc(parsed, false);

@@ -116,0 +131,0 @@ docCache[cacheKey] = parsed;

2

package.json
{
"name": "graphql-tag",
"version": "1.2.2",
"version": "1.2.3",
"description": "A JavaScript template literal tag that parses GraphQL queries",

@@ -5,0 +5,0 @@ "main": "index.js",

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