graphql-to-postman
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -0,1 +1,7 @@ | ||
# Changelog for graphql-to-postman | ||
#### v0.0.4 (April 29, 2020) | ||
* Sanitization of options. | ||
* Added a function for getting meta data. | ||
#### v0.0.3 (March 26, 2020) | ||
@@ -2,0 +8,0 @@ * Fix for empty collection generation for certain queries. |
@@ -8,2 +8,4 @@ var schemaToQuery = require('./assets/gql-generator').schemaToQuery, | ||
const DEFAULT_NAME = 'Postman Collection (from GraphQL)'; | ||
/** | ||
@@ -67,2 +69,27 @@ * This function overrides options. If option is not present than default value from getOptions() will be used. | ||
converter = { | ||
/** Returns meta data for a graphql schema | ||
* | ||
* @param {Object} input Input | ||
* @param {String} input.type Type of input 'file' / 'string' | ||
* @param {String} input.data Input data | ||
* @param {Function} cb Callback | ||
*/ | ||
getMetaData: function (input, cb) { | ||
if (input.data) { | ||
return cb(null, { | ||
result: true, | ||
name: DEFAULT_NAME, | ||
output: [{ | ||
type: 'collection', | ||
name: DEFAULT_NAME | ||
}] | ||
}); | ||
} | ||
return cb(null, { | ||
result: false, | ||
reason: 'Invalid input data.' | ||
}); | ||
}, | ||
/** Validate function for validating schema is graphql or not. | ||
@@ -117,14 +144,17 @@ * | ||
{ | ||
name: 'Include Deprecated Fields', | ||
name: 'Include deprecated fields', | ||
id: 'includeDeprecatedFields', | ||
type: 'boolean', | ||
default: false, | ||
description: 'If set true, will include deprecated fields in the queries generated.' | ||
description: 'Generated queries will include deprecated fields', | ||
external: true | ||
}, | ||
{ | ||
name: 'Depth of Query generated', | ||
name: 'Query depth level', | ||
id: 'depth', | ||
type: 'number', | ||
default: 1, | ||
description: 'Determines the depth to which the query should be generated.' | ||
description: 'The number of levels of information that should be returned. (A depth level of “1” returns that' + | ||
' object and its properties. A depth of “2” will return all the nodes connected to the level 1 node, etc.) ', | ||
external: true | ||
} | ||
@@ -151,3 +181,3 @@ ]; | ||
collection.name = 'Postman Collection (from GraphQL)'; | ||
collection.name = DEFAULT_NAME; | ||
@@ -154,0 +184,0 @@ if (input.type === 'file') { |
{ | ||
"name": "graphql-to-postman", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Generates a Postman Collection from a GraphQL schema.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46936
628