import {Injectable, Middleware, ResponseObject} from '@extollo/lib'
import {Cobalt} from '../../services/Cobalt.service'

@Injectable()
export default class CobaltMiddleware extends Middleware {
    async apply(): Promise<ResponseObject> {
        // Create new Cobalt instance and inject into the request
        const cobalt = this.request.makeNew(Cobalt)
        this.request.registerSingletonInstance(Cobalt, cobalt)
    }
}
