Skip to content

Commit 54013c4

Browse files
committed
added objects to union type
1 parent d3335ae commit 54013c4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/analysis/buildTypeWeights.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,11 @@ function parseTypes(schema: GraphQLSchema, typeWeights: TypeWeightSet): TypeWeig
286286
fieldTypes[field] = {
287287
weight: common[field].weight,
288288
};
289+
} else if (isObjectType(current) || isInterfaceType(current) || isUnionType(current)) {
290+
fieldTypes[field] = {
291+
resolveTo: common[field].resolveTo,
292+
weight: typeWeights.object,
293+
};
289294
} else if (isListType(current)) {
290295
fieldTypes[field] = {
291296
resolveTo: common[field].resolveTo,

0 commit comments

Comments
 (0)