2020-03-01 13:56:14 +00:00
|
|
|
# The GraphQL server library implemented by rust
|
|
|
|
|
|
|
|
<div align="center">
|
|
|
|
<!-- CI -->
|
|
|
|
<img src="https://github.com/sunli829/potatonet/workflows/CI/badge.svg" />
|
|
|
|
<!-- Crates version -->
|
|
|
|
<a href="https://crates.io/crates/async-graphql">
|
|
|
|
<img src="https://img.shields.io/crates/v/async-graphql.svg?style=flat-square"
|
|
|
|
alt="Crates.io version" />
|
|
|
|
</a>
|
|
|
|
<!-- Downloads -->
|
|
|
|
<a href="https://crates.io/crates/async-graphql">
|
|
|
|
<img src="https://img.shields.io/crates/d/async-graphql.svg?style=flat-square"
|
|
|
|
alt="Download" />
|
|
|
|
</a>
|
|
|
|
<!-- docs.rs docs -->
|
|
|
|
<a href="https://docs.rs/async-graphql">
|
|
|
|
<img src="https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square"
|
|
|
|
alt="docs.rs docs" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
2020-03-12 09:21:49 +00:00
|
|
|
`async-graphql` is a GraphQL server library that fully supports async/await and is easy to use.
|
|
|
|
|
|
|
|
It supports all of the GraphQL specifications and is easy to integrate into existing web servers.
|
|
|
|
|
2020-03-21 07:11:46 +00:00
|
|
|
* [Docs](https://docs.rs/async-graphql)
|
2020-03-01 13:56:14 +00:00
|
|
|
* [GitHub repository](https://github.com/sunli829/async-graphql)
|
|
|
|
* [Cargo package](https://crates.io/crates/async-graphql)
|
2020-03-10 07:39:50 +00:00
|
|
|
* Minimum supported Rust version: 1.40 or later
|
2020-03-01 13:56:14 +00:00
|
|
|
|
2020-03-09 12:44:31 +00:00
|
|
|
## Example
|
|
|
|
|
|
|
|
```shell script
|
|
|
|
cargo run --example actix-web
|
|
|
|
```
|
|
|
|
|
2020-03-09 12:45:11 +00:00
|
|
|
Open `http://localhost:8000` in browser
|
2020-03-09 12:44:31 +00:00
|
|
|
|
2020-03-02 00:24:49 +00:00
|
|
|
## Features
|
|
|
|
|
2020-03-17 11:11:14 +00:00
|
|
|
* Fully support async/await
|
|
|
|
* Type safety
|
|
|
|
* Rustfmt friendly (Procedural Macro)
|
|
|
|
* Custom scalar
|
|
|
|
* Minimal overhead
|
|
|
|
* Easy integration (hyper, actix_web, tide ...)
|
|
|
|
* Upload files (Multipart request)
|
2020-03-20 03:56:08 +00:00
|
|
|
* Subscription (WebSocket transport)
|
2020-03-26 03:34:28 +00:00
|
|
|
* Custom extension
|
|
|
|
* Apollo Tracing extension
|
|
|
|
* Limit query complexity/depth
|
2020-03-29 16:00:56 +00:00
|
|
|
* Error Extensions
|
2020-03-20 03:56:08 +00:00
|
|
|
|
2020-03-18 00:44:41 +00:00
|
|
|
## Integrations
|
|
|
|
|
2020-03-18 03:13:45 +00:00
|
|
|
* Actix-web [async-graphql-actix-web](https://crates.io/crates/async-graphql-actix-web)
|
2020-03-18 00:44:41 +00:00
|
|
|
|
2020-03-01 14:13:37 +00:00
|
|
|
## Goals
|
|
|
|
|
2020-03-09 04:18:21 +00:00
|
|
|
- [X] Types
|
2020-03-01 14:13:37 +00:00
|
|
|
- [X] Scalar
|
|
|
|
- [X] Integer
|
|
|
|
- [X] Float
|
|
|
|
- [X] String
|
|
|
|
- [X] Bool
|
2020-03-01 16:59:04 +00:00
|
|
|
- [X] ID
|
2020-03-01 14:13:37 +00:00
|
|
|
- [X] DateTime
|
|
|
|
- [X] UUID
|
2020-03-20 03:56:08 +00:00
|
|
|
- [X] Url
|
2020-03-20 18:03:41 +00:00
|
|
|
- [X] ObjectId
|
2020-03-03 11:17:48 +00:00
|
|
|
- [X] Containers
|
2020-03-01 14:13:37 +00:00
|
|
|
- [X] List
|
|
|
|
- [X] Non-Null
|
2020-03-09 10:05:52 +00:00
|
|
|
- [X] Object
|
2020-03-01 14:13:37 +00:00
|
|
|
- [X] Enum
|
2020-03-01 17:09:21 +00:00
|
|
|
- [X] InputObject
|
2020-03-04 02:38:07 +00:00
|
|
|
- [X] Field default value
|
2020-03-03 03:48:00 +00:00
|
|
|
- [X] Deprecated flag
|
2020-03-07 02:43:09 +00:00
|
|
|
- [X] Interface
|
2020-03-08 01:21:29 +00:00
|
|
|
- [X] Union
|
2020-03-05 09:06:14 +00:00
|
|
|
- [X] Query
|
2020-03-01 14:13:37 +00:00
|
|
|
- [X] Fields
|
|
|
|
- [X] Arguments
|
2020-03-04 02:38:07 +00:00
|
|
|
- [X] Default value
|
2020-03-03 03:48:00 +00:00
|
|
|
- [X] Deprecated flag
|
2020-03-01 16:52:38 +00:00
|
|
|
- [X] Alias
|
2020-03-05 09:06:14 +00:00
|
|
|
- [X] Fragments
|
|
|
|
- [X] Inline fragments
|
2020-03-01 14:13:37 +00:00
|
|
|
- [X] Operation name
|
2020-03-01 16:52:05 +00:00
|
|
|
- [X] Variables
|
2020-03-04 02:38:07 +00:00
|
|
|
- [X] Default value
|
2020-03-03 11:15:18 +00:00
|
|
|
- [X] Parse value
|
2020-03-05 09:06:14 +00:00
|
|
|
- [X] Directives
|
2020-03-04 06:24:44 +00:00
|
|
|
- [X] @include
|
|
|
|
- [X] FIELD
|
2020-03-05 09:06:14 +00:00
|
|
|
- [X] FRAGMENT_SPREAD
|
|
|
|
- [X] INLINE_FRAGMENT
|
2020-03-04 06:24:44 +00:00
|
|
|
- [X] @skip
|
|
|
|
- [X] FIELD
|
2020-03-05 09:06:14 +00:00
|
|
|
- [X] FRAGMENT_SPREAD
|
|
|
|
- [X] INLINE_FRAGMENT
|
2020-03-25 07:07:16 +00:00
|
|
|
- [X] Introspection
|
|
|
|
- [X] Query
|
|
|
|
- [X] Disable introspection
|
2020-03-29 16:00:56 +00:00
|
|
|
- [X] Multipart Request
|
2020-03-19 09:20:12 +00:00
|
|
|
- [X] Cursor Connections
|
2020-03-21 07:07:11 +00:00
|
|
|
- [X] Input value validators
|
|
|
|
- [X] Custom validator
|
|
|
|
- [X] Combination
|
|
|
|
- [X] and
|
|
|
|
- [X] or
|
|
|
|
- [X] Integer
|
|
|
|
- [X] IntRange
|
|
|
|
- [X] IntLessThan
|
|
|
|
- [X] IntGreaterThan
|
2020-03-22 01:34:32 +00:00
|
|
|
- [X] IntNonZero
|
2020-03-21 07:07:11 +00:00
|
|
|
- [X] String
|
|
|
|
- [X] Email
|
|
|
|
- [X] MAC
|
2020-03-22 01:34:32 +00:00
|
|
|
- [X] StringMinLength
|
|
|
|
- [X] StringMaxLength
|
|
|
|
- [X] List
|
|
|
|
- [X] ListMaxLength
|
|
|
|
- [X] ListMinLength
|
2020-03-25 07:07:30 +00:00
|
|
|
- [X] Limit query complexity
|
|
|
|
- [X] Limit query depth
|
2020-03-26 03:34:28 +00:00
|
|
|
- [X] Extensions
|
|
|
|
- [X] Custom
|
|
|
|
- [X] Apollo tracing
|
2020-03-17 09:26:59 +00:00
|
|
|
- [X] Subscription
|
|
|
|
- [X] Filter
|
2020-03-29 16:00:56 +00:00
|
|
|
- [X] WebSocket transport
|
2020-03-12 09:11:02 +00:00
|
|
|
- [X] Validation rules
|
2020-03-08 12:58:22 +00:00
|
|
|
- [X] ArgumentsOfCorrectType
|
|
|
|
- [X] DefaultValuesOfCorrectType
|
2020-03-09 04:08:50 +00:00
|
|
|
- [X] FieldsOnCorrectType
|
|
|
|
- [X] FragmentsOnCompositeTypes
|
|
|
|
- [X] KnownArgumentNames
|
2020-03-11 02:10:56 +00:00
|
|
|
- [X] KnownDirectives
|
2020-03-09 04:08:50 +00:00
|
|
|
- [X] KnownFragmentNames
|
2020-03-09 10:05:52 +00:00
|
|
|
- [X] KnownTypeNames
|
|
|
|
- [X] LoneAnonymousOperation
|
2020-03-09 04:08:50 +00:00
|
|
|
- [X] NoFragmentCycles
|
2020-03-09 10:05:52 +00:00
|
|
|
- [X] NoUndefinedVariables
|
|
|
|
- [X] NoUnusedFragments
|
2020-03-09 12:39:46 +00:00
|
|
|
- [X] NoUnusedVariables
|
2020-03-12 09:11:02 +00:00
|
|
|
- [X] OverlappingFieldsCanBeMerged
|
2020-03-10 10:07:47 +00:00
|
|
|
- [X] PossibleFragmentSpreads
|
2020-03-10 12:35:25 +00:00
|
|
|
- [X] ProvidedNonNullArguments
|
2020-03-10 06:14:09 +00:00
|
|
|
- [X] ScalarLeafs
|
2020-03-09 12:39:46 +00:00
|
|
|
- [X] UniqueArgumentNames
|
|
|
|
- [X] UniqueFragmentNames
|
2020-03-10 06:14:09 +00:00
|
|
|
- [X] UniqueOperationNames
|
|
|
|
- [X] UniqueVariableNames
|
|
|
|
- [X] VariablesAreInputTypes
|
|
|
|
- [X] VariableInAllowedPosition
|
2020-03-05 09:06:14 +00:00
|
|
|
- [ ] Integration examples
|
2020-03-05 06:37:16 +00:00
|
|
|
- [X] Actix-web
|
2020-03-03 11:25:20 +00:00
|
|
|
- [ ] Hyper
|
2020-03-06 01:07:35 +00:00
|
|
|
- [X] Tide
|
2020-03-03 03:48:00 +00:00
|
|
|
|
|
|
|
## 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.
|
2020-03-01 14:13:37 +00:00
|
|
|
|
2020-03-01 13:56:14 +00:00
|
|
|
## References
|
|
|
|
|
|
|
|
* [GraphQL](https://graphql.org)
|
2020-03-19 09:20:12 +00:00
|
|
|
* [GraphQL Multipart Request](https://github.com/jaydenseric/graphql-multipart-request-spec)
|
|
|
|
* [GraphQL Cursor Connections Specification](https://facebook.github.io/relay/graphql/connections.htm)
|
|
|
|
* [GraphQL over WebSocket Protocol](https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md)
|
2020-03-26 03:34:28 +00:00
|
|
|
* [Apollo Tracing](https://github.com/apollographql/apollo-tracing)
|
2020-03-22 08:45:59 +00:00
|
|
|
|
|
|
|
## Contribute
|
|
|
|
|
|
|
|
Welcome to contribute !
|