Movatterモバイル変換


[0]ホーム

URL:


Docs.rs

StructSchemaBuilder

Source
pub struct SchemaBuilder<Query, Mutation, Subscription> {/* private fields */ }
Expand description

Schema builder

Implementations§

Source§

impl<Query, Mutation, Subscription>SchemaBuilder<Query, Mutation, Subscription>

Source

pub fnregister_input_type<T:InputType>(self) -> Self

Manually register a input type in the schema.

You can use this function to register schema types that are not directlyreferenced.

Source

pub fnregister_output_type<T:OutputType>(self) -> Self

Manually register a output type in the schema.

You can use this function to register schema types that are not directlyreferenced.

Source

pub fndisable_introspection(self) -> Self

Disable introspection queries.

Source

pub fnintrospection_only(self) -> Self

Only process introspection queries, everything else is processed as anerror.

Source

pub fnlimit_complexity(self, complexity:usize) -> Self

Set the maximum complexity a query can have. By default, there is nolimit.

Source

pub fnlimit_depth(self, depth:usize) -> Self

Set the maximum depth a query can have. By default, there is no limit.

Source

pub fnlimit_recursive_depth(self, depth:usize) -> Self

Set the maximum recursive depth a query can have. (default: 32)

If the value is too large, stack overflow may occur, usually32 isenough.

Source

pub fnlimit_directives(self, max_directives:usize) -> Self

Set the maximum number of directives on a single field. (default: nolimit)

Source

pub fnextension(self, extension: implExtensionFactory) -> Self

Add an extension to the schema.

§Examples
useasync_graphql::*;structQuery;#[Object]implQuery {async fnvalue(&self) -> i32 {100}}letschema = Schema::build(Query, EmptyMutation, EmptySubscription)    .extension(extensions::Logger)    .finish();
Source

pub fndata<D:Any +Send +Sync>(self, data: D) -> Self

Add a global data that can be accessed in theSchema. You access itwithContext::data.

Source

pub fnvalidation_mode(self, validation_mode:ValidationMode) -> Self

Set the validation mode, default isValidationMode::Strict.

Source

pub fnenable_federation(self) -> Self

Enable federation, which is automatically enabled if the Query has leastone entity definition.

Source

pub fnenable_subscription_in_federation(self) -> Self

Make the Federation SDL include subscriptions.

Note: Not included by default, in order to be compatible with ApolloServer.

Source

pub fnoverride_input_type_description<T:InputType>( self, desc: &'staticstr,) -> Self

Override the name of the specified input type.

Source

pub fnoverride_output_type_description<T:OutputType>( self, desc: &'staticstr,) -> Self

Override the name of the specified output type.

Source

pub fndirective<T: CustomDirectiveFactory>(self, directive: T) -> Self

Register a custom directive.

§Panics

Panics if the directive with the same name is already registered.

Source

pub fndisable_suggestions(self) -> Self

Disable field suggestions.

Source

pub fnwith_sorted_fields(self) -> Self

Make all fields sorted on introspection queries.

Source

pub fnwith_sorted_enums(self) -> Self

Make all enum variants sorted on introspection queries.

Source

pub fnfinish(self) ->Schema<Query, Mutation, Subscription>

Consumes this builder and returns a schema.

Auto Trait Implementations§

§

impl<Query, Mutation, Subscription>Freeze forSchemaBuilder<Query, Mutation, Subscription>
where Mutation:Freeze, Subscription:Freeze, Query:Freeze,

§

impl<Query, Mutation, Subscription> !RefUnwindSafe forSchemaBuilder<Query, Mutation, Subscription>

§

impl<Query, Mutation, Subscription>Send forSchemaBuilder<Query, Mutation, Subscription>
where Mutation:Send, Subscription:Send, Query:Send,

§

impl<Query, Mutation, Subscription>Sync forSchemaBuilder<Query, Mutation, Subscription>
where Mutation:Sync, Subscription:Sync, Query:Sync,

§

impl<Query, Mutation, Subscription>Unpin forSchemaBuilder<Query, Mutation, Subscription>
where Mutation:Unpin, Subscription:Unpin, Query:Unpin,

§

impl<Query, Mutation, Subscription> !UnwindSafe forSchemaBuilder<Query, Mutation, Subscription>

Blanket Implementations§

Source§

impl<T>Any for T
where T: 'static + ?Sized,

Source§

fntype_id(&self) ->TypeId

Gets theTypeId ofself.Read more
Source§

impl<T>Borrow<T> for T
where T: ?Sized,

Source§

fnborrow(&self) ->&T

Immutably borrows from an owned value.Read more
Source§

impl<T>BorrowMut<T> for T
where T: ?Sized,

Source§

fnborrow_mut(&mut self) ->&mut T

Mutably borrows from an owned value.Read more
Source§

impl<T>Conv for T

Source§

fnconv<T>(self) -> T
where Self:Into<T>,

Convertsself intoT usingInto<T>.Read more
Source§

impl<T>FmtForward for T

Source§

fnfmt_binary(self) ->FmtBinary<Self>
where Self:Binary,

Causesself to use itsBinary implementation whenDebug-formatted.
Source§

fnfmt_display(self) ->FmtDisplay<Self>
where Self:Display,

Causesself to use itsDisplay implementation whenDebug-formatted.
Source§

fnfmt_lower_exp(self) ->FmtLowerExp<Self>
where Self:LowerExp,

Causesself to use itsLowerExp implementation whenDebug-formatted.
Source§

fnfmt_lower_hex(self) ->FmtLowerHex<Self>
where Self:LowerHex,

Causesself to use itsLowerHex implementation whenDebug-formatted.
Source§

fnfmt_octal(self) ->FmtOctal<Self>
where Self:Octal,

Causesself to use itsOctal implementation whenDebug-formatted.
Source§

fnfmt_pointer(self) ->FmtPointer<Self>
where Self:Pointer,

Causesself to use itsPointer implementation whenDebug-formatted.
Source§

fnfmt_upper_exp(self) ->FmtUpperExp<Self>
where Self:UpperExp,

Causesself to use itsUpperExp implementation whenDebug-formatted.
Source§

fnfmt_upper_hex(self) ->FmtUpperHex<Self>
where Self:UpperHex,

Causesself to use itsUpperHex implementation whenDebug-formatted.
Source§

fnfmt_list(self) ->FmtList<Self>
where &'a Self: for<'a>IntoIterator,

Formats each item in a sequence.Read more
Source§

impl<T>From<T> for T

Source§

fnfrom(t: T) -> T

Returns the argument unchanged.

Source§

impl<T>FutureExt for T

Source§

fnwith_context(self, otel_cx:Context) ->WithContext<Self>

Attaches the providedContext to this type, returning aWithContextwrapper.Read more
Source§

fnwith_current_context(self) ->WithContext<Self>

Attaches the currentContext to this type, returning aWithContextwrapper.Read more
Source§

impl<T>Instrument for T

Source§

fninstrument(self, span:Span) ->Instrumented<Self>

Instruments this type with the providedSpan, returning anInstrumented wrapper.Read more
Source§

fnin_current_span(self) ->Instrumented<Self>

Instruments this type with thecurrentSpan, returning anInstrumented wrapper.Read more
Source§

impl<T>Instrument for T

Source§

fninstrument(self, span:Span) ->Instrumented<Self>

Instruments this type with the providedSpan, returning anInstrumented wrapper.Read more
Source§

fnin_current_span(self) ->Instrumented<Self>

Instruments this type with thecurrentSpan, returning anInstrumented wrapper.Read more
Source§

impl<T, U>Into<U> for T
where U:From<T>,

Source§

fninto(self) -> U

CallsU::from(self).

That is, this conversion is whatever the implementation ofFrom<T> for U chooses to do.

Source§

impl<T>IntoEither for T

Source§

fninto_either(self, into_left:bool) ->Either<Self, Self>

Convertsself into aLeft variant ofEither<Self, Self>ifinto_left istrue.Convertsself into aRight variant ofEither<Self, Self>otherwise.Read more
Source§

fninto_either_with<F>(self, into_left: F) ->Either<Self, Self>
where F:FnOnce(&Self) ->bool,

Convertsself into aLeft variant ofEither<Self, Self>ifinto_left(&self) returnstrue.Convertsself into aRight variant ofEither<Self, Self>otherwise.Read more
Source§

impl<T>Pipe for T
where T: ?Sized,

Source§

fnpipe<R>(self, func: implFnOnce(Self) -> R) -> R
where Self:Sized,

Pipes by value. This is generally the method you want to use.Read more
Source§

fnpipe_ref<'a, R>(&'a self, func: implFnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrowsself and passes that borrow into the pipe function.Read more
Source§

fnpipe_ref_mut<'a, R>(&'a mut self, func: implFnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrowsself and passes that borrow into the pipe function.Read more
Source§

fnpipe_borrow<'a, B, R>(&'a self, func: implFnOnce(&'a B) -> R) -> R
where Self:Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrowsself, then passesself.borrow() into the pipe function.Read more
Source§

fnpipe_borrow_mut<'a, B, R>( &'a mut self, func: implFnOnce(&'a mut B) -> R,) -> R
where Self:BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrowsself, then passesself.borrow_mut() into the pipefunction.Read more
Source§

fnpipe_as_ref<'a, U, R>(&'a self, func: implFnOnce(&'a U) -> R) -> R
where Self:AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrowsself, then passesself.as_ref() into the pipe function.
Source§

fnpipe_as_mut<'a, U, R>(&'a mut self, func: implFnOnce(&'a mut U) -> R) -> R
where Self:AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrowsself, then passesself.as_mut() into the pipefunction.
Source§

fnpipe_deref<'a, T, R>(&'a self, func: implFnOnce(&'a T) -> R) -> R
where Self:Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrowsself, then passesself.deref() into the pipe function.
Source§

fnpipe_deref_mut<'a, T, R>( &'a mut self, func: implFnOnce(&'a mut T) -> R,) -> R
where Self:DerefMut<Target = T> +Deref, T: 'a + ?Sized, R: 'a,

Mutably borrowsself, then passesself.deref_mut() into the pipefunction.
Source§

impl<T>Same for T

Source§

typeOutput = T

Should always beSelf
Source§

impl<T>Tap for T

Source§

fntap(self, func: implFnOnce(&Self)) -> Self

Immutable access to a value.Read more
Source§

fntap_mut(self, func: implFnOnce(&mut Self)) -> Self

Mutable access to a value.Read more
Source§

fntap_borrow<B>(self, func: implFnOnce(&B)) -> Self
where Self:Borrow<B>, B: ?Sized,

Immutable access to theBorrow<B> of a value.Read more
Source§

fntap_borrow_mut<B>(self, func: implFnOnce(&mut B)) -> Self
where Self:BorrowMut<B>, B: ?Sized,

Mutable access to theBorrowMut<B> of a value.Read more
Source§

fntap_ref<R>(self, func: implFnOnce(&R)) -> Self
where Self:AsRef<R>, R: ?Sized,

Immutable access to theAsRef<R> view of a value.Read more
Source§

fntap_ref_mut<R>(self, func: implFnOnce(&mut R)) -> Self
where Self:AsMut<R>, R: ?Sized,

Mutable access to theAsMut<R> view of a value.Read more
Source§

fntap_deref<T>(self, func: implFnOnce(&T)) -> Self
where Self:Deref<Target = T>, T: ?Sized,

Immutable access to theDeref::Target of a value.Read more
Source§

fntap_deref_mut<T>(self, func: implFnOnce(&mut T)) -> Self
where Self:DerefMut<Target = T> +Deref, T: ?Sized,

Mutable access to theDeref::Target of a value.Read more
Source§

fntap_dbg(self, func: implFnOnce(&Self)) -> Self

Calls.tap() only in debug builds, and is erased in release builds.
Source§

fntap_mut_dbg(self, func: implFnOnce(&mut Self)) -> Self

Calls.tap_mut() only in debug builds, and is erased in releasebuilds.
Source§

fntap_borrow_dbg<B>(self, func: implFnOnce(&B)) -> Self
where Self:Borrow<B>, B: ?Sized,

Calls.tap_borrow() only in debug builds, and is erased in releasebuilds.
Source§

fntap_borrow_mut_dbg<B>(self, func: implFnOnce(&mut B)) -> Self
where Self:BorrowMut<B>, B: ?Sized,

Calls.tap_borrow_mut() only in debug builds, and is erased in releasebuilds.
Source§

fntap_ref_dbg<R>(self, func: implFnOnce(&R)) -> Self
where Self:AsRef<R>, R: ?Sized,

Calls.tap_ref() only in debug builds, and is erased in releasebuilds.
Source§

fntap_ref_mut_dbg<R>(self, func: implFnOnce(&mut R)) -> Self
where Self:AsMut<R>, R: ?Sized,

Calls.tap_ref_mut() only in debug builds, and is erased in releasebuilds.
Source§

fntap_deref_dbg<T>(self, func: implFnOnce(&T)) -> Self
where Self:Deref<Target = T>, T: ?Sized,

Calls.tap_deref() only in debug builds, and is erased in releasebuilds.
Source§

fntap_deref_mut_dbg<T>(self, func: implFnOnce(&mut T)) -> Self
where Self:DerefMut<Target = T> +Deref, T: ?Sized,

Calls.tap_deref_mut() only in debug builds, and is erased in releasebuilds.
Source§

impl<T>TryConv for T

Source§

fntry_conv<T>(self) ->Result<T, Self::Error>
where Self:TryInto<T>,

Attempts to convertself intoT usingTryInto<T>.Read more
Source§

impl<T, U>TryFrom<U> for T
where U:Into<T>,

Source§

typeError =Infallible

The type returned in the event of a conversion error.
Source§

fntry_from(value: U) ->Result<T, <T asTryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U>TryInto<U> for T
where U:TryFrom<T>,

Source§

typeError = <U asTryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fntry_into(self) ->Result<U, <U asTryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T>VZip<V> for T
where V:MultiLane<T>,

Source§

fnvzip(self) -> V

Source§

impl<T>WithSubscriber for T

Source§

fnwith_subscriber<S>(self, subscriber: S) ->WithDispatch<Self>
where S:Into<Dispatch>,

Attaches the providedSubscriber to this type, returning aWithDispatch wrapper.Read more
Source§

fnwith_current_subscriber(self) ->WithDispatch<Self>

Attaches the currentdefaultSubscriber to this type, returning aWithDispatch wrapper.Read more
Source§

impl<T>WithSubscriber for T

Source§

fnwith_subscriber<S>(self, subscriber: S) ->WithDispatch<Self>
where S:Into<Dispatch>,

Attaches the providedSubscriber to this type, returning aWithDispatch wrapper.Read more
Source§

fnwith_current_subscriber(self) ->WithDispatch<Self>

Attaches the currentdefaultSubscriber to this type, returning aWithDispatch wrapper.Read more
Source§

impl<T>ErasedDestructor for T
where T: 'static,


[8]ページ先頭

©2009-2025 Movatter.jp