Skip to main content

interstice_abi/schema/
query.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{FieldDef, IntersticeType};
4
5#[derive(Debug, Clone, Deserialize, Serialize)]
6pub struct QuerySchema {
7    pub name: String,
8    pub arguments: Vec<FieldDef>,
9    pub return_type: IntersticeType,
10}
11
12impl QuerySchema {
13    pub fn new(
14        name: impl Into<String>,
15        arguments: Vec<FieldDef>,
16        return_type: IntersticeType,
17    ) -> Self {
18        Self {
19            name: name.into(),
20            arguments,
21            return_type,
22        }
23    }
24}