We decide to ignore IID information when performing type inference. This comes from the idea that IIDs are data, and the user may be trying to check whether the data conforms to a specific part of the schema. Previously, this will cause a query to throw an error due to type checking incompatibility, which made common expressions in fetch subqueries very difficult
Fetching stocks for books that are able to have stock (some subtypes of books do not have stock, such as 'ebook'):
match
$x isa book;
fetch:
stock: {
match $x isa! $t; $t owns stock;
fetch $x: stock;
};
Which will retrieve stock for books, if the polymorphically selected book instance is able to own 'stock' attributes.
This expression now returns an empty list for instances of books that cannot own stocks instead of returning an error.
Implementation
We remove the use of type information extracted from query IIDs from impacting type inference
Usage and product changes
We decide to ignore IID information when performing type inference. This comes from the idea that IIDs are data, and the user may be trying to check whether the data conforms to a specific part of the schema. Previously, this will cause a query to throw an error due to type checking incompatibility, which made common expressions in fetch subqueries very difficult
Fetching stocks for books that are able to have stock (some subtypes of books do not have stock, such as 'ebook'):
Which will retrieve stock for books, if the polymorphically selected book instance is able to own 'stock' attributes.
This expression now returns an empty list for instances of books that cannot own stocks instead of returning an error.
Implementation