Skip to content

Commit

Permalink
fix(refs): dont import schema-generator reference to self
Browse files Browse the repository at this point in the history
  • Loading branch information
uladkasach committed Feb 12, 2023
1 parent d68eb02 commit d1f0f78
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const defineSqlSchemaGeneratorCodeForDomainObject = ({
const referenceImports = sqlSchemaRelationship.properties
.map((propertyRelationship) => propertyRelationship.sqlSchema.reference)
.filter(isPresent)
.filter((reference) => reference.of.name !== domainObject.name) // dont import references to self
.map(
(reference) =>
`import { ${camelCase(reference.of.name)} } from './${camelCase(
Expand Down

0 comments on commit d1f0f78

Please sign in to comment.