Portfolio:Initiative Membership Backend #89
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also: refactors some naming conventions to make memberships more consistently named.
NOTE - this PR demonstrates the two strategies we'll use for relational object population. On high-cardinality relationships (i.e. Portfolios that are members of an Initiative) we'll populate them only on single-object retrievals, using the
get relationships
type DB methods. On low cardinality relationships (i.e. Initiatives that are attached to a portfolio), we'll populate the membership as an empty shell object on the entity, and use thepopulateX
resolver helpers to populate the full thing. See that in this PR, despite the relationship being the same one, we use one strategy when looking up an initiative (which may have tens of thousands of portfolios) vs looking up a portfolio (which may have 1-2 initiatives). This allows us to do an appropriate amount of data retrieval in each context.Hope that makes sense!