graphql-config
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -1,2 +0,2 @@ | ||
import { GraphQLSchema } from 'graphql'; | ||
import { GraphQLSchema, IntrospectionQuery } from 'graphql'; | ||
import { GraphQLConfigData, IntrospectionResult } from './types'; | ||
@@ -10,3 +10,6 @@ export declare function readConfig(configPath: string): GraphQLConfigData; | ||
export declare function schemaToIntrospection(schema: GraphQLSchema): Promise<IntrospectionResult>; | ||
export declare function introspectionToSchema(introspection: IntrospectionResult): GraphQLSchema; | ||
export declare function introspectionToSchema(introspection: IntrospectionResult | (IntrospectionQuery & { | ||
errors: undefined; | ||
data: undefined; | ||
})): GraphQLSchema; | ||
export declare function readSchema(path: any): GraphQLSchema; | ||
@@ -13,0 +16,0 @@ export declare function writeSchema(path: string, schema: GraphQLSchema, schemaExtensions?: { |
@@ -124,10 +124,9 @@ "use strict"; | ||
exports.schemaToIntrospection = schemaToIntrospection; | ||
// Predicate for errors/data can be removed after typescript 2.7. | ||
// See: https://github.com/Microsoft/TypeScript/pull/19513 | ||
function introspectionToSchema(introspection) { | ||
if (introspection.errors != null) { | ||
throw new Error('Introspection result containts errors'); | ||
throw new Error('Introspection result contains errors'); | ||
} | ||
if (introspection.data == null) { | ||
throw new Error('Missing "data" property from introspection result'); | ||
} | ||
return graphql_1.buildClientSchema(introspection.data); | ||
return graphql_1.buildClientSchema(introspection.data ? introspection.data : introspection); | ||
} | ||
@@ -134,0 +133,0 @@ exports.introspectionToSchema = introspectionToSchema; |
{ | ||
"name": "graphql-config", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "The easiest way to configure your development environment with your GraphQL schema (supported by most tools, editors & IDEs)", | ||
@@ -5,0 +5,0 @@ "main": "lib/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
79352
44
1451