GraphQL schema introspection utility that fetches and caches GraphQL schemas at runtime for URL state management. Supports authentication and provides efficient caching with 24-hour localStorage persistence. ## Key Components - **`GraphQLIntrospector`** - Singleton class managing schema introspection with caching - **`introspector`** - Pre-instantiated singleton instance for global use - **`SchemaCache`** - Interface defining localStorage cache structure - **`fetchSchema()`** - Main method to fetch schema with authentication support - **`getInputTypeFields()`** - Extracts field definitions from GraphQL input types - **Cache management** - Automatic localStorage caching with version control ## Usage Example ```typescript import { introspector } from './introspection' // Initialize with authentication await introspector.fetchSchema( 'https://api.example.com/graphql', { 'Authorization': 'Bearer your-token' } ) // Get fields from an input type for URL state const filterFields = introspector.getInputTypeFields('LogFilterInput') // Returns: { // severity: { name: 'severity', type: 'array', required: false }, // toolType: { name: 'toolType', type: 'string', required: true } // } // Check if schema is loaded if (introspector.isLoaded()) { const hasType = introspector.hasType('UserInput') } // Clear cache when needed introspector.clearCache() ``` The class automatically handles GraphQL type unwrapping (NonNull, List wrappers) and maps GraphQL types to JavaScript types suitable for URL serialization. Cache is automatically managed with 24-hour expiration and version validation.