cynic-parser 0.11.1

A fast, correct and easy to use GraphQL parser
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{
    AstLookup,
    common::StringLiteral,
    executable::{ExecutableId, ids::StringLiteralId},
};

impl ExecutableId for StringLiteralId {
    type Reader<'a> = StringLiteral<'a>;

    fn read(self, document: &super::ExecutableDocument) -> Self::Reader<'_> {
        match self {
            StringLiteralId::String(id) => StringLiteral::new_string(document.lookup(id)),
            StringLiteralId::Block(id) => StringLiteral::new_block(document.lookup(id)),
        }
    }
}