pub trait TypeMapper {
// Required methods
fn language(&self) -> &'static str;
fn map_arg_type(&self, arg_type: ArgType) -> &'static str;
fn map_context_type(&self, field_type: &ContextFieldType) -> &'static str;
// Provided method
fn map_optional_arg_type(&self, arg_type: ArgType) -> String { ... }
}Expand description
Trait for mapping schema types to language-specific type strings.
Implement this trait for each target language to provide type mappings.
Required Methods§
Sourcefn map_arg_type(&self, arg_type: ArgType) -> &'static str
fn map_arg_type(&self, arg_type: ArgType) -> &'static str
Map an argument type to a language-specific type string
Sourcefn map_context_type(&self, field_type: &ContextFieldType) -> &'static str
fn map_context_type(&self, field_type: &ContextFieldType) -> &'static str
Map a context field type to a language-specific type string
Provided Methods§
Sourcefn map_optional_arg_type(&self, arg_type: ArgType) -> String
fn map_optional_arg_type(&self, arg_type: ArgType) -> String
Map an optional argument type (e.g., Option<String> in Rust, string | undefined in TS)