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

graphql-to-postman

Package Overview
Dependencies
Maintainers
3
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.6 to 0.0.7

3

CHANGELOG.md
# Changelog for graphql-to-postman
### v0.0.7 (Oct 23, 2020)
* fix for - [#8863](https://github.com/postmanlabs/postman-app-support/issues/8863) Fixed an issue where custom name for type threw an error.
### v0.0.6 (Jul 23, 2020)

@@ -3,0 +6,0 @@ * Fix for circular reference input object types.

@@ -161,2 +161,3 @@ // Forked from https://github.com/timqian/gql-generator.

curDepth = 1) {
const field = gqlSchema.getType(curParentType).getFields()[curName],

@@ -255,7 +256,25 @@ curTypeName = field.type.inspect().replace(/[[\]!]/g, ''),

Object.keys(obj).forEach((type) => {
const field = gqlSchema.getType(description).getFields()[type];
let field,
newDescription;
// The name of the mutationType can be anything other than 'Mutation'
// Handle for each type separately and use the new description to traverse through
// the fields.
if (description === 'Mutation') {
field = gqlSchema._mutationType._fields[type];
newDescription = gqlSchema._mutationType.name;
}
else if (description === 'Query') {
field = gqlSchema._queryType._fields[type];
newDescription = gqlSchema._queryType.name;
}
else if (description === 'Subscription') {
field = gqlSchema._subscriptionType._fields[type];
newDescription = gqlSchema._subscriptionType.name;
}
/* Only process non-deprecated queries/mutations: */
if (includeDeprecatedFields || !field.isDeprecated) {
const queryResult = generateQuery(type, description),
const queryResult = generateQuery(type, newDescription),
varsToTypesStr = getVarsToTypesStr(queryResult.argumentsDict);

@@ -270,2 +289,4 @@

let query = queryResult.queryStr;
// here the `description` is used to construct the actual queries
// Here has to be one of query, mutation, or subscription.
query = `${description.toLowerCase()} ${type}${varsToTypesStr ? ` (${varsToTypesStr}) ` : ' '}{\n${query}\n}`;

@@ -272,0 +293,0 @@ currentObject[type] = {

2

package.json
{
"name": "graphql-to-postman",
"version": "0.0.6",
"version": "0.0.7",
"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