graphql-2-json-schema
Advanced tools
Comparing version 0.1.2-1 to 0.1.2-2
@@ -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 @@ |
@@ -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", |
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
45373
837