typesWithoutInference = (typeNames = [], typeOrTypeDef) => {
  if (typeof typeOrTypeDef === `string`) {
    typeOrTypeDef = parseTypeDef(typeOrTypeDef)
  }
  if (isASTDocument(typeOrTypeDef)) {
    typeOrTypeDef.definitions.forEach(def => {
      if (!def.directives) return

      def.directives.forEach(directive => {
        if (directive.name.value === dontInferExtensionName && def.name.value) {
          typeNames.push(def.name.value)
        }
      })
    })
    return typeNames
  }
  if (isGatsbyType(typeOrTypeDef) && typeOrTypeDef.config) {
    const { extensions = {}, name } = typeOrTypeDef.config
    if (
      name &&
      (extensions[dontInferExtensionName] ||
        extensions[inferExtensionName] === false)
    ) {
      typeNames.push(name)
    }
  }
  return typeNames
}
Given a type definition, collects type names that should skip the inference process