From b2ead32a05651d0f5c32a24363de0d41882e3846 Mon Sep 17 00:00:00 2001 From: Tom Gasson Date: Fri, 25 Nov 2022 11:25:25 +1100 Subject: [PATCH] Expose printDirective function --- src/index.ts | 2 ++ src/utilities/index.ts | 1 + src/utilities/printSchema.ts | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 5e05627fbe..affde5fcc0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -430,6 +430,8 @@ export { printSchema, // Print a GraphQLType to GraphQL Schema language. printType, + // Print a GraphQLDirective to GraphQL Schema language. + printDirective, // Prints the built-in introspection schema in the Schema Language format. printIntrospectionSchema, // Create a GraphQLType from a GraphQL language AST. diff --git a/src/utilities/index.ts b/src/utilities/index.ts index a29f667671..6968dca4d3 100644 --- a/src/utilities/index.ts +++ b/src/utilities/index.ts @@ -49,6 +49,7 @@ export { lexicographicSortSchema } from './lexicographicSortSchema.js'; export { printSchema, printType, + printDirective, printIntrospectionSchema, } from './printSchema.js'; diff --git a/src/utilities/printSchema.ts b/src/utilities/printSchema.ts index 527cf4be17..b24ddb6bad 100644 --- a/src/utilities/printSchema.ts +++ b/src/utilities/printSchema.ts @@ -269,7 +269,7 @@ function printInputValue(arg: GraphQLInputField): string { return argDecl + printDeprecated(arg.deprecationReason); } -function printDirective(directive: GraphQLDirective): string { +export function printDirective(directive: GraphQLDirective): string { return ( printDescription(directive) + 'directive @' +