druxt.js
druxt.js copied to clipboard
Add ability to alter module queries.
Is your feature request related to a problem? Please describe. Most Druxt modules execute a Fetch query against the backend to get required data, but only two of the modules provide any ability to alter the query; DruxtEntity & DruxtViews.
Describe the solution you'd like Make a DruxtModule based solution for altering the queries, with the ability to filter the returned fields, add includes, etc.
Describe alternatives you've considered N/A
Additional context
- https://www.npmjs.com/package/drupal-jsonapi-params
- https://github.com/druxt/druxt-entity/blob/develop/src/components/DruxtEntity.vue#L184-L196
- https://github.com/druxt/druxt-views/blob/develop/src/components/DruxtView.vue#L451-L491
Example option for adding includes:
<script>
export default {
druxt: {
query: {
includes: ['RELATIONSHIP_FIELD']
}
}
}
</script>