You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
e.insert(e.StrategyGamer,{faveGame: strategyGame,// ^^^^^^^^^^^^^^^^^^^^^^ link `faveGame` is not allowed even though it should befirstName: "A",lastName: "A",});
Schema
abstract type Game {
# ...
}
type FpsGame extending Game {
# ...
}
type StrategyGame extending Game {
# ...
}
abstract type Person {
link faveGame -> Game; # 👈 optional link
required property firstName -> str;
required property lastName -> str;
}
abstract type Gamer extending Person {
# ...
}
type StrategyGamer extending Gamer {
overloaded required link faveGame -> StrategyGame; # 👈 overloaded link, required and specialised subtype
}
Generated EdgeQL
The EdgeQL does generate correctly. It's just TS which isn't happy with it.
faveGame is not an allowed property when trying to insert a new StrategyGamer. But not only should it be allowed - because StrategyGamer extends Person which has a link faveGame -> Game - but it should actually be required; since StrategyGamer overloads the link to make it required + more specialised.
This bug only seems to happen when the overloaded link is both required and refers to a subtype, but not when only one of those two changes are made.
There is no faveGame in the allowed insert query fields, not even optional
But inserting a new Gamer - i.e. a direct inheritor of Person where faveGame is defined - does correctly know about faveGame
Versions (please complete the following information):
OS: Windows 10 Home build 19045.2846
EdgeDB version (e.g. 2.0): 2.13+c171f92
EdgeDB CLI version (e.g. 2.0): 2.3.1+ef99779
edgedb-js version (e.g. 0.20.10;):
@edgedb/generate version (e.g. 0.0.7;): 0.1.0
Typescript version: 5.0.4
Node/Deno version: Node v18.15.0
The text was updated successfully, but these errors were encountered:
Code
Schema
Generated EdgeQL
The EdgeQL does generate correctly. It's just TS which isn't happy with it.
Error or desired behavior
faveGame
is not an allowed property when trying to insert a newStrategyGamer
. But not only should it be allowed - becauseStrategyGamer
extendsPerson
which has alink faveGame -> Game
- but it should actually be required; sinceStrategyGamer
overloads the link to make it required + more specialised.This bug only seems to happen when the overloaded link is both required and refers to a subtype, but not when only one of those two changes are made.
There is no
faveGame
in the allowed insert query fields, not even optionalBut inserting a new
Gamer
- i.e. a direct inheritor ofPerson
wherefaveGame
is defined - does correctly know aboutfaveGame
Versions (please complete the following information):
2.0
): 2.13+c171f922.0
): 2.3.1+ef99779edgedb-js
version (e.g.0.20.10
;):@edgedb/generate
version (e.g.0.0.7
;): 0.1.0The text was updated successfully, but these errors were encountered: