SchemaService class
Service responsible for schema operations including parsing, validation, and type lookup functionality.
This service provides a centralized interface for all schema-related operations in the DartPollo code generation process. It handles:
- Schema parsing and type visitor initialization
- Type definition lookups by name
- Custom import extraction for scalar types
- Schema validation and consistency checks
The service is designed to be immutable after construction, with the schema and type visitor being initialized once and reused throughout the generation process.
Constructors
- SchemaService(DocumentNode schema)
- Creates a new SchemaService and initializes the type visitor.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schema → DocumentNode
-
The GraphQL schema document containing all type definitions
final
- typeVisitor → TypeDefinitionNodeVisitor
-
Visitor that indexes all type definitions for fast lookup
final
Methods
-
extractCustomImports(
GeneratorOptions options) → List< String> - Extracts custom imports required for scalar types based on generator options.
-
getTypeByName(
String name) → TypeDefinitionNode? - Retrieves a type definition by name from the schema.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validateSchema(
) → void - Validates the schema for consistency and completeness
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited