deep-foundation / deep-foundation/deeplinks

`Value` restriction for type does not work

Open
#81 2 comments 4 reactions 1 assignee Claimed by @FreePhoenix888 View on GitHub
bug
Dominant language
TypeScript
Stars
13
Forks
8
PR merge metrics
No merged PRs in 30d

Description

# How to reproduce
1. Create a new link-type
```js
const {data: [{id: newTypeLinkId}]} = await deep.insert({
type_id: await deep.id("@deep-foundation/core", "Type")
})
```
2. Create a restriction for type `User` to have only number values
```js
await deep.insert({
type_id: await deep.id("@deep-foundation/core", "Value"),
from_id: newTypeLinkId,
to_id: await deep.id("@deep-foundation/core", "Number")
})
```
3. Insert a link of type `User` with `string` value
```js
await deep.insert({
type_id: newTypeLinkId,
string: { data: { value: "stringValue" } }
})
```

```js
const {data: [{id: newTypeLinkId}]} = await deep.insert({
type_id: await deep.id("@deep-foundation/core", "Type")
})
await deep.insert({
type_id: await deep.id("@deep-foundation/core", "Value"),
from_id: newTypeLinkId,
to_id: await deep.id("@deep-foundation/core", "Number")
})
await deep.insert({
type_id: newTypeLinkId,
string: { data: { value: "stringValue" } }
})
```

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.