Docs.rs
  • async-graphql-1.14.11
    • async-graphql 1.14.11
    • Docs.rs crate page
    • MIT/Apache-2.0
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • sunli829
    • Dependencies
      • Inflector ^0.11.4 normal
      • anyhow ^1.0.26 normal
      • async-graphql-derive ^1.14.0 normal
      • async-graphql-parser ^1.14.2 normal
      • async-stream ^0.2.1 normal
      • async-trait ^0.1.30 normal
      • base64 ^0.12.0 normal
      • bson ^0.14.1 normal
      • byteorder ^1.3.4 normal
      • bytes ^0.5.4 normal
      • chrono ^0.4.10 normal
      • chrono-tz ^0.5.1 normal
      • fnv ^1.0.6 normal
      • futures ^0.3.0 normal
      • http ^0.2.1 normal
      • httparse ^1.3.4 normal
      • indexmap ^1.3.2 normal
      • itertools ^0.9.0 normal
      • log ^0.4.8 normal
      • mime ^0.3.16 normal
      • multer ^1.2.0 normal
      • once_cell ^1.3.1 normal
      • parking_lot ^0.10.0 normal
      • regex ^1.3.5 normal
      • serde ^1.0.104 normal
      • serde_derive ^1.0.104 normal
      • serde_json ^1.0.48 normal
      • slab ^0.4.2 normal
      • tempfile ^3.1.0 normal
      • thiserror ^1.0.11 normal
      • tracing ^0.1.13 normal
      • url ^2.1.1 normal
      • uuid ^0.8.1 normal
      • async-std ^1.5.0 dev
      • serde ^1.0.104 dev
      • serde_derive ^1.0.104 dev
    • Versions
  • Go to latest version
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation
☰
logo

Crate async_graphql

See all async_graphql's items

  • Modules
  • Structs
  • Enums
  • Traits
  • Type Definitions

Crates

  • async_graphql
Change settings

[−][src]Crate async_graphql

[−] Expand description

A GraphQL server library implemented in Rust

Crates.io version Download docs.rs docs

Documentation

  • Feature Comparison
  • Book
  • 中文文档
  • Docs
  • GitHub repository
  • Cargo package
  • Minimum supported Rust version: 1.42 or later

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

  • Actix-web async-graphql-actix_web
  • Warp async-graphql-warp
  • Tide async-graphql-tide

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

  • GraphQL
  • GraphQL Multipart Request
  • GraphQL Cursor Connections Specification
  • GraphQL over WebSocket Protocol
  • Apollo Tracing
  • Apollo Federation

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

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

Results for String

In Names
(11)
In Parameters
(5)
In Return Types
(46)
async_graphql::Value::String 
async_graphql::Pos::to_string 
async_graphql::Positioned::to_string 
async_graphql::Value::to_string 
async_graphql::QueryPathNode::to_string 
async_graphql::Error::to_string 
async_graphql::ParseRequestError::to_string 
async_graphql::QueryError::to_string 
async_graphql::validators::StringMaxLengthString maximum length validator 
async_graphql::validators::StringMinLengthString minimum length validator 
async_graphql::ValidationMode::StrictExecute all validation rules. 
async_graphql::QueryBuilder::newCreate query builder with query source. 
async_graphql::connection::DataSource::queryParses the parameters and executes the query. 
async_graphql::InputValueError::into_error 
async_graphql::QueryBuilder::set_uploadSet uploaded file path 
async_graphql::QueryBuilder::operator_nameSpecify the operation name. 
async_graphql::ID::into 
async_graphql::CacheControl::valueGet 'Cache-Control' header value. 
async_graphql::validators::InputValueValidator::is_validCheck value is valid, returns the reason for the error if… 
async_graphql::validators::IntRange::is_valid 
async_graphql::validators::IntLessThan::is_valid 
async_graphql::validators::IntGreaterThan::is_valid 
async_graphql::validators::IntNonZero::is_valid 
async_graphql::validators::IntEqual::is_valid 
async_graphql::validators::ListMinLength::is_valid 
async_graphql::validators::ListMaxLength::is_valid 
async_graphql::validators::StringMinLength::is_valid 
async_graphql::validators::StringMaxLength::is_valid 
async_graphql::validators::Email::is_valid 
async_graphql::validators::MAC::is_valid 
async_graphql::validators::And::is_valid 
async_graphql::validators::Or::is_valid 
async_graphql::validators::MapErr::is_valid 
async_graphql::Pos::to_string 
async_graphql::Positioned::to_string 
async_graphql::Value::to_string 
async_graphql::QueryPathNode::to_string 
async_graphql::Error::to_string 
async_graphql::ParseRequestError::to_string 
async_graphql::QueryError::to_string 
async_graphql::connection::CursorType::encode_cursorEncode cursor to string. 
async_graphql::ID::encode_cursor 
async_graphql::http::graphiql_sourceGenerate the page for GraphIQL 
async_graphql::Type::create_type_infoCreate type information in the registry and return… 
async_graphql::FieldResult::create_type_info 
async_graphql::Any::create_type_info 
async_graphql::ID::create_type_info 
async_graphql::Json::create_type_info 
async_graphql::Deferred::create_type_info 
async_graphql::EmptyMutation::create_type_info 
async_graphql::EmptySubscription::create_type_info 
async_graphql::MaybeUndefined::create_type_info 
async_graphql::Streamed::create_type_info 
async_graphql::Upload::create_type_info 
async_graphql::connection::Connection::create_type_info 
async_graphql::connection::Edge::create_type_info 
async_graphql::connection::PageInfo::create_type_info 
async_graphql::connection::EmptyFields::create_type_info 
async_graphql::http::playground_sourceGenerate the page for GraphQL Playground 
async_graphql::Type::qualified_type_nameQualified typename. 
async_graphql::FieldResult::qualified_type_name 
async_graphql::MaybeUndefined::qualified_type_name 

Keyboard Shortcuts

?
Show this help dialog
S
Focus the search field
↑
Move up in search results
↓
Move down in search results
↹
Switch tab
⏎
Go to active search result
+
Expand all sections
-
Collapse all sections

Search Tricks

Prefix searches with a type followed by a colon (e.g., fn:) to restrict the search to a given type.

Accepted types are: fn, mod, struct, enum, trait, type, macro, and const.

Search functions by type signature (e.g., vec -> usize or * -> vec)

Search multiple things at once by splitting your query with comma (e.g., str,u8 or String,struct:Vec,test)

You can look for items with an exact name by putting double quotes around your request: "string"

Look for items inside another one by searching for a path: vec::Vec