-
Notifications
You must be signed in to change notification settings - Fork 5
allow to provide an existing id when creating an entity #57
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
Conversation
🦋 Changeset detectedLatest commit: 1caf64f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
70c3c67 to
dad8103
Compare
| const ops: Array<Op> = []; | ||
| const { cid, dimensions } = await uploadImage(params); | ||
| const { id, ops: imageOps } = Image.make({ cid, dimensions }); | ||
| const { id, ops: imageOps } = Image.make({ cid, dimensions, id: providedId }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question
| const { name, description, cover } = params; | ||
| const entityId = generate(); | ||
| const { id, name, description, cover } = params; | ||
| const entityId = id ?? generate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question
| export const createType = ({ name, description, cover, properties }: CreateTypeParams): CreateResult => { | ||
| const id = generate(); | ||
| export const createType = ({ id: providedId, name, description, cover, properties }: CreateTypeParams): CreateResult => { | ||
| const id = providedId ?? generate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaand same question
I need it for Hypergraph since we generate entities locally with IDs and then later when we want to publish them we want to ensure they are identical.