bluejay_core/executable/
field.rs1use crate::executable::SelectionSet;
2use crate::{VariableArguments, VariableDirectives};
3
4pub trait Field {
5 type Arguments: VariableArguments;
6 type Directives: VariableDirectives;
7 type SelectionSet: SelectionSet;
8
9 fn alias(&self) -> Option<&str>;
10 fn name(&self) -> &str;
11 fn arguments(&self) -> Option<&Self::Arguments>;
12 fn directives(&self) -> Option<&Self::Directives>;
13 fn selection_set(&self) -> Option<&Self::SelectionSet>;
14
15 fn response_name(&self) -> &str {
16 self.alias().unwrap_or_else(|| self.name())
17 }
18}