@@ -943,32 +943,20 @@ export class GraphQLField<
943
943
config : GraphQLFieldConfig < TSource , TContext , TArgs > ,
944
944
) {
945
945
const coordinate = `${ parentCoordinate } .${ name } ` ;
946
-
947
- devAssert (
948
- isPlainObj ( config ) ,
949
- `${ coordinate } field config must be an object.` ,
950
- ) ;
951
-
952
- devAssert (
953
- config . resolve == null || typeof config . resolve === 'function' ,
954
- `${ coordinate } field resolver must be a function if ` +
955
- `provided, but got: ${ inspect ( config . resolve ) } .` ,
956
- ) ;
957
-
958
- const argsConfig = config . args ?? { } ;
959
- devAssert (
960
- isPlainObj ( argsConfig ) ,
961
- `${ coordinate } args must be an object with argument names as keys.` ,
962
- ) ;
963
-
964
946
super ( coordinate ) ;
947
+
965
948
this . name = assertName ( name ) ;
966
949
this . description = config . description ;
967
950
this . type = config . type ;
968
- this . args = Object . entries ( argsConfig ) . map (
969
- ( [ argName , argConfig ] ) =>
970
- new GraphQLArgument ( coordinate , argName , argConfig ) ,
971
- ) ;
951
+
952
+ const argsConfig = config . args ;
953
+ this . args = argsConfig
954
+ ? Object . entries ( argsConfig ) . map (
955
+ ( [ argName , argConfig ] ) =>
956
+ new GraphQLArgument ( coordinate , argName , argConfig ) ,
957
+ )
958
+ : [ ] ;
959
+
972
960
this . resolve = config . resolve ;
973
961
this . subscribe = config . subscribe ;
974
962
this . deprecationReason = config . deprecationReason ;
0 commit comments