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

Modify Repository find* methods to include navigational properties #2632

Closed
4 tasks
bajtos opened this issue Mar 22, 2019 · 0 comments · Fixed by #2960
Closed
4 tasks

Modify Repository find* methods to include navigational properties #2632

bajtos opened this issue Mar 22, 2019 · 0 comments · Fixed by #2960
Assignees
Labels
feature Relations Model relations (has many, etc.) Repository Issues related to @loopback/repository package

Comments

@bajtos
Copy link
Member

bajtos commented Mar 22, 2019

Modify Repository find* method signatures to include navigational properties in the description of the return type

  • Add a new generic parameter Relations to CRUD-related Repository interfaces and implementations.
  • Modify the signature find and findById to return T & Relations instead of T. If this requires too many explicit casts, then consider using T & Partial<Relations> instead, assuming it improves the situation.

See the spike #2592 for more details, especially the changes made in packages/repository/src/repositories/repository.ts and packages/repository/src/repositories/legacy-juggler-bridge.ts.

Acceptance criteria

  • Modify Repository interfaces and classes as described above
  • Update API documentation
  • Update lb4 model to start emitting {ModelName}Relations interfaces
  • Update lb4 repository to include {ModelName}Relations in the generic parameters of DefaultCrudRepository we are inheriting from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Relations Model relations (has many, etc.) Repository Issues related to @loopback/repository package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants