deep-foundation / deep-foundation/deeplinks

deep.insert does not support _id syntax

Open
#260 1 comment 0 reactions 1 assignee Claimed by @konard View on GitHub
bug
Dominant language
TypeScript
Stars
13
Forks
8
PR merge metrics
No merged PRs in 30d

Description

![image](https://github.com/deep-foundation/deeplinks/assets/1431904/a156b10a-9815-4b7a-969a-c6a8618fbc12)

This code

```js
const spaceId = 2355;
await deep.insert({
type_id: { _id: ["@deep-foundation/rss-to-deep", "Address"] },
in: { data: {
type_id: { _id: [ "@deep-foundation/core", "Contain" ] },
from_id: spaceId
}}
});
```

fails with error:

```js
client.js:397 Uncaught Error: DeepClient Insert Error: parsing Integer expected for input type: PGBigInt failed, expected Number, but encountered Object
at DeepClient.eval (client.js:396:1)
at Generator.throw ()
at rejected (client.js:5:42)
```

# Workaround

Use `await deep.id(...)`

```js
const spaceId = 2355;
await deep.insert({
type_id: await deep.id("@deep-foundation/rss-to-deep", "Address"),
in: { data: {
type_id: await deep.id("@deep-foundation/core", "Contain"),
from_id: spaceId
}}
});
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.