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

$select should not be limited by query properties in _find #3418

Open
AshotN opened this issue Jan 31, 2024 · 0 comments
Open

$select should not be limited by query properties in _find #3418

AshotN opened this issue Jan 31, 2024 · 0 comments

Comments

@AshotN
Copy link
Contributor

AshotN commented Jan 31, 2024

Steps to reproduce

Trying to call _find like this leads to a type error if website is not available in query properties.

_find is not limited by query properties

export const companyQueryProperties = Type.Pick(companySchema, ['name', 'active', 'id', 'created_at'])
 const companys = await app.service('company')._find({
      paginate: false,
      query: {
        $select: ['name', 'website']
      },
      user: context.params.user
    })

Expected behavior

TypeScript should be aware that underscore methods have access to everything

Actual behavior

Type  "website"  is not assignable to type  "id" | "name" | "active" | "created_at" 

System configuration

"@feathersjs/feathers": "5.0.21",

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

1 participant