Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalCatalogSchema ¶ added in v1.11.0
func MarshalCatalogSchema(cs *CatalogSchema) ([]byte, error)
MarshalCatalogSchema serializes a CatalogSchema to JSON bytes
func PrintCatalogSummary ¶
func PrintCatalogSummary(dynamicSchema *DynamicSchema)
PrintCatalogSummary prints a comprehensive summary of the discovered schema
func ValidateQueryComplexity ¶ added in v1.11.0
ValidateQueryComplexity parses the query AST and rejects it if it exceeds depth, alias, or total field count thresholds.
Types ¶
type CatalogSchema ¶
type CatalogSchema struct {
Schemas map[string]*SchemaInfo // schema name -> info
}
CatalogSchema holds the complete discovered schema
func DiscoverSchemaFromChannel ¶ added in v1.11.0
func DiscoverSchemaFromChannel(metasChan <-chan *declcfg.Meta) (*CatalogSchema, error)
DiscoverSchemaFromChannel performs streaming schema discovery, processing one meta at a time through a channel. Each meta's blob is parsed, analyzed, and then goes out of scope — avoiding accumulation of all blobs in memory.
func DiscoverSchemaFromMetas ¶
func DiscoverSchemaFromMetas(metas []*declcfg.Meta) (*CatalogSchema, error)
DiscoverSchemaFromMetas analyzes Meta objects to discover schema structure.
func UnmarshalCatalogSchema ¶ added in v1.11.0
func UnmarshalCatalogSchema(data []byte) (*CatalogSchema, error)
UnmarshalCatalogSchema deserializes a CatalogSchema from JSON bytes
type DynamicSchema ¶
type DynamicSchema struct {
Schema graphql.Schema
CatalogSchema *CatalogSchema
}
DynamicSchema holds the generated GraphQL schema and metadata
func BuildDynamicGraphQLSchema ¶
func BuildDynamicGraphQLSchema(catalogSchema *CatalogSchema, loader ObjectLoader) (*DynamicSchema, error)
BuildDynamicGraphQLSchema creates a complete GraphQL schema from discovered structure. The loader is called at query time to read objects from disk with pagination.
func LoadAndSummarizeCatalogDynamic ¶
func LoadAndSummarizeCatalogDynamic(catalogFS fs.FS) (*DynamicSchema, error)
LoadAndSummarizeCatalogDynamic loads FBC from a filesystem and builds a dynamic GraphQL schema. Uses in-memory object loading — suitable for demos and CLI tools, not production serving.
type FieldInfo ¶
type FieldInfo struct {
Name string
OriginalName string // The original JSON key before remapping
GraphQLType graphql.Type
JSONType reflect.Kind
IsArray bool
NestedFields map[string]*FieldInfo // For array-of-objects, stores object structure
}
FieldInfo represents discovered field information
type ObjectLoader ¶ added in v1.11.0
ObjectLoader reads FBC objects for a given schema from disk with pagination. It is called by the root resolver at query time instead of holding all parsed objects in memory.
func NewInMemoryObjectLoader ¶ added in v1.11.0
func NewInMemoryObjectLoader(metasBySchema map[string][]*declcfg.Meta) ObjectLoader
NewInMemoryObjectLoader creates an ObjectLoader from pre-parsed metas. Used by the demo server and tests where disk-backed loading is not needed.
type SchemaInfo ¶
SchemaInfo holds discovered schema information