Skip to content

Commit 2665903

Browse files
authored
Merge pull request #65 from postmanlabs/feature/update-postman-collection-usage
Updated "postman-collection" usage to be specific to part of module being used.
2 parents 1fbb693 + 92c94a8 commit 2665903

File tree

3 files changed

+186
-610
lines changed

3 files changed

+186
-610
lines changed

lib/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
var schemaToQuery = require('./assets/gql-generator').schemaToQuery,
22
converter,
33
util = require('./util'),
4-
sdk = require('postman-collection'),
4+
{ Collection } = require('postman-collection/lib/collection/collection'),
5+
{ ItemGroup } = require('postman-collection/lib/collection/item-group'),
6+
{ Variable } = require('postman-collection/lib/collection/variable'),
57
_ = require('lodash'),
68
graphql = require('graphql');
79

@@ -227,7 +229,7 @@ converter = {
227229
convert: function (input, options, callback) {
228230
var gqlSchemaObj,
229231
data,
230-
collection = new sdk.Collection(),
232+
collection = new Collection(),
231233
analysis,
232234
queryCollection;
233235

@@ -284,7 +286,7 @@ converter = {
284286
}
285287

286288
_.forEach(queryCollection, (value, key) => {
287-
var folder = new sdk.ItemGroup();
289+
var folder = new ItemGroup();
288290
folder.name = key;
289291
_.forEach(value, (graphqlObj, name) => {
290292
var request = {},
@@ -303,7 +305,7 @@ converter = {
303305
collection.items.add(folder);
304306
});
305307

306-
collection.variables.add(new sdk.Variable({
308+
collection.variables.add(new Variable({
307309
id: 'url',
308310
value: '',
309311
description: 'URL for the request.'

0 commit comments

Comments
 (0)