Struct lib::Options [−][src]
pub struct Options<C, Q, M, S> where
C: Any + Send + Sync + Clone,
Q: Clone + ObjectType + 'static,
M: Clone + ObjectType + 'static,
S: Clone + SubscriptionType + 'static, { pub ctx: C, pub subscriptions_server_data: Option<SubscriptionsServerInformation>, pub schema: UserSchema<Q, M, S>, pub jwt_secret: String, pub authentication_block_state: AuthCheckBlockState, pub playground_endpoint: Option<String>, pub graphql_endpoint: String, }
Expand description
The options for creating the normal server, subscriptions server, and serverless function. You should define your options in one file and then import them everywhere you need them. You should use OptionsBuilder to construct this.
Fields
ctx: CYour custom context, often a database connection pool
subscriptions_server_data: Option<SubscriptionsServerInformation>Data about the subscriptions server If you’re not using subscriptions at all, the mechanics to connect to such a server will be disabled automatically.
schema: UserSchema<Q, M, S>Your async_graphql schema. See the book for details on how to create a schema.
jwt_secret: StringThe JWT secret for authenticating and generating client tokens and communications with the subscriptions server. This should be stored in an environment variable and randomly generated (see the book).
authentication_block_state: AuthCheckBlockStateThe blocking level that will be used for the GraphQL endpoint. See AuthCheckBlockState for available blocklevels and their meanings. The default here is to block anything that is not authenticated.
playground_endpoint: Option<String>The endpoint for the GraphiQL playground. If nothing is provided here, the playground will be disabled. Use with great care in production!
graphql_endpoint: StringThe GraphQL endpoint location. By default /graphql.
Trait Implementations
Auto Trait Implementations
impl<C, Q, M, S> RefUnwindSafe for Options<C, Q, M, S> where
C: RefUnwindSafe,
M: RefUnwindSafe,
Q: RefUnwindSafe,
S: RefUnwindSafe, impl<C, Q, M, S> UnwindSafe for Options<C, Q, M, S> where
C: UnwindSafe,
M: UnwindSafe,
Q: UnwindSafe,
S: UnwindSafe, Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = TShould always be Self
pub fn vzip(self) -> VAttaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more