@@ -18,7 +18,7 @@ import type {
1818 GraphQLInputObjectType ,
1919} from '../type/definition' ;
2020import { isIntrospectionType } from '../type/introspection' ;
21- import { GraphQLString , isSpecifiedScalarType } from '../type/scalars' ;
21+ import { isSpecifiedScalarType } from '../type/scalars' ;
2222import {
2323 DEFAULT_DEPRECATION_REASON ,
2424 isSpecifiedDirective ,
@@ -282,9 +282,9 @@ function printDeprecated(reason: ?string): string {
282282 if (reason == null) {
283283 return '';
284284 }
285- const reasonAST = astFromValue (reason, GraphQLString);
286- if (reasonAST && reason !== DEFAULT_DEPRECATION_REASON) {
287- return ' @deprecated(reason: ' + print(reasonAST) + ')' ;
285+ if (reason !== DEFAULT_DEPRECATION_REASON) {
286+ const astValue = print({ kind: 'StringValue', value: reason });
287+ return ` @deprecated ( reason : ${ astValue } ) ` ;
288288 }
289289 return ' @deprecated';
290290}
@@ -293,13 +293,8 @@ function printSpecifiedByURL(scalar: GraphQLScalarType): string {
293293 if (scalar.specifiedByURL == null) {
294294 return '';
295295 }
296- const url = scalar.specifiedByURL;
297- const urlAST = astFromValue(url, GraphQLString);
298- invariant(
299- urlAST,
300- 'Unexpected null value returned from ` astFromValue ` for specifiedByURL',
301- );
302- return ' @specifiedBy(url: ' + print(urlAST) + ')';
296+ const astValue = print({ kind: 'StringValue', value: scalar.specifiedByURL });
297+ return ` @specifiedBy ( url : ${astValue } ) `;
303298}
304299
305300function printDescription(
0 commit comments