@@ -350,6 +350,7 @@ export function extendSchema(
350350 description : type . description ,
351351 interfaces : ( ) => extendImplementedInterfaces ( type ) ,
352352 fields : ( ) => extendFieldMap ( type ) ,
353+ isTypeOf : type . isTypeOf ,
353354 } ) ;
354355 }
355356
@@ -360,7 +361,7 @@ export function extendSchema(
360361 name : type . name ,
361362 description : type . description ,
362363 fields : ( ) => extendFieldMap ( type ) ,
363- resolveType : cannotExecuteClientSchema ,
364+ resolveType : type . resolveType ,
364365 } ) ;
365366 }
366367
@@ -369,7 +370,7 @@ export function extendSchema(
369370 name : type . name ,
370371 description : type . description ,
371372 types : type . getTypes ( ) . map ( getTypeFromDef ) ,
372- resolveType : cannotExecuteClientSchema ,
373+ resolveType : type . resolveType ,
373374 } ) ;
374375 }
375376
@@ -409,7 +410,7 @@ export function extendSchema(
409410 deprecationReason : field . deprecationReason ,
410411 type : extendFieldType ( field . type ) ,
411412 args : keyMap ( field . args , arg => arg . name ) ,
412- resolve : cannotExecuteClientSchema ,
413+ resolve : field . resolve ,
413414 } ;
414415 } ) ;
415416
@@ -430,7 +431,6 @@ export function extendSchema(
430431 description : getDescription ( field ) ,
431432 type : buildOutputFieldType ( field . type ) ,
432433 args : buildInputValues ( field . arguments ) ,
433- resolve : cannotExecuteClientSchema ,
434434 } ;
435435 } ) ;
436436 } ) ;
@@ -475,7 +475,7 @@ export function extendSchema(
475475 name : typeAST . name . value ,
476476 description : getDescription ( typeAST ) ,
477477 fields : ( ) => buildFieldMap ( typeAST ) ,
478- resolveType : cannotExecuteClientSchema ,
478+ resolveType : cannotExecuteExtendedSchema ,
479479 } ) ;
480480 }
481481
@@ -484,15 +484,15 @@ export function extendSchema(
484484 name : typeAST . name . value ,
485485 description : getDescription ( typeAST ) ,
486486 types : typeAST . types . map ( getObjectTypeFromAST ) ,
487- resolveType : cannotExecuteClientSchema ,
487+ resolveType : cannotExecuteExtendedSchema ,
488488 } ) ;
489489 }
490490
491491 function buildScalarType ( typeAST : ScalarTypeDefinition ) {
492492 return new GraphQLScalarType ( {
493493 name : typeAST . name . value ,
494494 description : getDescription ( typeAST ) ,
495- serialize : ( ) => null ,
495+ serialize : id => id ,
496496 // Note: validation calls the parse functions to determine if a
497497 // literal value is correct. Returning null would cause use of custom
498498 // scalars to always fail validation. Returning false causes them to
@@ -543,7 +543,6 @@ export function extendSchema(
543543 type : buildOutputFieldType ( field . type ) ,
544544 description : getDescription ( field ) ,
545545 args : buildInputValues ( field . arguments ) ,
546- resolve : cannotExecuteClientSchema ,
547546 } )
548547 ) ;
549548 }
@@ -588,6 +587,8 @@ export function extendSchema(
588587 }
589588}
590589
591- function cannotExecuteClientSchema ( ) {
592- throw new Error ( 'Client Schema cannot be used for execution.' ) ;
590+ function cannotExecuteExtendedSchema ( ) {
591+ throw new Error (
592+ 'Extended Schema cannot use Interface or Union types for execution.'
593+ ) ;
593594}
0 commit comments