/**
 * GraphQL Types for Brainfish API Documentation
 * 
 * Types for parsing and representing GraphQL schemas in the documentation system.
 */ // ============================================================================
// GraphQL Scalar Types
// ============================================================================
// ============================================================================
// Helper Functions
// ============================================================================
/**
 * Format a GraphQL type reference as a string
 * e.g., [String!]! -> "[String!]!"
 */ export function formatTypeRef(typeRef) {
    if (typeRef.kind === 'NON_NULL' && typeRef.ofType) {
        return `${formatTypeRef(typeRef.ofType)}!`;
    }
    if (typeRef.kind === 'LIST' && typeRef.ofType) {
        return `[${formatTypeRef(typeRef.ofType)}]`;
    }
    return typeRef.name || 'Unknown';
}
/**
 * Check if a type is required (non-null at the top level)
 */ export function isTypeRequired(typeRef) {
    return typeRef.kind === 'NON_NULL';
}
/**
 * Get the base type name from a type reference
 */ export function getBaseTypeName(typeRef) {
    if (typeRef.ofType) {
        return getBaseTypeName(typeRef.ofType);
    }
    return typeRef.name || 'Unknown';
}
/**
 * Check if a type is a scalar type
 */ export function isScalarType(typeName) {
    return [
        'String',
        'Int',
        'Float',
        'Boolean',
        'ID'
    ].includes(typeName);
}
