import { type HookContext } from "https://dotland.deno.dev/x/feathers@v5.0.0-pre.32/mod.ts";
Type Parameters
Properties
A read only property that contains the Feathers application object. This can be used to retrieve other services (via context.app.service('name')) or configuration values.
A read only property with the name of the service method (one of find, get, create, update, patch, remove).
A read only property with the hook type (one of before, after or error).
Will be null
for asynchronous hooks.
The list of method arguments. Should not be modified, modify the
params
, data
and id
properties instead.
A writeable property containing the data of a create, update and patch service method call.
A writeable property with the error object that was thrown in a failed method call. It is only available in error hooks.
A writeable property and the id for a get, remove, update and patch service method call. For remove, update and patch context.id can also be null when modifying multiple entries. In all other cases it will be undefined.
A writeable property that contains the service method parameters (including params.query).
A writeable property containing the result of the successful service method call. It is only available in after hooks.
context.result
can also be set in
- A before hook to skip the actual service method (database) call
- An error hook to swallow the error and return a result instead
A writeable, optional property and contains a 'safe' version of the data that should be sent to any client. If context.dispatch has not been set context.result will be sent to the client instead.