diff --git a/packages/openapi-to-graphql/src/schema_builder.ts b/packages/openapi-to-graphql/src/schema_builder.ts index 0475f456..ff32df92 100644 --- a/packages/openapi-to-graphql/src/schema_builder.ts +++ b/packages/openapi-to-graphql/src/schema_builder.ts @@ -396,13 +396,6 @@ function createOrReuseUnion({ } ) - /** - * Check for ambiguous member types - * - * i.e. member types that can be confused with each other. - */ - checkAmbiguousMemberTypes(def, types, data) - def.graphQLType = new GraphQLUnionType({ name: def.graphQLTypeName, description, @@ -436,6 +429,13 @@ function createOrReuseUnion({ } }) + /** + * Check for ambiguous member types + * + * i.e. member types that can be confused with each other. + */ + checkAmbiguousMemberTypes(def, types, data) + return def.graphQLType } }