pub struct QueryNode {
pub field: String,
pub type_name: String,
pub children: Vec<QueryNode>,
pub is_list: bool,
pub args: HashMap<String, String>,
}Expand description
A node in a simplified GraphQL query tree.
Fields§
§field: String§type_name: String§children: Vec<QueryNode>§is_list: booltrue if this field returns a list of items (e.g. [User!]!).
args: HashMap<String, String>Resolved argument values (e.g. "first" -> "10").
Implementations§
Source§impl QueryNode
impl QueryNode
Sourcepub fn leaf(field: impl Into<String>, type_name: impl Into<String>) -> Self
pub fn leaf(field: impl Into<String>, type_name: impl Into<String>) -> Self
Create a leaf node (no children, not a list).
Sourcepub fn with_children(
field: impl Into<String>,
type_name: impl Into<String>,
children: Vec<QueryNode>,
) -> Self
pub fn with_children( field: impl Into<String>, type_name: impl Into<String>, children: Vec<QueryNode>, ) -> Self
Create a non-list node with children.
Sourcepub fn list_field(
field: impl Into<String>,
type_name: impl Into<String>,
children: Vec<QueryNode>,
) -> Self
pub fn list_field( field: impl Into<String>, type_name: impl Into<String>, children: Vec<QueryNode>, ) -> Self
Create a list field node with children.
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Total number of fields (nodes) in this subtree.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QueryNode
impl RefUnwindSafe for QueryNode
impl Send for QueryNode
impl Sync for QueryNode
impl Unpin for QueryNode
impl UnsafeUnpin for QueryNode
impl UnwindSafe for QueryNode
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more