@@ -145,22 +145,25 @@ export function buildInterfaceFieldDefinition({
145
145
config ,
146
146
) ;
147
147
const typeMetadata = buildTypeMetadata ( fieldNode . type , schema , config ) ;
148
- const fieldText = indent (
149
- `${ functionDefinition } : ${ typeMetadata . typeName } ${
150
- typeMetadata . isNullable ? "?" : ""
151
- } `,
152
- 2 ,
148
+ const defaultDefinitionValue = typeMetadata . isNullable ? "?" : "" ;
149
+ const field = buildField (
150
+ node ,
151
+ fieldNode ,
152
+ functionDefinition ,
153
+ defaultDefinitionValue ,
154
+ typeInResolverInterfacesConfig ,
155
+ typeMetadata ,
153
156
) ;
154
157
const annotations = buildAnnotations ( {
155
158
config,
156
159
definitionNode : fieldNode ,
157
160
typeMetadata,
158
161
} ) ;
159
- return `${ annotations } ${ fieldText } ` ;
162
+ return `${ annotations } ${ field } ` ;
160
163
}
161
164
162
165
function buildField (
163
- node : ObjectTypeDefinitionNode ,
166
+ node : ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode ,
164
167
fieldNode : FieldDefinitionNode ,
165
168
functionDefinition : string ,
166
169
defaultDefinitionValue : string ,
@@ -309,7 +312,7 @@ function shouldModifyFieldWithOverride(
309
312
}
310
313
311
314
function getDefaultImplementation (
312
- node : ObjectTypeDefinitionNode ,
315
+ node : ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode ,
313
316
fieldNode : FieldDefinitionNode ,
314
317
typeInResolverInterfacesConfig : ReturnType <
315
318
typeof findTypeInResolverInterfacesConfig
0 commit comments