Updated book for master ***NO_CI***
This commit is contained in:
parent
fd1ee76fd7
commit
31e380fd68
5 changed files with 6 additions and 8 deletions
master
|
@ -292,8 +292,7 @@ type Schema = juniper::RootNode<'static, Query, Mutation>;
|
||||||
<a class="header" href="#executor" id="executor"><h2>Executor</h2></a>
|
<a class="header" href="#executor" id="executor"><h2>Executor</h2></a>
|
||||||
<p>You can invoke <code>juniper::execute</code> directly to run a GraphQL query:</p>
|
<p>You can invoke <code>juniper::execute</code> directly to run a GraphQL query:</p>
|
||||||
<pre><pre class="playpen"><code class="language-rust"># // Only needed due to 2018 edition because the macro is not accessible.
|
<pre><pre class="playpen"><code class="language-rust"># // Only needed due to 2018 edition because the macro is not accessible.
|
||||||
# #[macro_use]
|
# #[macro_use] extern crate juniper;
|
||||||
# extern crate juniper;
|
|
||||||
use juniper::{FieldResult, Variables, EmptyMutation};
|
use juniper::{FieldResult, Variables, EmptyMutation};
|
||||||
|
|
||||||
#[derive(juniper::GraphQLEnum, Clone, Copy)]
|
#[derive(juniper::GraphQLEnum, Clone, Copy)]
|
||||||
|
@ -768,7 +767,7 @@ impl juniper::IntoFieldError for CustomError {
|
||||||
match self {
|
match self {
|
||||||
CustomError::WhateverNotSet => juniper::FieldError::new(
|
CustomError::WhateverNotSet => juniper::FieldError::new(
|
||||||
"Whatever does not exist",
|
"Whatever does not exist",
|
||||||
juniper::graphql_value!({
|
graphql_value!({
|
||||||
"type": "NO_WHATEVER"
|
"type": "NO_WHATEVER"
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|
|
@ -248,8 +248,7 @@ type Schema = juniper::RootNode<'static, Query, Mutation>;
|
||||||
<a class="header" href="#executor" id="executor"><h2>Executor</h2></a>
|
<a class="header" href="#executor" id="executor"><h2>Executor</h2></a>
|
||||||
<p>You can invoke <code>juniper::execute</code> directly to run a GraphQL query:</p>
|
<p>You can invoke <code>juniper::execute</code> directly to run a GraphQL query:</p>
|
||||||
<pre><pre class="playpen"><code class="language-rust"># // Only needed due to 2018 edition because the macro is not accessible.
|
<pre><pre class="playpen"><code class="language-rust"># // Only needed due to 2018 edition because the macro is not accessible.
|
||||||
# #[macro_use]
|
# #[macro_use] extern crate juniper;
|
||||||
# extern crate juniper;
|
|
||||||
use juniper::{FieldResult, Variables, EmptyMutation};
|
use juniper::{FieldResult, Variables, EmptyMutation};
|
||||||
|
|
||||||
#[derive(juniper::GraphQLEnum, Clone, Copy)]
|
#[derive(juniper::GraphQLEnum, Clone, Copy)]
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -243,7 +243,7 @@ impl juniper::IntoFieldError for CustomError {
|
||||||
match self {
|
match self {
|
||||||
CustomError::WhateverNotSet => juniper::FieldError::new(
|
CustomError::WhateverNotSet => juniper::FieldError::new(
|
||||||
"Whatever does not exist",
|
"Whatever does not exist",
|
||||||
juniper::graphql_value!({
|
graphql_value!({
|
||||||
"type": "NO_WHATEVER"
|
"type": "NO_WHATEVER"
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Add table
Reference in a new issue