Skip to content

Where parameters do not have relationship typings #65

@Ansis100

Description

@Ansis100

/**
* an object to be used for a query identifier
* Its keys are the identifier attributes for the where, and the values are the values for that attribute
*/
export interface WhereParamsI {
/** the attribute and values for an identifier */
[attribute: string]: WhereValuesI;
}

The key of WhereParamsI is a string type. This can cause errors that are difficult to debug. For example:

user.findRelationships({
  alias: 'Group',
  where: { target: { grpName: 'Administrators' } },
});

If the model of user groups has a property called groupName then this will fail only at runtime when findRelationships returns zero results.

It would be better if the key of WhereParamsI were typed to be the keys of the related node properties.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions