DereferenceMixin
Usage
module.exports = {
name: 'resources',
mixins: [ControlledContainerMixin, DereferenceMixin],
settings: {
path: '/resources',
dereferencePlan: [
{
property: 'publicKey'
},
{
property: 'schema:member',
nested: [{ property: 'schema:affiliation' }]
}
]
}
};
Settings
dereferencePlan
An object or array of objects that define how to dereference properties. Each object can have the following properties:
property(required): The property to dereference.nested(optional): An array of objects that define how to dereference nested properties.
Actions
This mixin automatically configures CRUD actions (see below). You can call them directly, or overwrite them.
The
postandlistactions redirect to the LdpContainerService unless they are set. Thelistaction is redirected to the LdpContainerServicegetaction. When called directly, it will automatically guess thecontainerUriparam if it is not set.The
get,create,patch,putanddeleteactions redirect to the LdpResourceService unless they are set.
You can also use Moleculer action hooks if you want to do something before or after each action call.