TypeMapper

Trait TypeMapper 

Source
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§

Source

fn language(&self) -> &'static str

The target language name

Source

fn map_arg_type(&self, arg_type: ArgType) -> &'static str

Map an argument type to a language-specific type string

Source

fn map_context_type(&self, field_type: &ContextFieldType) -> &'static str

Map a context field type to a language-specific type string

Provided Methods§

Source

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)

Implementors§