Skip to content

Commit a32140c

Browse files
ilslvtyranron
andauthored
Update all links to October 2021 spec (#1075, #1000)
Co-authored-by: Kai Ren <[email protected]>
1 parent 927e422 commit a32140c

File tree

71 files changed

+286
-286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+286
-286
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ see the [actix][actix_examples], [hyper][hyper_examples], [rocket][rocket_exampl
4747
## Features
4848

4949
Juniper supports the full GraphQL query language according to the
50-
[specification][graphql_spec], including interfaces, unions, schema
50+
[specification (October 2021)][graphql_spec], including interfaces, unions, schema
5151
introspection, and validations. It can also output the schema in the [GraphQL Schema Language][schema_language].
5252

5353
As an exception to other GraphQL libraries for other languages, Juniper builds
@@ -97,7 +97,7 @@ Juniper has not reached 1.0 yet, thus some API instability should be expected.
9797
[graphiql]: https://github.com/graphql/graphiql
9898
[playground]: https://github.com/prisma/graphql-playground
9999
[iron]: https://github.com/iron/iron
100-
[graphql_spec]: http://facebook.github.io/graphql
100+
[graphql_spec]: https://spec.graphql.org/October2021
101101
[schema_language]: https://graphql.org/learn/schema/#type-language
102102
[schema_approach]: https://blog.logrocket.com/code-first-vs-schema-first-development-graphql/
103103
[test_schema_rs]: https://github.com/graphql-rust/juniper/blob/master/juniper/src/tests/fixtures/starwars/schema.rs

book/src/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ embedded [Graphiql][graphiql] for easy debugging.
2121
## Features
2222

2323
Juniper supports the full GraphQL query language according to the
24-
[specification][graphql_spec], including interfaces, unions, schema
24+
[specification (October 2021)][graphql_spec], including interfaces, unions, schema
2525
introspection, and validations.
2626
It does not, however, support the schema language.
2727

@@ -57,7 +57,7 @@ Juniper has not reached 1.0 yet, thus some API instability should be expected.
5757
[graphql]: http://graphql.org
5858
[graphiql]: https://github.com/graphql/graphiql
5959
[iron]: https://github.com/iron/iron
60-
[graphql_spec]: http://facebook.github.io/graphql
60+
[graphql_spec]: https://spec.graphql.org/October2021
6161
[test_schema_rs]: https://github.com/graphql-rust/juniper/blob/master/juniper/src/tests/schema.rs
6262
[tokio]: https://github.com/tokio-rs/tokio
6363
[hyper_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_hyper/examples

book/src/types/interfaces.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,9 @@ struct Droid {
473473

474474

475475

476-
[1]: https://spec.graphql.org/June2018/#sec-Interfaces
476+
[1]: https://spec.graphql.org/October2021#sec-Interfaces
477477
[2]: https://doc.rust-lang.org/reference/types/trait-object.html
478478
[3]: https://docs.rs/juniper/latest/juniper/trait.ScalarValue.html
479479
[4]: https://docs.rs/juniper/latest/juniper/struct.Executor.html
480-
[5]: https://spec.graphql.org/June2018/#sec-Objects
480+
[5]: https://spec.graphql.org/October2021#sec-Objects
481481
[6]: https://docs.rs/juniper/0.14.2/juniper/trait.Context.html

book/src/types/objects/error_handling.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ there - those errors are automatically converted into `FieldError`.
6060

6161
## Error payloads, `null`, and partial errors
6262

63-
Juniper's error behavior conforms to the [GraphQL specification](https://spec.graphql.org/June2018/#sec-Errors-and-Non-Nullability).
63+
Juniper's error behavior conforms to the [GraphQL specification](https://spec.graphql.org/October2021#sec-Handling-Field-Errors).
6464

6565
When a field returns an error, the field's result is replaced by `null`, an
6666
additional `errors` object is created at the top level of the response, and the
@@ -168,7 +168,7 @@ impl Example {
168168
# fn main() {}
169169
```
170170

171-
The specified structured error information is included in the [`extensions`](https://facebook.github.io/graphql/June2018/#sec-Errors) key:
171+
The specified structured error information is included in the [`extensions`](https://spec.graphql.org/October2021#sec-Errors) key:
172172

173173
```json
174174
{

book/src/types/scalars.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Juniper has built-in support for:
2424
* `String` and `&str` as `String`
2525
* `bool` as `Boolean`
2626
* `juniper::ID` as `ID`. This type is defined [in the
27-
spec](http://facebook.github.io/graphql/#sec-ID) as a type that is serialized
27+
spec](https://spec.graphql.org/October2021#sec-ID) as a type that is serialized
2828
as a string but can be parsed from both a string and an integer.
2929

30-
Note that there is no built-in support for `i64`/`u64`, as the GraphQL spec [doesn't define any built-in scalars for `i64`/`u64` by default](https://spec.graphql.org/June2018/#sec-Int). You may wish to leverage a [custom GraphQL scalar](#custom-scalars) in your schema to support them.
30+
Note that there is no built-in support for `i64`/`u64`, as the GraphQL spec [doesn't define any built-in scalars for `i64`/`u64` by default](https://spec.graphql.org/October2021#sec-Int). You may wish to leverage a [custom GraphQL scalar](#custom-scalars) in your schema to support them.
3131

3232
**Third party types**:
3333

book/src/types/unions.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl Character {
130130
# fn main() {}
131131
```
132132

133-
With an external resolver function we can even declare a new [GraphQL union][1] variant where the Rust type is absent in the initial enum definition. The attribute syntax `#[graphql(on VariantType = resolver_fn)]` follows the [GraphQL syntax for dispatching union variants](https://spec.graphql.org/June2018/#example-f8163).
133+
With an external resolver function we can even declare a new [GraphQL union][1] variant where the Rust type is absent in the initial enum definition. The attribute syntax `#[graphql(on VariantType = resolver_fn)]` follows the [GraphQL syntax for dispatching union variants](https://spec.graphql.org/October2021#example-f8163).
134134

135135
```rust
136136
# #![allow(dead_code)]
@@ -485,7 +485,7 @@ enum Character {
485485

486486

487487

488-
[1]: https://spec.graphql.org/June2018/#sec-Unions
488+
[1]: https://spec.graphql.org/October2021#sec-Unions
489489
[2]: https://docs.rs/juniper/latest/juniper/trait.ScalarValue.html
490-
[5]: https://spec.graphql.org/June2018/#sec-Interfaces
490+
[5]: https://spec.graphql.org/October2021#sec-Interfaces
491491
[6]: https://docs.rs/juniper/0.14.2/juniper/trait.Context.html

juniper/src/schema/meta.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ impl<'a, S> MetaType<'a, S> {
405405
// "used exclusively by GraphQL’s introspection system"
406406
{
407407
name.starts_with("__") ||
408-
// <https://facebook.github.io/graphql/draft/#sec-Scalars>
408+
// https://spec.graphql.org/October2021#sec-Scalars
409409
name == "Boolean" || name == "String" || name == "Int" || name == "Float" || name == "ID" ||
410410
// Our custom empty markers
411411
name == "_EmptyMutation" || name == "_EmptySubscription"

juniper/src/schema/translate/graphql_parser.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ where
298298
}
299299
}
300300

301-
// Right now the only directive supported is `@deprecated`. `@skip` and `@include`
302-
// are dealt with elsewhere.
303-
// <https://facebook.github.io/graphql/draft/#sec-Type-System.Directives>
301+
// Right now the only directive supported is `@deprecated`.
302+
// `@skip` and `@include` are dealt with elsewhere.
303+
// https://spec.graphql.org/October2021#sec-Type-System.Directives.Built-in-Directives
304304
fn generate_directives<'a, T>(status: &DeprecationStatus) -> Vec<ExternalDirective<'a, T>>
305305
where
306306
T: Text<'a>,

juniper/src/types/async_await.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ where
3030
///
3131
/// The default implementation panics.
3232
///
33-
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
33+
/// [3]: https://spec.graphql.org/October2021#sec-Objects
3434
fn resolve_field_async<'a>(
3535
&'a self,
3636
_info: &'a Self::TypeInfo,
@@ -54,9 +54,9 @@ where
5454
///
5555
/// The default implementation panics.
5656
///
57-
/// [1]: https://spec.graphql.org/June2018/#sec-Interfaces
58-
/// [2]: https://spec.graphql.org/June2018/#sec-Unions
59-
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
57+
/// [1]: https://spec.graphql.org/October2021#sec-Interfaces
58+
/// [2]: https://spec.graphql.org/October2021#sec-Unions
59+
/// [3]: https://spec.graphql.org/October2021#sec-Objects
6060
fn resolve_into_type_async<'a>(
6161
&'a self,
6262
info: &'a Self::TypeInfo,
@@ -91,8 +91,8 @@ where
9191
///
9292
/// The default implementation panics, if `selection_set` is [`None`].
9393
///
94-
/// [0]: https://spec.graphql.org/June2018/#sec-Errors-and-Non-Nullability
95-
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
94+
/// [0]: https://spec.graphql.org/October2021#sec-Handling-Field-Errors
95+
/// [3]: https://spec.graphql.org/October2021#sec-Objects
9696
fn resolve_async<'a>(
9797
&'a self,
9898
info: &'a Self::TypeInfo,

juniper/src/types/base.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ impl<'a, S> Arguments<'a, S> {
150150
/// This trait is intended to be used in a conjunction with a [`GraphQLType`] trait. See the example
151151
/// in the documentation of a [`GraphQLType`] trait.
152152
///
153-
/// [1]: https://spec.graphql.org/June2018/#sec-Interfaces
154-
/// [2]: https://spec.graphql.org/June2018/#sec-Unions
155-
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
156-
/// [4]: https://spec.graphql.org/June2018/#sec-Scalars
157-
/// [5]: https://spec.graphql.org/June2018/#sec-Enums
158-
/// [6]: https://spec.graphql.org/June2018/#sec-Type-System.List
159-
/// [7]: https://spec.graphql.org/June2018/#sec-Type-System.Non-Null
160-
/// [8]: https://spec.graphql.org/June2018/#sec-Input-Objects
153+
/// [1]: https://spec.graphql.org/October2021#sec-Interfaces
154+
/// [2]: https://spec.graphql.org/October2021#sec-Unions
155+
/// [3]: https://spec.graphql.org/October2021#sec-Objects
156+
/// [4]: https://spec.graphql.org/October2021#sec-Scalars
157+
/// [5]: https://spec.graphql.org/October2021#sec-Enums
158+
/// [6]: https://spec.graphql.org/October2021#sec-List
159+
/// [7]: https://spec.graphql.org/October2021#sec-Non-Null
160+
/// [8]: https://spec.graphql.org/October2021#sec-Input-Objects
161161
/// [11]: https://doc.rust-lang.org/reference/items/traits.html#object-safety
162162
/// [12]: https://doc.rust-lang.org/reference/types/trait-object.html
163163
pub trait GraphQLValue<S = DefaultScalarValue>
@@ -196,7 +196,7 @@ where
196196
///
197197
/// The default implementation panics.
198198
///
199-
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
199+
/// [3]: https://spec.graphql.org/October2021#sec-Objects
200200
fn resolve_field(
201201
&self,
202202
_info: &Self::TypeInfo,
@@ -217,9 +217,9 @@ where
217217
///
218218
/// The default implementation panics.
219219
///
220-
/// [1]: https://spec.graphql.org/June2018/#sec-Interfaces
221-
/// [2]: https://spec.graphql.org/June2018/#sec-Unions
222-
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
220+
/// [1]: https://spec.graphql.org/October2021#sec-Interfaces
221+
/// [2]: https://spec.graphql.org/October2021#sec-Unions
222+
/// [3]: https://spec.graphql.org/October2021#sec-Objects
223223
fn resolve_into_type(
224224
&self,
225225
info: &Self::TypeInfo,
@@ -243,9 +243,9 @@ where
243243
///
244244
/// The default implementation panics.
245245
///
246-
/// [1]: https://spec.graphql.org/June2018/#sec-Interfaces
247-
/// [2]: https://spec.graphql.org/June2018/#sec-Unions
248-
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
246+
/// [1]: https://spec.graphql.org/October2021#sec-Interfaces
247+
/// [2]: https://spec.graphql.org/October2021#sec-Unions
248+
/// [3]: https://spec.graphql.org/October2021#sec-Objects
249249
#[allow(unused_variables)]
250250
fn concrete_type_name(&self, context: &Self::Context, info: &Self::TypeInfo) -> String {
251251
panic!(
@@ -271,8 +271,8 @@ where
271271
///
272272
/// The default implementation panics, if `selection_set` is [`None`].
273273
///
274-
/// [0]: https://spec.graphql.org/June2018/#sec-Errors-and-Non-Nullability
275-
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
274+
/// [0]: https://spec.graphql.org/October2021#sec-Errors-and-Non-Nullability
275+
/// [3]: https://spec.graphql.org/October2021#sec-Objects
276276
fn resolve(
277277
&self,
278278
info: &Self::TypeInfo,
@@ -385,7 +385,7 @@ where
385385
/// }
386386
/// ```
387387
///
388-
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
388+
/// [3]: https://spec.graphql.org/October2021#sec-Objects
389389
pub trait GraphQLType<S = DefaultScalarValue>: GraphQLValue<S>
390390
where
391391
S: ScalarValue,

juniper/src/types/marker.rs

+21-21
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ use crate::{GraphQLType, ScalarValue};
1717
/// [GraphQL objects][1]. Other types ([scalars][2], [enums][3], [interfaces][4], [input objects][5]
1818
/// and [unions][6]) are not allowed.
1919
///
20-
/// [1]: https://spec.graphql.org/June2018/#sec-Objects
21-
/// [2]: https://spec.graphql.org/June2018/#sec-Scalars
22-
/// [3]: https://spec.graphql.org/June2018/#sec-Enums
23-
/// [4]: https://spec.graphql.org/June2018/#sec-Interfaces
24-
/// [5]: https://spec.graphql.org/June2018/#sec-Input-Objects
25-
/// [6]: https://spec.graphql.org/June2018/#sec-Unions
20+
/// [1]: https://spec.graphql.org/October2021#sec-Objects
21+
/// [2]: https://spec.graphql.org/October2021#sec-Scalars
22+
/// [3]: https://spec.graphql.org/October2021#sec-Enums
23+
/// [4]: https://spec.graphql.org/October2021#sec-Interfaces
24+
/// [5]: https://spec.graphql.org/October2021#sec-Input-Objects
25+
/// [6]: https://spec.graphql.org/October2021#sec-Unions
2626
pub trait GraphQLObject<S: ScalarValue>: GraphQLType<S> {
2727
/// An arbitrary function without meaning.
2828
///
2929
/// May contain compile timed check logic which ensures that types are used correctly according
3030
/// to the [GraphQL specification][1].
3131
///
32-
/// [1]: https://spec.graphql.org/June2018/
32+
/// [1]: https://spec.graphql.org/October2021
3333
fn mark() {}
3434
}
3535

@@ -74,19 +74,19 @@ where
7474
/// [GraphQL interfaces][1]. Other types ([scalars][2], [enums][3], [objects][4], [input objects][5]
7575
/// and [unions][6]) are not allowed.
7676
///
77-
/// [1]: https://spec.graphql.org/June2018/#sec-Interfaces
78-
/// [2]: https://spec.graphql.org/June2018/#sec-Scalars
79-
/// [3]: https://spec.graphql.org/June2018/#sec-Enums
80-
/// [4]: https://spec.graphql.org/June2018/#sec-Objects
81-
/// [5]: https://spec.graphql.org/June2018/#sec-Input-Objects
82-
/// [6]: https://spec.graphql.org/June2018/#sec-Unions
77+
/// [1]: https://spec.graphql.org/October2021#sec-Interfaces
78+
/// [2]: https://spec.graphql.org/October2021#sec-Scalars
79+
/// [3]: https://spec.graphql.org/October2021#sec-Enums
80+
/// [4]: https://spec.graphql.org/October2021#sec-Objects
81+
/// [5]: https://spec.graphql.org/October2021#sec-Input-Objects
82+
/// [6]: https://spec.graphql.org/October2021#sec-Unions
8383
pub trait GraphQLInterface<S: ScalarValue>: GraphQLType<S> {
8484
/// An arbitrary function without meaning.
8585
///
8686
/// May contain compile timed check logic which ensures that types are used correctly according
8787
/// to the [GraphQL specification][1].
8888
///
89-
/// [1]: https://spec.graphql.org/June2018/
89+
/// [1]: https://spec.graphql.org/October2021
9090
fn mark() {}
9191
}
9292

@@ -131,19 +131,19 @@ where
131131
/// [GraphQL unions][1]. Other types ([scalars][2], [enums][3], [objects][4], [input objects][5] and
132132
/// [interfaces][6]) are not allowed.
133133
///
134-
/// [1]: https://spec.graphql.org/June2018/#sec-Unions
135-
/// [2]: https://spec.graphql.org/June2018/#sec-Scalars
136-
/// [3]: https://spec.graphql.org/June2018/#sec-Enums
137-
/// [4]: https://spec.graphql.org/June2018/#sec-Objects
138-
/// [5]: https://spec.graphql.org/June2018/#sec-Input-Objects
139-
/// [6]: https://spec.graphql.org/June2018/#sec-Interfaces
134+
/// [1]: https://spec.graphql.org/October2021#sec-Unions
135+
/// [2]: https://spec.graphql.org/October2021#sec-Scalars
136+
/// [3]: https://spec.graphql.org/October2021#sec-Enums
137+
/// [4]: https://spec.graphql.org/October2021#sec-Objects
138+
/// [5]: https://spec.graphql.org/October2021#sec-Input-Objects
139+
/// [6]: https://spec.graphql.org/October2021#sec-Interfaces
140140
pub trait GraphQLUnion<S: ScalarValue>: GraphQLType<S> {
141141
/// An arbitrary function without meaning.
142142
///
143143
/// May contain compile timed check logic which ensures that types are used correctly according
144144
/// to the [GraphQL specification][1].
145145
///
146-
/// [1]: https://spec.graphql.org/June2018/
146+
/// [1]: https://spec.graphql.org/October2021
147147
fn mark() {}
148148
}
149149

juniper/src/types/subscriptions.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ pub trait SubscriptionConnection<S>: futures::Stream<Item = ExecutionOutput<S>>
9494
///
9595
/// See trait methods for more detailed explanation on how this trait works.
9696
///
97-
/// [1]: https://spec.graphql.org/June2018/#sec-Subscription
98-
/// [2]: https://spec.graphql.org/June2018/#sec-Objects
97+
/// [1]: https://spec.graphql.org/October2021#sec-Subscription
98+
/// [2]: https://spec.graphql.org/October2021#sec-Objects
9999
pub trait GraphQLSubscriptionValue<S = DefaultScalarValue>: GraphQLValue<S> + Sync
100100
where
101101
Self::TypeInfo: Sync,
@@ -204,7 +204,7 @@ crate::sa::assert_obj_safe!(GraphQLSubscriptionValue<Context = (), TypeInfo = ()
204204
/// It's automatically implemented for [`GraphQLSubscriptionValue`] and [`GraphQLType`]
205205
/// implementers, so doesn't require manual or code-generated implementation.
206206
///
207-
/// [1]: https://spec.graphql.org/June2018/#sec-Subscription
207+
/// [1]: https://spec.graphql.org/October2021#sec-Subscription
208208
pub trait GraphQLSubscriptionType<S = DefaultScalarValue>:
209209
GraphQLSubscriptionValue<S> + GraphQLType<S>
210210
where

juniper/src/value/scalar.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -228,34 +228,34 @@ pub trait ScalarValue:
228228
///
229229
/// These types closely follow the [GraphQL specification][0].
230230
///
231-
/// [0]: https://spec.graphql.org/June2018
231+
/// [0]: https://spec.graphql.org/October2021
232232
#[derive(Clone, Debug, PartialEq, ScalarValue, Serialize)]
233233
#[serde(untagged)]
234234
pub enum DefaultScalarValue {
235235
/// [`Int` scalar][0] as a signed 32‐bit numeric non‐fractional value.
236236
///
237-
/// [0]: https://spec.graphql.org/June2018/#sec-Int
237+
/// [0]: https://spec.graphql.org/October2021#sec-Int
238238
#[value(as_float, as_int)]
239239
Int(i32),
240240

241241
/// [`Float` scalar][0] as a signed double‐precision fractional values as
242242
/// specified by [IEEE 754].
243243
///
244-
/// [0]: https://spec.graphql.org/June2018/#sec-Float
244+
/// [0]: https://spec.graphql.org/October2021#sec-Float
245245
/// [IEEE 754]: https://en.wikipedia.org/wiki/IEEE_floating_point
246246
#[value(as_float)]
247247
Float(f64),
248248

249249
/// [`String` scalar][0] as a textual data, represented as UTF‐8 character
250250
/// sequences.
251251
///
252-
/// [0]: https://spec.graphql.org/June2018/#sec-String
252+
/// [0]: https://spec.graphql.org/October2021#sec-String
253253
#[value(as_str, as_string, into_string)]
254254
String(String),
255255

256256
/// [`Boolean` scalar][0] as a `true` or `false` value.
257257
///
258-
/// [0]: https://spec.graphql.org/June2018/#sec-Boolean
258+
/// [0]: https://spec.graphql.org/October2021#sec-Boolean
259259
#[value(as_bool)]
260260
Boolean(bool),
261261
}

0 commit comments

Comments
 (0)