File tree 3 files changed +9
-2
lines changed
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -315,6 +315,8 @@ export {
315
315
buildASTSchema ,
316
316
// Build a GraphQLSchema from a GraphQL schema language document.
317
317
buildSchema ,
318
+ // Get the description from a schema AST node.
319
+ getDescription ,
318
320
// Extends an existing GraphQLSchema from a parsed GraphQL Schema
319
321
// language AST.
320
322
extendSchema ,
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ import type {
35
35
EnumValueDefinitionNode ,
36
36
InputObjectTypeDefinitionNode ,
37
37
DirectiveDefinitionNode ,
38
+ StringValueNode ,
39
+ Location ,
38
40
} from '../language/ast' ;
39
41
40
42
import type { DirectiveLocationEnum } from '../language/directiveLocation' ;
@@ -475,7 +477,10 @@ function getDeprecationReason(
475
477
* Provide true to use preceding comments as the description.
476
478
*
477
479
*/
478
- function getDescription ( node , options : ?Options ) : void | string {
480
+ export function getDescription (
481
+ node : { + description ?: StringValueNode , + loc ?: Location } ,
482
+ options : ?Options ,
483
+ ) : void | string {
479
484
if ( node . description ) {
480
485
return node . description . value ;
481
486
}
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export { getOperationAST } from './getOperationAST';
45
45
export { buildClientSchema } from './buildClientSchema' ;
46
46
47
47
// Build a GraphQLSchema from GraphQL Schema language.
48
- export { buildASTSchema , buildSchema } from './buildASTSchema' ;
48
+ export { buildASTSchema , buildSchema , getDescription } from './buildASTSchema' ;
49
49
50
50
// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST.
51
51
export { extendSchema } from './extendSchema' ;
You can’t perform that action at this time.
0 commit comments