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

graphql-to-postman

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-to-postman - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

6

CHANGELOG.md

@@ -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.

40

lib/index.js

@@ -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') {

2

package.json
{
"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",

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