-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
neogma/src/Queries/Where/Where.ts
Lines 109 to 116 in da28ecc
/** | |
* 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.