import { applyMiddleware } from 'stook-graphql'
applyMiddleware(async (ctx, next) => {
  ctx.headers.Authorization = `bearer token...`
  await next()
  ctx.body = { data: ctx.body }
})
applyMiddleware(async (ctx, next) => {
  try {
    await next()
  } catch (error) {
    ctx.body = { error: ctx.body }
  }
})