const options = {
Model,
id: ['entityId', 'otherEntityId'],
paginate: app.get('paginate')
}
Throws a type error, "string[] is not assignable to string", but according to the feathers-objection docs, this is how you use composite primary keys.
Unfortunately, I think fixing this also requires a change in feathers. It looks like the upstream feathers AdapterService class doesn't allow a way to override its options object type. So, even if we did
export interface ObjectionServiceOptions extends Omit<ServiceOptions, 'id'> {
model: typeof Model;
id: string | string[]; // <--change
// ...
}
We would still get a type error here:
export class Service<T = any> extends AdapterService<T> implements InternalServiceMethods<T> {
Model: typeof Model;
options: ObjectionServiceOptions;
// ...
}
The actual fix is probably to make the feathers AdapterService accept an additional type parameter: AdapterService<T = any, S = ServiceOptions>, or to change ServiceOptions, but I think that might be more breaking.