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

InboxPage: use sparse fields to improve query performance #1067

Merged
merged 2 commits into from
Apr 15, 2019

Conversation

Gnito
Copy link
Contributor

@Gnito Gnito commented Apr 12, 2019

NOTE: If you have changed InboxPage component, check if any data is missing. This deliberately drops some of the fields of Transaction and user entities away from the template.

This improves InboxPage performance a bit by reducing the amount of fetched data. It also serves as an example of how to use sparse fields:

    'fields.transaction': [
      'lastTransition',
      'lastTransitionedAt',
      'transitions',
      'payinTotal',
      'payoutTotal',
    ],
    'fields.user': ['profile.displayName', 'profile.abbreviatedName'],

Currently, TransactionPage doesn't use data loaded on InboxPage. So, we can expect that there is no partially loaded data when TransactionPage is rendered.
(So, this differs from navigating from SearchPage to ListingPage.)

@Gnito Gnito force-pushed the inbox-page-uses-sparse-fields branch from ebb4080 to 976b740 Compare April 12, 2019 13:20
@Gnito Gnito changed the base branch from search-page-uses-sparse-fields to master April 12, 2019 13:20
@Gnito Gnito merged commit 0f9c74b into master Apr 15, 2019
@Gnito Gnito deleted the inbox-page-uses-sparse-fields branch April 15, 2019 08:28
@Gnito Gnito mentioned this pull request Apr 24, 2019
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

Successfully merging this pull request may close these issues.

1 participant