Thinkmill / Thinkmill/keystatic

allow `defaultValue` on `relationship` and `multiRelationship` fields

Open
#1,235 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
2.4k
Forks
159
Avg merge
21h 41m
Merged PRs (30d)
2

Description

it would be great to be able to add a defaultValue to relationship and multiRelationship fields, i.e.:

categories: fields.multiRelationship({
  label: "Categories",
  collection: "categories",
  validation: { length: { min: 1 } },
  defaultValue: ["something"],
}),
source: fields.relationship({
  label: "Source",
  collection: "sources",
  validation: { isRequired: true },
  defaultValue: "something",
}),

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TypeScript entry points for relationship and multiRelationship fields and checking how existing defaultValue options are handled. Use the examples in the issue to define expected single- and multi-value defaults, then run the relevant field tests if they are present; done means both field types accept and apply defaultValue consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.