/// Gathers the fields that we want to pull at a specific level. These
/// only include fields that do not refer to nested entities.
Gathers the fields that we want to pull at a specific level. These
only include fields that do not refer to nested entities.
Gathers the fields that we want to pull at a specific level . These only include fields that do not refer to nested entities .
fn pull_attributes<A: AsAid + From<String>>(selection_set: &SelectionSet) -> Vec<A> {
    selection_set
        .items
        .iter()
        .flat_map(|item| match item {
            Selection::Field(field) => {
                if field.selection_set.items.is_empty() {
                    Some(A::from(field.name.to_string()))
                } else {
                    None
                }
            }
            _ => unimplemented!(),
        })
        .collect::<Vec<A>>()
}
fn pull_attributes < A : AsAid + From < String > > ( selection_set : & SelectionSet ) -> Vec < A > { selection_set . items . iter ( ) . flat_map ( | item | match item { Selection :: Field ( field ) => { if field . selection_set . items . is_empty ( ) { Some ( A :: from ( field . name . to_string ( ) ) ) } else { None } } _ => unimplemented ! ( ) , } ) . collect :: < Vec < A > > ( ) }
Gathers the fields that we want to pull at a specific level.
Gathers the fields that we want to pull at a specific level .
selection_set
&SelectionSet