Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing update input schema for struct custom fields #3347

Open
Draykee opened this issue Feb 5, 2025 · 1 comment
Open

Missing update input schema for struct custom fields #3347

Draykee opened this issue Feb 5, 2025 · 1 comment
Labels
type: bug 🐛 Something isn't working

Comments

@Draykee
Copy link
Contributor

Draykee commented Feb 5, 2025

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:
    Image

To Reproduce
Steps to reproduce the behavior:

  1. 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' },
                },
            ],
        });
  1. 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
@Draykee Draykee added the type: bug 🐛 Something isn't working label Feb 5, 2025
@sergio-irigoyen
Copy link

I'm experiencing the same issue, but only on the Order entity, for some reason. I have a struct on the OrderLine entity and it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants