feathers-graph-populate
Version:
Add lightning fast, GraphQL-like populates to your FeathersJS API.
15 lines (10 loc) • 404 B
text/typescript
import { enableHooks } from './hooks.commons'
import type { Service } from '@feathersjs/feathers'
export default (service: Service & { graphPopulate?: any }): void => {
if (!service.graphPopulate) {
service.graphPopulate = {}
}
const methods = ['find', 'get', 'create', 'update', 'patch', 'remove']
const types = ['before', 'after']
enableHooks(service.graphPopulate, methods, types)
}