Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31adf9b

Browse files
committed
Expose printType for test/debug purposes.
1 parent 87a6468 commit 31adf9b

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ export {
274274
// Print a GraphQLSchema to GraphQL Schema language.
275275
printSchema,
276276

277+
// Print a GraphQLType to GraphQL Schema language.
278+
printType,
279+
277280
// Create a GraphQLType from a GraphQL language AST.
278281
typeFromAST,
279282

src/utilities/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ export { buildASTSchema, buildSchema } from './buildASTSchema';
4343
export { extendSchema } from './extendSchema';
4444

4545
// Print a GraphQLSchema to GraphQL Schema language.
46-
export { printSchema, printIntrospectionSchema } from './schemaPrinter';
46+
export {
47+
printSchema,
48+
printType,
49+
printIntrospectionSchema,
50+
} from './schemaPrinter';
4751

4852
// Create a GraphQLType from a GraphQL language AST.
4953
export { typeFromAST } from './typeFromAST';

src/utilities/schemaPrinter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function isSchemaOfCommonNames(schema: GraphQLSchema): boolean {
136136
return true;
137137
}
138138

139-
function printType(type: GraphQLType): string {
139+
export function printType(type: GraphQLType): string {
140140
if (type instanceof GraphQLScalarType) {
141141
return printScalar(type);
142142
} else if (type instanceof GraphQLObjectType) {

0 commit comments

Comments
 (0)