Crate tsukuyomi_juniper[][src]

A extension of Tsukuyomi web framework for supporting GraphQL serving based on Juniper.

Examples

use tsukuyomi_juniper::{GraphQLState, GraphQLEndpoint};
use tsukuyomi_juniper::endpoint::graphiql;

struct Context {/* ... */}
impl juniper::Context for Context {}

struct Query {/* ... */}
graphql_object!(Query: Context |&self| {/* ... */});

struct Mutation {/* ... */}
graphql_object!(Mutation: Context |&self| {/* ... */});

let context = Context {/* ... */};
let schema = juniper::RootNode::new(Query {/*...*/}, Mutation {/*...*/});
let state = GraphQLState::new(context, schema);

let app = App::builder()
    .scope(GraphQLEndpoint::new(state, "/graphql"))
    .route(("/graphiql", graphiql("http://localhost:4000/graphql")))
    .finish()?;

Re-exports

pub use endpoint::GraphQLEndpoint;

Modules

endpoint

Definitions of Handlers for serving GraphQL requests.

Structs

Execute

A Future representing a process to execute a GraphQL request from peer.

GraphQLRequest

A wrapper around an incoming GraphQL request from a client.

GraphQLResponse

The result of executing a GraphQL query.

GraphQLState

The main type containing all contextual values for processing GraphQL requests.

Traits

GraphQLExecutor

Abstraction of an executor which processes asynchronously the GraphQL requests.