cynic_parser/executable/
extensions.rs

1
2
3
4
5
6
7
8
9
10
11
12
use super::{FragmentDefinition, FragmentSpread};

impl<'a> FragmentSpread<'a> {
    pub fn fragment(&self) -> Option<FragmentDefinition<'a>> {
        let document = self.0.document;
        let needle = self.fragment_name();

        document
            .fragments()
            .find(|fragment| fragment.name() == needle)
    }
}