Creating nested resources (drafting)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- backend-api-design, databases
Research direction
No files, tests, or entry points are named. Begin by locating the resource-creation and commit or transaction APIs, then compare how sequential posts, nested objects, and draft resources are currently handled. Done requires a decided approach for creating nested resources without exposing invalid intermediate resources, followed by implementation and coverage for the chosen behavior.
Written by the indexing model from the issue text.
Description
Instantiating a new resource can be a bit awkward / unintuitive, at the moment. Consider, for example, creating a Recipe. You start with a title, a description, and then the ingredients. The ingredients are individual Resources, each with their own id and properties - one of which being a relationship to the parent Recipe. This relationship, however, cannot be created while inside the form, as the resource has not yet been created: there is no ID yet.
The user shouldn't have to think about all this.
Sequential posts
- Means that invalid resources still exist
- First post has a Draft
is-aattribute type, which means that all properties are allowed. This resource includes afuture-is-aproperty.
Nested objects
- Anonymous resources
Do not render 'new child' option in initial forms
- Means that we can't have requirements for new children
Approaches for draft resources
Add a Draft class
Draft is-a attribute type, which means that all properties are allowed. This resource includes a future-is-a property.
Add a is-draft property to resource
- Means that commits
Add is-draft to commits
- Makes all fields optional
Implement multi step transaction
- We start with a post for a new transaction, which returns an ID for that transaction
- The next POST will be a Commit with a TransactionID, which is a temporary session related ID
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 82
- Avg merge
- 10h 34m
- Merged PRs (30d)
- 205
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ontola/atomic-server
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ontola/atomic-server#1569 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ontola/atomic-server#1494 ·
-
browser
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ontola/atomic-server#1213 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ontola/atomic-server#1588 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ontola/atomic-server#1584 · 1 comment ·
All issues in ontola/atomic-server
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·