1
1
var schemaToQuery = require ( './assets/gql-generator' ) . schemaToQuery ,
2
2
converter ,
3
3
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' ) ,
5
7
_ = require ( 'lodash' ) ,
6
8
graphql = require ( 'graphql' ) ;
7
9
@@ -227,7 +229,7 @@ converter = {
227
229
convert : function ( input , options , callback ) {
228
230
var gqlSchemaObj ,
229
231
data ,
230
- collection = new sdk . Collection ( ) ,
232
+ collection = new Collection ( ) ,
231
233
analysis ,
232
234
queryCollection ;
233
235
@@ -284,7 +286,7 @@ converter = {
284
286
}
285
287
286
288
_ . forEach ( queryCollection , ( value , key ) => {
287
- var folder = new sdk . ItemGroup ( ) ;
289
+ var folder = new ItemGroup ( ) ;
288
290
folder . name = key ;
289
291
_ . forEach ( value , ( graphqlObj , name ) => {
290
292
var request = { } ,
@@ -303,7 +305,7 @@ converter = {
303
305
collection . items . add ( folder ) ;
304
306
} ) ;
305
307
306
- collection . variables . add ( new sdk . Variable ( {
308
+ collection . variables . add ( new Variable ( {
307
309
id : 'url' ,
308
310
value : '' ,
309
311
description : 'URL for the request.'
0 commit comments