This commit is contained in:
Sunli 2020-10-22 10:11:47 +08:00
parent fb7112a0e4
commit c999dd26dd
10 changed files with 12 additions and 12 deletions

View File

@ -114,7 +114,7 @@ pub fn generate(enum_args: &args::Enum) -> GeneratorResult<TokenStream> {
if schema_enum_items.is_empty() { if schema_enum_items.is_empty() {
return Err(Error::new_spanned( return Err(Error::new_spanned(
&ident, &ident,
"An GraphQL Enum type must define one or more unique enum values.", "A GraphQL Enum type must define one or more unique enum values.",
) )
.into()); .into());
} }

View File

@ -154,7 +154,7 @@ pub fn generate(object_args: &args::InputObject) -> GeneratorResult<TokenStream>
if get_fields.is_empty() { if get_fields.is_empty() {
return Err(Error::new_spanned( return Err(Error::new_spanned(
&ident, &ident,
"An GraphQL Input Object type must define one or more input fields.", "A GraphQL Input Object type must define one or more input fields.",
) )
.into()); .into());
} }

View File

@ -124,7 +124,7 @@ pub fn generate(interface_args: &args::Interface) -> GeneratorResult<TokenStream
if interface_args.fields.is_empty() { if interface_args.fields.is_empty() {
return Err(Error::new_spanned( return Err(Error::new_spanned(
&ident, &ident,
"An GraphQL Interface type must define one or more fields.", "A GraphQL Interface type must define one or more fields.",
) )
.into()); .into());
} }

View File

@ -474,7 +474,7 @@ pub fn generate(
if resolvers.is_empty() && create_entity_types.is_empty() { if resolvers.is_empty() && create_entity_types.is_empty() {
return Err(Error::new_spanned( return Err(Error::new_spanned(
&self_ty, &self_ty,
"An GraphQL Object type must define one or more fields.", "A GraphQL Object type must define one or more fields.",
) )
.into()); .into());
} }

View File

@ -132,7 +132,7 @@ pub fn generate(object_args: &args::SimpleObject) -> GeneratorResult<TokenStream
if !object_args.dummy && resolvers.is_empty() { if !object_args.dummy && resolvers.is_empty() {
return Err(Error::new_spanned( return Err(Error::new_spanned(
&ident, &ident,
"An GraphQL Object type must define one or more fields.", "A GraphQL Object type must define one or more fields.",
) )
.into()); .into());
} }

View File

@ -367,7 +367,7 @@ pub fn generate(
if create_stream.is_empty() { if create_stream.is_empty() {
return Err(Error::new_spanned( return Err(Error::new_spanned(
&self_ty, &self_ty,
"An GraphQL Object type must define one or more fields.", "A GraphQL Object type must define one or more fields.",
) )
.into()); .into());
} }

View File

@ -19,7 +19,7 @@ use warp::{Filter, Rejection, Reply};
/// #[Object] /// #[Object]
/// impl QueryRoot { /// impl QueryRoot {
/// async fn value(&self) -> i32 { /// async fn value(&self) -> i32 {
/// // An GraphQL Object type must define one or more fields. /// // A GraphQL Object type must define one or more fields.
/// 100 /// 100
/// } /// }
/// } /// }

View File

@ -3,7 +3,7 @@
use super::*; use super::*;
use async_graphql_value::Name; use async_graphql_value::Name;
/// An GraphQL file or request string defining a GraphQL service. /// A GraphQL file or request string defining a GraphQL service.
/// ///
/// [Reference](https://spec.graphql.org/June2018/#Document). /// [Reference](https://spec.graphql.org/June2018/#Document).
#[derive(Debug, Clone)] #[derive(Debug, Clone)]

View File

@ -470,7 +470,7 @@ where
.extensions(extensions) .extensions(extensions)
} }
/// Execute an GraphQL query. /// Execute a GraphQL query.
pub async fn execute(&self, request: impl Into<Request>) -> Response { pub async fn execute(&self, request: impl Into<Request>) -> Response {
let request = request.into(); let request = request.into();
match self.prepare_request(request).await { match self.prepare_request(request).await {
@ -482,7 +482,7 @@ where
} }
} }
/// Execute an GraphQL batch query. /// Execute a GraphQL batch query.
pub async fn execute_batch(&self, batch_request: BatchRequest) -> BatchResponse { pub async fn execute_batch(&self, batch_request: BatchRequest) -> BatchResponse {
match batch_request { match batch_request {
BatchRequest::Single(request) => BatchResponse::Single(self.execute(request).await), BatchRequest::Single(request) => BatchResponse::Single(self.execute(request).await),
@ -565,7 +565,7 @@ where
} }
} }
/// Execute an GraphQL subscription. /// Execute a GraphQL subscription.
pub fn execute_stream( pub fn execute_stream(
&self, &self,
request: impl Into<Request>, request: impl Into<Request>,

View File

@ -21,7 +21,7 @@ use crate::{
/// #[Object] /// #[Object]
/// impl QueryRoot { /// impl QueryRoot {
/// async fn value(&self) -> i32 { /// async fn value(&self) -> i32 {
/// // An GraphQL Object type must define one or more fields. /// // A GraphQL Object type must define one or more fields.
/// 100 /// 100
/// } /// }
/// } /// }