import { Id, NullableId, Paginated, Params, ServiceMethods } from '@feathersjs/feathers' import { Application } from '../../declarations' interface Data {} interface ServiceOptions {} export class Graphql implements ServiceMethods { app: Application options: ServiceOptions constructor (options: ServiceOptions = {}, app: Application) { this.options = options this.app = app } async find (params?: Params): Promise> { return [] } async get (id: Id, params?: Params): Promise { return { id, text: `A new message with ID: ${id}!` } } async create (data: Data, params?: Params): Promise { if (Array.isArray(data)) { return await Promise.all(data.map(current => this.create(current, params))) } return data } async update (id: NullableId, data: Data, params?: Params): Promise { return data } async patch (id: NullableId, data: Data, params?: Params): Promise { return data } async remove (id: NullableId, params?: Params): Promise { return { id } } }