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

Sorting by related entity attributes #40

Open
symbioquine opened this issue Mar 19, 2023 · 0 comments
Open

Sorting by related entity attributes #40

symbioquine opened this issue Mar 19, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@symbioquine
Copy link
Owner

It should be possible to sort by related entity attributes like this;

await assetLink.entitySource.query(q =>
     q.findRecords('asset--animal')
      .sort('animal_type.name', '-name'));

This is currently supported by Drupal, but not fully by Orbit.js. Two things are needed to make this work;

  1. When passing the query to the remote, the query should be augmented with include=animal_type
  2. DrupalSyncQueryOperators.js needs to be updated to dereference attributes via relationships from the cache.
@symbioquine symbioquine added the enhancement New feature or request label Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant