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

graphql-document-collector

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-document-collector - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

.github/ISSUE_TEMPLATE.md

9

lib/transforms/__tests__/resolveFragments.js

@@ -31,2 +31,11 @@ "use strict";

});
it('should resolve all inline fragments', function () {
return loader_1.loadGlob(path.join(__dirname, '..', '..', '..', 'inlineFragmentExample'), '**/*.graphql')
.then(function (root) {
var fMap = resolveFragments_1.createFragmentMap(root);
var origDoc = root.directories[1].documents[0];
var transformedDoc = resolveFragments_1.addFragmentsToDocument(origDoc, fMap);
chai_1.assert.equal(transformedDoc.definitions.length, 3);
});
});
});

@@ -33,0 +42,0 @@ describe('resolveFragments', function () {

3

lib/transforms/resolveFragments.js

@@ -25,2 +25,5 @@ "use strict";

}
else if ((sel.kind === 'InlineFragment')) {
fragmentSpreadsInSelectionSet(sel.selectionSet, fMap, fragmentSpreads);
}
});

@@ -27,0 +30,0 @@ return fragmentSpreads;

2

package.json
{
"name": "graphql-document-collector",
"version": "0.2.1",
"version": "0.2.2",
"description": "Load up smartly, in one location, all of the GraphQL queries/mutations/subscriptions of your project",

@@ -5,0 +5,0 @@ "main": "lib",

@@ -47,2 +47,15 @@ import {assert} from 'chai';

});
it('should resolve all inline fragments', () => {
return loadGlob(
path.join(__dirname, '..', '..', '..', 'inlineFragmentExample'),
'**/*.graphql'
)
.then((root: DocumentDirectory) => {
const fMap = createFragmentMap(root);
const origDoc = root.directories[1].documents[0];
const transformedDoc = addFragmentsToDocument(origDoc, fMap);
assert.equal(transformedDoc.definitions.length, 3);
});
});
});

@@ -49,0 +62,0 @@

@@ -8,2 +8,3 @@ import {

FieldNode,
InlineFragmentNode,
} from 'graphql';

@@ -41,2 +42,4 @@ import {DocumentDirectory} from '../ast';

fragmentSpreadsInSelectionSet((sel as FieldNode).selectionSet, fMap, fragmentSpreads);
} else if ((sel.kind === 'InlineFragment')) {
fragmentSpreadsInSelectionSet((sel as InlineFragmentNode).selectionSet, fMap, fragmentSpreads);
}

@@ -61,2 +64,3 @@ });

});
return Object.assign({}, document, {

@@ -63,0 +67,0 @@ definitions: [

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

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