@@ -11,10 +11,10 @@ See the License for the specific language governing permissions and
1111limitations under the License.
1212*/
1313
14- import { buildListType } from "./build-type-metadata" ;
15- import { getFieldTypeName } from "./dependent-type-utils" ;
14+ import { buildTypeMetadata } from "./build-type-metadata" ;
1615import {
1716 FieldDefinitionNode ,
17+ GraphQLSchema ,
1818 InterfaceTypeDefinitionNode ,
1919 Kind ,
2020 ObjectTypeDefinitionNode ,
@@ -26,6 +26,7 @@ import { CodegenConfigWithDefaults } from "./build-config-with-defaults";
2626export function buildFieldDefinition (
2727 fieldNode : FieldDefinitionNode ,
2828 definitionNode : ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode ,
29+ schema : GraphQLSchema ,
2930 config : CodegenConfigWithDefaults ,
3031 completableFuture ?: boolean ,
3132) {
@@ -36,10 +37,10 @@ export function buildFieldDefinition(
3637 ? "fun"
3738 : "suspend fun"
3839 : "val" ;
39- const existingFieldArguments = fieldNode . arguments ?. map (
40- ( arg ) =>
41- `${ arg . name . value } : ${ buildListType ( arg . type , getFieldTypeName ( arg . type ) ) } ${ arg . type . kind === Kind . NON_NULL_TYPE ? "" : "?" } ` ,
42- ) ;
40+ const existingFieldArguments = fieldNode . arguments ?. map ( ( arg ) => {
41+ const typeMetadata = buildTypeMetadata ( arg . type , schema , config ) ;
42+ return `${ arg . name . value } : ${ typeMetadata . typeName } ${ arg . type . kind === Kind . NON_NULL_TYPE ? "" : "?" } ` ;
43+ } ) ;
4344 const additionalFieldArguments = config . extraResolverArguments
4445 ?. map ( ( { typeNames, argumentType, argumentName } ) => {
4546 const shouldIncludeArg =
0 commit comments