Skip to content

feat: pass nullable into many-to-one custom relations#4895

Draft
LucidityDesign wants to merge 15 commits into
vendurehq:minorfrom
LucidityDesign:feat/nullable-relations
Draft

feat: pass nullable into many-to-one custom relations#4895
LucidityDesign wants to merge 15 commits into
vendurehq:minorfrom
LucidityDesign:feat/nullable-relations

Conversation

@LucidityDesign

@LucidityDesign LucidityDesign commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the nullable option to ManyToOne relational custom fields.

Please see @grolmus comments in #4448 regarding the nullable behaviour. the changes of the nullable options were removed from #4448 and moved into this PR as a separate change set.

Breaking changes

This can be seen as breaking because it was already possible to set nullable: true on custom fields of type "relation", but the option was silently ignore. There is a risk that users have already set nullable: true on custom fields which will change DB behaviour after an upgrade.

Screenshots

You can add screenshots here if applicable.

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature
  • I have checked my own PR

👍 Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vendure-storybook Ready Ready Preview, Comment Jun 29, 2026 10:55am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 33c10b5b-28c7-42ba-a32c-d80ba1257fb4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment on lines +118 to +121
> = Omit<BaseTypedCustomFieldConfig<T, C>, 'nullable'> & {
list?: true;
defaultValue?: Array<DefaultValueType<T>>;
nullable?: never;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is overkill, but I find it useful to disallow options that will be ignored

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant