pub struct Field<'a, S> { /* private fields */ }
Expand description
Metadata for a field
Implementations
sourceimpl<'a, S> Field<'a, S>
impl<'a, S> Field<'a, S>
sourcepub fn description(self, description: &str) -> Self
pub fn description(self, description: &str) -> Self
Set the description of the field
This overwrites the description if any was previously set.
sourcepub fn push_docstring(self, multiline: &[&str]) -> Field<'a, S>
pub fn push_docstring(self, multiline: &[&str]) -> Field<'a, S>
Adds a (multi)line doc string to the description of the field. Any leading or trailing newlines will be removed.
If the docstring contains newlines, repeated leading tab and space characters will be removed from the beginning of each line.
If the description hasn’t been set, the description is set to the provided line. Otherwise, the doc string is added to the current description after a newline.
sourcepub fn argument(self, argument: Argument<'a, S>) -> Self
pub fn argument(self, argument: Argument<'a, S>) -> Self
Add an argument to the field
Arguments are unordered and can’t contain duplicates by name.
sourcepub fn deprecated(self, reason: Option<&str>) -> Self
pub fn deprecated(self, reason: Option<&str>) -> Self
Set the field to be deprecated with an optional reason.
This overwrites the deprecation reason if any was previously set.
Trait Implementations
sourceimpl<'a, S: 'a> GraphQLType<S> for Field<'a, S>where
S: ScalarValue,
for<'__b> &'__b S: ScalarRefValue<'__b>,
impl<'a, S: 'a> GraphQLType<S> for Field<'a, S>where
S: ScalarValue,
for<'__b> &'__b S: ScalarRefValue<'__b>,
sourcefn meta<'r>(
info: &Self::TypeInfo,
registry: &mut Registry<'r, S>
) -> MetaType<'r, S>where
for<'__b> &'__b S: ScalarRefValue<'__b>,
S: 'r,
fn meta<'r>(
info: &Self::TypeInfo,
registry: &mut Registry<'r, S>
) -> MetaType<'r, S>where
for<'__b> &'__b S: ScalarRefValue<'__b>,
S: 'r,
The meta type representing this GraphQL type.
sourcefn concrete_type_name(&self, _: &Self::Context, _: &Self::TypeInfo) -> String
fn concrete_type_name(&self, _: &Self::Context, _: &Self::TypeInfo) -> String
Return the concrete type name for this instance/union. Read more
sourcefn resolve_field(
&self,
info: &Self::TypeInfo,
field: &str,
args: &Arguments<'_, S>,
executor: &Executor<'_, Self::Context, S>
) -> ExecutionResult<S>
fn resolve_field(
&self,
info: &Self::TypeInfo,
field: &str,
args: &Arguments<'_, S>,
executor: &Executor<'_, Self::Context, S>
) -> ExecutionResult<S>
Resolve the value of a single field on this type. Read more
sourcefn resolve_into_type(
&self,
info: &Self::TypeInfo,
type_name: &str,
selection_set: Option<&[Selection<'_, S>]>,
executor: &Executor<'_, Self::Context, S>
) -> ExecutionResult<S>
fn resolve_into_type(
&self,
info: &Self::TypeInfo,
type_name: &str,
selection_set: Option<&[Selection<'_, S>]>,
executor: &Executor<'_, Self::Context, S>
) -> ExecutionResult<S>
Resolve this interface or union into a concrete type Read more
Auto Trait Implementations
impl<'a, S> RefUnwindSafe for Field<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for Field<'a, S>where
S: Send,
impl<'a, S> Sync for Field<'a, S>where
S: Sync,
impl<'a, S> Unpin for Field<'a, S>where
S: Unpin,
impl<'a, S> UnwindSafe for Field<'a, S>where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more