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

graphql-2-json-schema

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-2-json-schema - npm Package Compare versions

Comparing version 0.1.2-1 to 0.1.2-2

9

CHANGELOG.md

@@ -5,2 +5,11 @@ # Changelog

### [0.1.2-2](https://github.com/wittydeveloper/graphql-to-json-schema/compare/v0.1.2-1...v0.1.2-2) (2019-10-21)
### Bug Fixes
* **fromIntrospectionQuery:** properly fetch custom root Mutation/Query types ([a9debf5](https://github.com/wittydeveloper/graphql-to-json-schema/commit/a9debf5))
### [0.1.2-1](https://github.com/wittydeveloper/graphql-to-json-schema/compare/v0.1.2-0...v0.1.2-1) (2019-10-21)

@@ -7,0 +16,0 @@

14

dist/lib/fromIntrospectionQuery.js

@@ -10,8 +10,14 @@ "use strict";

if (mutationType) {
introspection.__schema.types.Mutation = introspection.__schema.types[mutationType.name];
introspection.__schema.types.Mutation.name = 'Mutation';
var rootMutationType = introspection.__schema.types.find(function (t) { return t.name == mutationType.name; });
if (rootMutationType) {
introspection.__schema.types.Mutation = rootMutationType;
introspection.__schema.types.Mutation.name = 'Mutation';
}
}
if (queryType) {
introspection.__schema.types.Query = introspection.__schema.types[queryType.name];
introspection.__schema.types.Query.name = 'Query';
var rootQueryType = introspection.__schema.types.find(function (t) { return t.name == queryType.name; });
if (rootQueryType) {
introspection.__schema.types.Query = rootQueryType;
introspection.__schema.types.Query.name = 'Query';
}
}

@@ -18,0 +24,0 @@ var _b = lodash_1.partition(introspection.__schema.types, function (type) { return typeGuards_1.isIntrospectionObjectType(type) && lodash_1.includes(['Query', 'Mutation'], type.name); }), properties = _b[0], definitions = _b[1];

@@ -27,9 +27,15 @@ import { IntrospectionQuery, IntrospectionType } from 'graphql';

if (mutationType) {
(introspection.__schema.types as any).Mutation = (introspection.__schema.types as any)[mutationType.name];
(introspection.__schema.types as any).Mutation.name = 'Mutation';
const rootMutationType = (introspection.__schema.types as any).find( (t: any) => t.name == mutationType.name);
if (rootMutationType) {
(introspection.__schema.types as any).Mutation = rootMutationType;
(introspection.__schema.types as any).Mutation.name = 'Mutation';
}
}
if (queryType) {
(introspection.__schema.types as any).Query = (introspection.__schema.types as any)[queryType.name];
(introspection.__schema.types as any).Query.name = 'Query';
const rootQueryType = (introspection.__schema.types as any).find( (t: any) => t.name == queryType.name);
if (rootQueryType) {
(introspection.__schema.types as any).Query = rootQueryType;
(introspection.__schema.types as any).Query.name = 'Query';
}
}

@@ -36,0 +42,0 @@ //////////////////////////////////////////////////////////////////////

{
"name": "graphql-2-json-schema",
"version": "0.1.2-1",
"version": "0.1.2-2",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "repository": "git@github.com:wittydeveloper/graphql-to-json-schema.git",

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