Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing types on Factory generator #2

Open
AshotN opened this issue Nov 15, 2022 · 3 comments
Open

Missing types on Factory generator #2

AshotN opened this issue Nov 15, 2022 · 3 comments

Comments

@AshotN
Copy link

AshotN commented Nov 15, 2022

I have a UserFactory I have created that doesn't seem to complain if i don't pass any properties. The return type is also based on whatever properties I pass to it. Is this intentional?

export const UserFactory = new Factory(app.service('user'), {

})

This produces no errors, but I would expect it to

@JorgenVatle
Copy link
Owner

I believe the inferred type should be an empty object in this instance.

Type-inference, particularly for v3/v4 Feathers Services are still a little flaky in its current state. 😅

If you have some other examples I could take a look at, maybe I could help out a little more. 👍

@JorgenVatle
Copy link
Owner

Depending on how the Feathers app is constructed, the service could have an implicit any type. Making the app.service('user') yield a loose service type.

@AshotN
Copy link
Author

AshotN commented Nov 22, 2022

Here is the type for app.service('user')

FeathersApplication<ServiceTypes, Configuration>.service<"user">(path: "user"): FeathersService<Application, UserService<UserParams>>

I'm not sure what else to provide to make this easier to debug, I am on Dove so there may be some incompatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants