{"size": 1753, "ext": "js", "max_stars_repo_path": "src/errors.js", "max_stars_repo_name": "budde377/graphql-to-flow", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/errors.js", "max_issues_repo_name": "budde377/graphql-to-flow", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/errors.js", "max_forks_repo_name": "budde377/graphql-to-flow", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.3472222222, "max_line_length": 117, "alphanum_fraction": 0.7239018825}
// @flow

import type { GraphQLCompositeType, GraphQLNamedType, GraphQLOutputType, GraphQLType } from 'graphql/type/definition'
import type { NameNode, OperationTypeNode } from 'graphql/language/ast'

export class LinkError extends Error {
  name: string

  constructor (name: string) {
    super(`Could not resolve seleciton with name: ${name}`)
    this.name = name
  }
}

export class TransformError extends Error {}

export class ResolveTypeError extends TransformError {
  type: NameNode

  constructor (type: NameNode) {
    super(`Could not resolve type: ${type.value}`)
    this.type = type
  }
}

export class ResolveTransformError extends TransformError {
  o: OperationTypeNode

  constructor (o: OperationTypeNode) {
    super(`Could not resolve operation: ${o}`)
    this.o = o
  }
}

export class TypeTransformError extends TransformError {
  type: GraphQLType

  constructor (type: GraphQLType) {
    super(`Could not resolve type for ${type.toString()}`)
    this.type = type
  }
}

export class ResolveFieldTransformError extends TransformError {
  type: GraphQLCompositeType
  n: NameNode

  constructor (name: NameNode, type: GraphQLCompositeType) {
    super(`Could not resolve field "${name.value}" on type: ${type.name}`)
    this.type = type
    this.n = name
  }
}

export class InvariantError extends Error {}

export class ResolveCompositeTransformError extends Error {
  type: GraphQLNamedType
  constructor (type: GraphQLNamedType) {
    super(`Could not resolve composite type ${type.name}`)
    this.type = type
  }
}

export class ResolveInputTransformError extends Error {
  type: GraphQLNamedType
  constructor (type: GraphQLNamedType) {
    super(`Could not resolve input type ${type.name}`)
    this.type = type
  }
}
