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

Creates a new builder-style struct to create the and instance of Options.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.