graphql-composition 0.12.2

An implementation of GraphQL federated schema composition
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use super::ast;

pub(super) trait GetArgumentsExt<'a> {
    fn get_argument(&self, argument_name: &str) -> Option<cynic_parser::values::ConstValue<'a>>;
}

impl<'a> GetArgumentsExt<'a> for ast::Directive<'a> {
    fn get_argument(&self, argument_name: &str) -> Option<cynic_parser::values::ConstValue<'a>> {
        self.arguments()
            .find(|arg| arg.name() == argument_name)
            .map(|arg| arg.value())
    }
}