-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
@vendure/cliP3: minorNon-critical, no workarounds existNon-critical, no workarounds existtype: bug πSomething isn't workingSomething isn't working
Description
Describe the bug
When scaffolding a translatable entity using npx vendure add, the generated gql input types in api-extensions.ts (CreateEntityInput and UpdateEntityInput) incorrectly include translatable fields at the top level in addition to inside the EntityTranslationInput. This causes duplicate form fields in the dashboard detail page and "No translation found" errors when creating/updating entities.
To Reproduce
- Run npx vendure add and select "New entity"
- Choose the "translatable" option
- Add translatable fields (e.g. title, content)
- Observe the generated
api-extensions.tsfile CreateEntityInputandUpdateEntityInputhas the translatable fields on the top level as well
Expected behavior
Translatable fields should only appear in the EntityTranslationInput
Expected generated inputs
input CreateEntityInput {
code: String!
translations: [EntityTranslationInput!]!
}
input UpdateEntityInput {
id: ID!
code: String
translations: [EntityTranslationInput!]
}
Actual behavior
The CLI generates translatable fields at both the top level and inside the translation input:
input CreateEntityInput {
title: String! # should not be here
content: String! # should not be here
code: String!
translations: [EntityTranslationInput!]!
}
input UpdateEntityInput {
id: ID!
title: String # should not be here
content: String # should not be here
code: String
translations: [EntityTranslationInput!]
}
Environment (please complete the following information):
- @vendure/core version: ^3.0.0
- Nodejs version: v24.13.0
- Database: postgres
- Operating System: macOS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@vendure/cliP3: minorNon-critical, no workarounds existNon-critical, no workarounds existtype: bug πSomething isn't workingSomething isn't working