Open
Description
Describe the bug
When adding a struct custom field type, we get an error while validating the schema. Apparently the {Entity}{CustomFieldName}StructInput
type is not defined.
Work arounds:
- Make the field
readonly: true
, since in this case no update mutation will be created. - We can just add the missing struct input ourself:
To Reproduce
Steps to reproduce the behavior:
- Add custom field
config.customFields.GlobalSettings.push({
type: 'struct',
name: 'openAiSettings',
fields: [
{
type: 'string',
name: 'openAiEndpoint',
label: [{ languageCode: LanguageCode.en, value: 'OpenAI Endpoint' }],
},
{
type: 'string',
name: 'openAiApiKey',
label: [{ languageCode: LanguageCode.en, value: 'OpenAI API Key' }],
ui: { component: 'password-form-input' },
},
],
});
- Run server
Expected behavior
No error and a working update mutation.
Environment (please complete the following information):
- @vendure/core version: 3.1.2
- Nodejs version: 20