"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LIST = 'LIST';
exports.NON_NULL = 'NON_NULL';
exports.SCALAR = 'SCALAR';
exports.OBJECT = 'OBJECT';
exports.INTERFACE = 'INTERFACE';
exports.UNION = 'UNION';
exports.ENUM = 'ENUM';
exports.INPUT_OBJECT = 'INPUT_OBJECT';
function getTypeOf(type) {
    while (type.kind === exports.LIST || type.kind === exports.NON_NULL) {
        // tslint:disable-next-line:no-parameter-reassignment
        type = type.ofType;
    }
    return type;
}
exports.getTypeOf = getTypeOf;
function getFilenameOf(type) {
    const name = getTypeOf(type).name.toLowerCase();
    if (name[0] === '_' && name[1] === '_') {
        return `${name.slice(2)}.spec.html`;
    }
    return `${name}.doc.html`;
}
exports.getFilenameOf = getFilenameOf;
const fullTypeFragment = `
  fragment FullType on __Type {
    fields(includeDeprecated: true) {
      name
      description
      args {
        ...InputValue
      }
      type {
        ...TypeRef
      }
      isDeprecated
      deprecationReason
    }
    inputFields {
      ...InputValue
    }
    interfaces {
      ...TypeRef
    }
    enumValues(includeDeprecated: true) {
      name
      description
      isDeprecated
      deprecationReason
    }
    possibleTypes {
      ...TypeRef
    }
  }`;
const inputValueFragment = `
  fragment InputValue on __InputValue {
    name
    description
    type { ...TypeRef }
    defaultValue
  }`;
const typeRefFragment = `
  fragment TypeRef on __Type {
    kind
    name
    description
    ofType {
      kind
      name
      description
      ofType {
        kind
        name
        description
        ofType {
          kind
          name
          description
          ofType {
            kind
            name
            description
            ofType {
              kind
              name
              description
              ofType {
                kind
                name
                description
                ofType {
                  kind
                  name
                  description
                }
              }
            }
          }
        }
      }
    }
  }`;
exports.query = `query IntrospectionQuery {
    __schema {
      queryType { name description kind}
      mutationType { name description kind }
      subscriptionType { name description kind }
      types {
        name
        kind
        description
        ...FullType
      }
      directives {
        name
        description
        locations
        args {
          ...InputValue
        }
      }
    }
  }

  ${fullTypeFragment}
  ${inputValueFragment}
  ${typeRefFragment}
`;
exports.queryRoot = `query IntrospectionQuery {
    __schema {
      queryType { name description kind}
      mutationType { name description kind }
      subscriptionType { name description kind }
    }
  }
`;
exports.queryTypes = `query IntrospectionQuery {
    __schema {
      types {
        name
        kind
        description
        ...FullType
      }
    }
  }

  ${fullTypeFragment}
  ${inputValueFragment}
  ${typeRefFragment}
`;
exports.queryDirectives = `query IntrospectionQuery {
    __schema {
      directives {
        name
        description
        locations
        args {
          ...InputValue
        }
      }
    }
  }

  ${inputValueFragment}
  ${typeRefFragment}
`;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50cm9zcGVjdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvdXRpbGl0eS9pbnRyb3NwZWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRWEsUUFBQSxJQUFJLEdBQUcsTUFBTSxDQUFDO0FBQ2QsUUFBQSxRQUFRLEdBQUcsVUFBVSxDQUFDO0FBQ3RCLFFBQUEsTUFBTSxHQUFHLFFBQVEsQ0FBQztBQUNsQixRQUFBLE1BQU0sR0FBRyxRQUFRLENBQUM7QUFDbEIsUUFBQSxTQUFTLEdBQUcsV0FBVyxDQUFDO0FBQ3hCLFFBQUEsS0FBSyxHQUFHLE9BQU8sQ0FBQztBQUNoQixRQUFBLElBQUksR0FBRyxNQUFNLENBQUM7QUFDZCxRQUFBLFlBQVksR0FBRyxjQUFjLENBQUM7QUFFM0MsU0FBZ0IsU0FBUyxDQUFDLElBQWE7SUFDckMsT0FBTyxJQUFJLENBQUMsSUFBSSxLQUFLLFlBQUksSUFBSSxJQUFJLENBQUMsSUFBSSxLQUFLLGdCQUFRLEVBQUU7UUFDbkQscURBQXFEO1FBQ3JELElBQUksR0FBRyxJQUFJLENBQUMsTUFBaUIsQ0FBQztLQUMvQjtJQUVELE9BQU8sSUFBSSxDQUFDO0FBQ2QsQ0FBQztBQVBELDhCQU9DO0FBR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