Simpler Syntax for Inclusion #3205
Labels
developer-experience
Issues affecting ease of use and overall experience of LB users
feature
Repository
Issues related to @loopback/repository package
Description / Steps to reproduce / Feature proposal
See https://github.com/strongloop/loopback-next/pull/3171/files#r296128644.
Currently to specify inclusion, the following filter syntax is needed:
{include: [{relation: 'todos'}]}
e.g. http://127.0.0.1:3000/todo-lists?filter[include][][relation]=todosIf we try the following call:
The complier complains:
Argument of type '{ include: string[]; }' is not assignable to parameter of type 'Filter<TodoList>'
because the type is currently:include?: Inclusion<MT>[];
As LoopBack 3 supports
{include: ['todos']}
, LoopBack 4 should support this shortcut as well.Acceptance Criteria
{include: ['todos']}
is accepted.Important: we need to preserve backwards compatiblity, i.e. the current verbose syntax must stay supported too.
The text was updated successfully, but these errors were encountered: