Struct diana::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: AuthBlockLevel, 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 ::builder()
to construct this.
Fields
ctx: C
Your 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: String
The 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: AuthBlockLevel
The blocking level that will be used for the GraphQL endpoint.
See AuthBlockLevel
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. Not supported in production
graphql_endpoint: String
The GraphQL endpoint location. By default /graphql
.
Implementations
impl<C, Q, M, S> Options<C, Q, M, S> where
C: Any + Send + Sync + Clone,
Q: Clone + ObjectType + 'static,
M: Clone + ObjectType + 'static,
S: Clone + SubscriptionType + 'static,
impl<C, Q, M, S> Options<C, Q, M, S> where
C: Any + Send + Sync + Clone,
Q: Clone + ObjectType + 'static,
M: Clone + ObjectType + 'static,
S: Clone + SubscriptionType + 'static,
Creates a new builder-style struct to create the and instance of Options
.
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