[][src]Crate async_graphql

A GraphQL server library implemented in Rust

Crates.io version Download docs.rs docs

Documentation

Features

  • Fully support async/await
  • Type safety
  • Rustfmt friendly (Procedural Macro)
  • Custom scalar
  • Minimal overhead
  • Easy integration (hyper, actix_web, tide ...)
  • Upload files (Multipart request)
  • Subscription (WebSocket transport)
  • Custom extension
  • Apollo Tracing extension
  • Limit query complexity/depth
  • Error Extensions
  • Apollo Federation

Integrations

License

Licensed under either of

  • Apache License, Version 2.0, (./LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (./LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.

References

Examples

If you are just getting started, we recommend checking out our examples at: https://github.com/async-graphql/examples

To see how you would create a Relay-compliant server using async-graphql, warp, diesel & postgresql, you can also check out a real-world example at: https://github.com/phated/twentyfive-stars

Benchmarks

Ensure that there is no CPU-heavy process in background!

cd benchmark
cargo bench

Now HTML report is available at benchmark/target/criterion/report

Modules

connection

Types for Relay-compliant server

extensions

Extensions for schema

guard

Field guards

http

A helper module that supports HTTP

validators

Input value validators

Structs

Any

Any scalar

CacheControl

Cache control values

ContextBase

Query context

Data

Schema/Context data

Deferred

Deferred type

EmptyMutation

Empty mutation

EmptySubscription

Empty subscription

FieldError

FieldError type

ID

ID scalar

IntoQueryBuilderOpts

IntoQueryBuilder options

Json

A scalar that can represent any JSON value.

Lookahead

A selection performed by a query

Pos

Original position of element in source code

Positioned

Represents the position of a AST node

QueryBuilder

Query builder

QueryPathNode

The query path node

QueryResponse

Query response

RuleError
Schema

GraphQL schema

SchemaBuilder

Schema builder

SimpleBroker

A simple broker based on memory

Streamed

Streamed type

SubscriptionStreams

Use to hold all subscription stream for the SubscriptionConnection

Upload

Uploaded file

Variables

Variables of query

WebSocketTransport

WebSocket transport for subscription

Enums

Error
InputValueError

Input Value Error

MaybeUndefined

Similar to Option, but it has three states, undefined, null and x.

ParseRequestError
QueryError

Error for query

QueryPathSegment

The query path segment

StreamResponse

Response for Schema::execute_stream and QueryBuilder::execute_stream

ValidationMode

Validation mode

Value

Represents a GraphQL value

Traits

ErrorExtensions
IntoQueryBuilder
ResultExt
ScalarType

Represents a GraphQL scalar

SubscriptionTransport

Subscription transport

Type

Represents a GraphQL type

Type Definitions

Context

Context object for resolve field

FieldResult

FieldResult type

InputValueResult

InputValueResult type

Result

Result type

Attribute Macros

DataSource

Define a DataSource

Enum

Define a GraphQL enum

InputObject

Define a GraphQL input object

Interface

Define a GraphQL interface

Object

Define a GraphQL object

Scalar

Define a Scalar

SimpleObject

Define a GraphQL object

Subscription

Define a GraphQL subscription

Union

Define a GraphQL union