pub enum MetaType<'a, S = DefaultScalarValue> {
// some variants omitted
}
Expand description
Generic type metadata
Implementations§
Source§impl<'a, S> MetaType<'a, S>
impl<'a, S> MetaType<'a, S>
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
Access the name of the type, if applicable
Lists, non-null wrappers, and placeholders don’t have names.
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Access the description of the type, if applicable
Lists, nullable wrappers, and placeholders don’t have names.
Sourcepub fn specified_by_url(&self) -> Option<&str>
pub fn specified_by_url(&self) -> Option<&str>
Accesses the specification URL, if applicable.
Only custom GraphQL scalars can have a specification URL.
Sourcepub fn type_kind(&self) -> TypeKind
pub fn type_kind(&self) -> TypeKind
Construct a TypeKind
for a given type
§Panics
Panics if the type represents a placeholder or nullable type.
Sourcepub fn field_by_name(&self, name: &str) -> Option<&Field<'_, S>>
pub fn field_by_name(&self, name: &str) -> Option<&Field<'_, S>>
Access a field’s meta data given its name
Only objects and interfaces have fields. This method always returns None
for other types.
Sourcepub fn input_field_by_name(&self, name: &str) -> Option<&Argument<'_, S>>
pub fn input_field_by_name(&self, name: &str) -> Option<&Argument<'_, S>>
Access an input field’s meta data given its name
Only input objects have input fields. This method always returns None
for other types.
Sourcepub fn input_value_parse_fn(&self) -> Option<InputValueParseFn<S>>
pub fn input_value_parse_fn(&self) -> Option<InputValueParseFn<S>>
Access the input value parse function, if applicable
An input value parse function is a function that takes an InputValue
instance and returns
true
if it can be parsed as the provided type.
Only scalars, enums, and input objects have parse functions.
Sourcepub fn is_composite(&self) -> bool
pub fn is_composite(&self) -> bool
Returns true if the type is a composite type
Objects, interfaces, and unions are composite.
Sourcepub fn is_leaf(&self) -> bool
pub fn is_leaf(&self) -> bool
Returns true if the type can occur in leaf positions in queries
Only enums and scalars are leaf types.
Sourcepub fn is_abstract(&self) -> bool
pub fn is_abstract(&self) -> bool
Returns true if the type is abstract
Only interfaces and unions are abstract types.
Sourcepub fn is_input(&self) -> bool
pub fn is_input(&self) -> bool
Returns true if the type can be used in input positions, e.g. arguments or variables
Only scalars, enums, and input objects are input types.
Sourcepub fn is_builtin(&self) -> bool
pub fn is_builtin(&self) -> bool
Returns true if the type is built-in to GraphQL.