convertDirectivesToExtensions = (typeComposer, directives) => {
  const extensions = {}
  directives.forEach(({ name, args }) => {
    switch (name) {
      case `infer`:
      case `dontInfer`: {
        extensions[`infer`] = name === `infer`
        break
      }
      case `mimeTypes`:
        extensions[`mimeTypes`] = args
        break
      case `childOf`:
        extensions[`childOf`] = args
        break
      case `nodeInterface`:
        if (typeComposer instanceof InterfaceTypeComposer) {
          extensions[`nodeInterface`] = true
        }
        break
      default:
    }
  })

  return extensions
}
@param {import("graphql-compose").AnyTypeComposer} typeComposer
@param {Array<import("graphql-compose").Directive>} directives
@return {{infer?: boolean, mimeTypes?: { types: Array<string> }, childOf?: { types: Array<string> }, nodeInterface?: boolean}}