graphql_client_codegen/query/
operations.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use super::SelectionId;
use crate::schema::ObjectId;
use heck::*;

#[derive(Debug, Clone)]
pub(crate) enum OperationType {
    Query,
    Mutation,
    Subscription,
}

pub(crate) struct ResolvedOperation {
    pub(crate) name: String,
    pub(crate) _operation_type: OperationType,
    pub(crate) selection_set: Vec<SelectionId>,
    pub(crate) object_id: ObjectId,
}

impl ResolvedOperation {
    pub(crate) fn to_path_segment(&self) -> String {
        self.name.to_upper_camel_case()
    }
}