Skip to content

Commit

Permalink
Update all links to October 2021 spec (#1075, #1000)
Browse files Browse the repository at this point in the history
Co-authored-by: Kai Ren <tyranron@gmail.com>
  • Loading branch information
ilslv and tyranron committed Jun 28, 2022
1 parent 927e422 commit a32140c
Show file tree
Hide file tree
Showing 71 changed files with 286 additions and 286 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -47,7 +47,7 @@ see the [actix][actix_examples], [hyper][hyper_examples], [rocket][rocket_exampl
## Features

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

As an exception to other GraphQL libraries for other languages, Juniper builds
Expand Down Expand Up @@ -97,7 +97,7 @@ Juniper has not reached 1.0 yet, thus some API instability should be expected.
[graphiql]: https://github.com/graphql/graphiql
[playground]: https://github.com/prisma/graphql-playground
[iron]: https://github.com/iron/iron
[graphql_spec]: http://facebook.github.io/graphql
[graphql_spec]: https://spec.graphql.org/October2021
[schema_language]: https://graphql.org/learn/schema/#type-language
[schema_approach]: https://blog.logrocket.com/code-first-vs-schema-first-development-graphql/
[test_schema_rs]: https://github.com/graphql-rust/juniper/blob/master/juniper/src/tests/fixtures/starwars/schema.rs
Expand Down
4 changes: 2 additions & 2 deletions book/src/README.md
Expand Up @@ -21,7 +21,7 @@ embedded [Graphiql][graphiql] for easy debugging.
## Features

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

Expand Down Expand Up @@ -57,7 +57,7 @@ Juniper has not reached 1.0 yet, thus some API instability should be expected.
[graphql]: http://graphql.org
[graphiql]: https://github.com/graphql/graphiql
[iron]: https://github.com/iron/iron
[graphql_spec]: http://facebook.github.io/graphql
[graphql_spec]: https://spec.graphql.org/October2021
[test_schema_rs]: https://github.com/graphql-rust/juniper/blob/master/juniper/src/tests/schema.rs
[tokio]: https://github.com/tokio-rs/tokio
[hyper_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_hyper/examples
Expand Down
4 changes: 2 additions & 2 deletions book/src/types/interfaces.md
Expand Up @@ -473,9 +473,9 @@ struct Droid {



[1]: https://spec.graphql.org/June2018/#sec-Interfaces
[1]: https://spec.graphql.org/October2021#sec-Interfaces
[2]: https://doc.rust-lang.org/reference/types/trait-object.html
[3]: https://docs.rs/juniper/latest/juniper/trait.ScalarValue.html
[4]: https://docs.rs/juniper/latest/juniper/struct.Executor.html
[5]: https://spec.graphql.org/June2018/#sec-Objects
[5]: https://spec.graphql.org/October2021#sec-Objects
[6]: https://docs.rs/juniper/0.14.2/juniper/trait.Context.html
4 changes: 2 additions & 2 deletions book/src/types/objects/error_handling.md
Expand Up @@ -60,7 +60,7 @@ there - those errors are automatically converted into `FieldError`.

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

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

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

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

```json
{
Expand Down
4 changes: 2 additions & 2 deletions book/src/types/scalars.md
Expand Up @@ -24,10 +24,10 @@ Juniper has built-in support for:
* `String` and `&str` as `String`
* `bool` as `Boolean`
* `juniper::ID` as `ID`. This type is defined [in the
spec](http://facebook.github.io/graphql/#sec-ID) as a type that is serialized
spec](https://spec.graphql.org/October2021#sec-ID) as a type that is serialized
as a string but can be parsed from both a string and an integer.

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.
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.

**Third party types**:

Expand Down
6 changes: 3 additions & 3 deletions book/src/types/unions.md
Expand Up @@ -130,7 +130,7 @@ impl Character {
# fn main() {}
```

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).
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).

```rust
# #![allow(dead_code)]
Expand Down Expand Up @@ -485,7 +485,7 @@ enum Character {



[1]: https://spec.graphql.org/June2018/#sec-Unions
[1]: https://spec.graphql.org/October2021#sec-Unions
[2]: https://docs.rs/juniper/latest/juniper/trait.ScalarValue.html
[5]: https://spec.graphql.org/June2018/#sec-Interfaces
[5]: https://spec.graphql.org/October2021#sec-Interfaces
[6]: https://docs.rs/juniper/0.14.2/juniper/trait.Context.html
2 changes: 1 addition & 1 deletion juniper/src/schema/meta.rs
Expand Up @@ -405,7 +405,7 @@ impl<'a, S> MetaType<'a, S> {
// "used exclusively by GraphQL’s introspection system"
{
name.starts_with("__") ||
// <https://facebook.github.io/graphql/draft/#sec-Scalars>
// https://spec.graphql.org/October2021#sec-Scalars
name == "Boolean" || name == "String" || name == "Int" || name == "Float" || name == "ID" ||
// Our custom empty markers
name == "_EmptyMutation" || name == "_EmptySubscription"
Expand Down
6 changes: 3 additions & 3 deletions juniper/src/schema/translate/graphql_parser.rs
Expand Up @@ -298,9 +298,9 @@ where
}
}

// Right now the only directive supported is `@deprecated`. `@skip` and `@include`
// are dealt with elsewhere.
// <https://facebook.github.io/graphql/draft/#sec-Type-System.Directives>
// Right now the only directive supported is `@deprecated`.
// `@skip` and `@include` are dealt with elsewhere.
// https://spec.graphql.org/October2021#sec-Type-System.Directives.Built-in-Directives
fn generate_directives<'a, T>(status: &DeprecationStatus) -> Vec<ExternalDirective<'a, T>>
where
T: Text<'a>,
Expand Down
12 changes: 6 additions & 6 deletions juniper/src/types/async_await.rs
Expand Up @@ -30,7 +30,7 @@ where
///
/// The default implementation panics.
///
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
/// [3]: https://spec.graphql.org/October2021#sec-Objects
fn resolve_field_async<'a>(
&'a self,
_info: &'a Self::TypeInfo,
Expand All @@ -54,9 +54,9 @@ where
///
/// The default implementation panics.
///
/// [1]: https://spec.graphql.org/June2018/#sec-Interfaces
/// [2]: https://spec.graphql.org/June2018/#sec-Unions
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
/// [1]: https://spec.graphql.org/October2021#sec-Interfaces
/// [2]: https://spec.graphql.org/October2021#sec-Unions
/// [3]: https://spec.graphql.org/October2021#sec-Objects
fn resolve_into_type_async<'a>(
&'a self,
info: &'a Self::TypeInfo,
Expand Down Expand Up @@ -91,8 +91,8 @@ where
///
/// The default implementation panics, if `selection_set` is [`None`].
///
/// [0]: https://spec.graphql.org/June2018/#sec-Errors-and-Non-Nullability
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
/// [0]: https://spec.graphql.org/October2021#sec-Handling-Field-Errors
/// [3]: https://spec.graphql.org/October2021#sec-Objects
fn resolve_async<'a>(
&'a self,
info: &'a Self::TypeInfo,
Expand Down
36 changes: 18 additions & 18 deletions juniper/src/types/base.rs
Expand Up @@ -150,14 +150,14 @@ impl<'a, S> Arguments<'a, S> {
/// This trait is intended to be used in a conjunction with a [`GraphQLType`] trait. See the example
/// in the documentation of a [`GraphQLType`] trait.
///
/// [1]: https://spec.graphql.org/June2018/#sec-Interfaces
/// [2]: https://spec.graphql.org/June2018/#sec-Unions
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
/// [4]: https://spec.graphql.org/June2018/#sec-Scalars
/// [5]: https://spec.graphql.org/June2018/#sec-Enums
/// [6]: https://spec.graphql.org/June2018/#sec-Type-System.List
/// [7]: https://spec.graphql.org/June2018/#sec-Type-System.Non-Null
/// [8]: https://spec.graphql.org/June2018/#sec-Input-Objects
/// [1]: https://spec.graphql.org/October2021#sec-Interfaces
/// [2]: https://spec.graphql.org/October2021#sec-Unions
/// [3]: https://spec.graphql.org/October2021#sec-Objects
/// [4]: https://spec.graphql.org/October2021#sec-Scalars
/// [5]: https://spec.graphql.org/October2021#sec-Enums
/// [6]: https://spec.graphql.org/October2021#sec-List
/// [7]: https://spec.graphql.org/October2021#sec-Non-Null
/// [8]: https://spec.graphql.org/October2021#sec-Input-Objects
/// [11]: https://doc.rust-lang.org/reference/items/traits.html#object-safety
/// [12]: https://doc.rust-lang.org/reference/types/trait-object.html
pub trait GraphQLValue<S = DefaultScalarValue>
Expand Down Expand Up @@ -196,7 +196,7 @@ where
///
/// The default implementation panics.
///
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
/// [3]: https://spec.graphql.org/October2021#sec-Objects
fn resolve_field(
&self,
_info: &Self::TypeInfo,
Expand All @@ -217,9 +217,9 @@ where
///
/// The default implementation panics.
///
/// [1]: https://spec.graphql.org/June2018/#sec-Interfaces
/// [2]: https://spec.graphql.org/June2018/#sec-Unions
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
/// [1]: https://spec.graphql.org/October2021#sec-Interfaces
/// [2]: https://spec.graphql.org/October2021#sec-Unions
/// [3]: https://spec.graphql.org/October2021#sec-Objects
fn resolve_into_type(
&self,
info: &Self::TypeInfo,
Expand All @@ -243,9 +243,9 @@ where
///
/// The default implementation panics.
///
/// [1]: https://spec.graphql.org/June2018/#sec-Interfaces
/// [2]: https://spec.graphql.org/June2018/#sec-Unions
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
/// [1]: https://spec.graphql.org/October2021#sec-Interfaces
/// [2]: https://spec.graphql.org/October2021#sec-Unions
/// [3]: https://spec.graphql.org/October2021#sec-Objects
#[allow(unused_variables)]
fn concrete_type_name(&self, context: &Self::Context, info: &Self::TypeInfo) -> String {
panic!(
Expand All @@ -271,8 +271,8 @@ where
///
/// The default implementation panics, if `selection_set` is [`None`].
///
/// [0]: https://spec.graphql.org/June2018/#sec-Errors-and-Non-Nullability
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
/// [0]: https://spec.graphql.org/October2021#sec-Errors-and-Non-Nullability
/// [3]: https://spec.graphql.org/October2021#sec-Objects
fn resolve(
&self,
info: &Self::TypeInfo,
Expand Down Expand Up @@ -385,7 +385,7 @@ where
/// }
/// ```
///
/// [3]: https://spec.graphql.org/June2018/#sec-Objects
/// [3]: https://spec.graphql.org/October2021#sec-Objects
pub trait GraphQLType<S = DefaultScalarValue>: GraphQLValue<S>
where
S: ScalarValue,
Expand Down
42 changes: 21 additions & 21 deletions juniper/src/types/marker.rs
Expand Up @@ -17,19 +17,19 @@ use crate::{GraphQLType, ScalarValue};
/// [GraphQL objects][1]. Other types ([scalars][2], [enums][3], [interfaces][4], [input objects][5]
/// and [unions][6]) are not allowed.
///
/// [1]: https://spec.graphql.org/June2018/#sec-Objects
/// [2]: https://spec.graphql.org/June2018/#sec-Scalars
/// [3]: https://spec.graphql.org/June2018/#sec-Enums
/// [4]: https://spec.graphql.org/June2018/#sec-Interfaces
/// [5]: https://spec.graphql.org/June2018/#sec-Input-Objects
/// [6]: https://spec.graphql.org/June2018/#sec-Unions
/// [1]: https://spec.graphql.org/October2021#sec-Objects
/// [2]: https://spec.graphql.org/October2021#sec-Scalars
/// [3]: https://spec.graphql.org/October2021#sec-Enums
/// [4]: https://spec.graphql.org/October2021#sec-Interfaces
/// [5]: https://spec.graphql.org/October2021#sec-Input-Objects
/// [6]: https://spec.graphql.org/October2021#sec-Unions
pub trait GraphQLObject<S: ScalarValue>: GraphQLType<S> {
/// An arbitrary function without meaning.
///
/// May contain compile timed check logic which ensures that types are used correctly according
/// to the [GraphQL specification][1].
///
/// [1]: https://spec.graphql.org/June2018/
/// [1]: https://spec.graphql.org/October2021
fn mark() {}
}

Expand Down Expand Up @@ -74,19 +74,19 @@ where
/// [GraphQL interfaces][1]. Other types ([scalars][2], [enums][3], [objects][4], [input objects][5]
/// and [unions][6]) are not allowed.
///
/// [1]: https://spec.graphql.org/June2018/#sec-Interfaces
/// [2]: https://spec.graphql.org/June2018/#sec-Scalars
/// [3]: https://spec.graphql.org/June2018/#sec-Enums
/// [4]: https://spec.graphql.org/June2018/#sec-Objects
/// [5]: https://spec.graphql.org/June2018/#sec-Input-Objects
/// [6]: https://spec.graphql.org/June2018/#sec-Unions
/// [1]: https://spec.graphql.org/October2021#sec-Interfaces
/// [2]: https://spec.graphql.org/October2021#sec-Scalars
/// [3]: https://spec.graphql.org/October2021#sec-Enums
/// [4]: https://spec.graphql.org/October2021#sec-Objects
/// [5]: https://spec.graphql.org/October2021#sec-Input-Objects
/// [6]: https://spec.graphql.org/October2021#sec-Unions
pub trait GraphQLInterface<S: ScalarValue>: GraphQLType<S> {
/// An arbitrary function without meaning.
///
/// May contain compile timed check logic which ensures that types are used correctly according
/// to the [GraphQL specification][1].
///
/// [1]: https://spec.graphql.org/June2018/
/// [1]: https://spec.graphql.org/October2021
fn mark() {}
}

Expand Down Expand Up @@ -131,19 +131,19 @@ where
/// [GraphQL unions][1]. Other types ([scalars][2], [enums][3], [objects][4], [input objects][5] and
/// [interfaces][6]) are not allowed.
///
/// [1]: https://spec.graphql.org/June2018/#sec-Unions
/// [2]: https://spec.graphql.org/June2018/#sec-Scalars
/// [3]: https://spec.graphql.org/June2018/#sec-Enums
/// [4]: https://spec.graphql.org/June2018/#sec-Objects
/// [5]: https://spec.graphql.org/June2018/#sec-Input-Objects
/// [6]: https://spec.graphql.org/June2018/#sec-Interfaces
/// [1]: https://spec.graphql.org/October2021#sec-Unions
/// [2]: https://spec.graphql.org/October2021#sec-Scalars
/// [3]: https://spec.graphql.org/October2021#sec-Enums
/// [4]: https://spec.graphql.org/October2021#sec-Objects
/// [5]: https://spec.graphql.org/October2021#sec-Input-Objects
/// [6]: https://spec.graphql.org/October2021#sec-Interfaces
pub trait GraphQLUnion<S: ScalarValue>: GraphQLType<S> {
/// An arbitrary function without meaning.
///
/// May contain compile timed check logic which ensures that types are used correctly according
/// to the [GraphQL specification][1].
///
/// [1]: https://spec.graphql.org/June2018/
/// [1]: https://spec.graphql.org/October2021
fn mark() {}
}

Expand Down
6 changes: 3 additions & 3 deletions juniper/src/types/subscriptions.rs
Expand Up @@ -94,8 +94,8 @@ pub trait SubscriptionConnection<S>: futures::Stream<Item = ExecutionOutput<S>>
///
/// See trait methods for more detailed explanation on how this trait works.
///
/// [1]: https://spec.graphql.org/June2018/#sec-Subscription
/// [2]: https://spec.graphql.org/June2018/#sec-Objects
/// [1]: https://spec.graphql.org/October2021#sec-Subscription
/// [2]: https://spec.graphql.org/October2021#sec-Objects
pub trait GraphQLSubscriptionValue<S = DefaultScalarValue>: GraphQLValue<S> + Sync
where
Self::TypeInfo: Sync,
Expand Down Expand Up @@ -204,7 +204,7 @@ crate::sa::assert_obj_safe!(GraphQLSubscriptionValue<Context = (), TypeInfo = ()
/// It's automatically implemented for [`GraphQLSubscriptionValue`] and [`GraphQLType`]
/// implementers, so doesn't require manual or code-generated implementation.
///
/// [1]: https://spec.graphql.org/June2018/#sec-Subscription
/// [1]: https://spec.graphql.org/October2021#sec-Subscription
pub trait GraphQLSubscriptionType<S = DefaultScalarValue>:
GraphQLSubscriptionValue<S> + GraphQLType<S>
where
Expand Down
10 changes: 5 additions & 5 deletions juniper/src/value/scalar.rs
Expand Up @@ -228,34 +228,34 @@ pub trait ScalarValue:
///
/// These types closely follow the [GraphQL specification][0].
///
/// [0]: https://spec.graphql.org/June2018
/// [0]: https://spec.graphql.org/October2021
#[derive(Clone, Debug, PartialEq, ScalarValue, Serialize)]
#[serde(untagged)]
pub enum DefaultScalarValue {
/// [`Int` scalar][0] as a signed 32‐bit numeric non‐fractional value.
///
/// [0]: https://spec.graphql.org/June2018/#sec-Int
/// [0]: https://spec.graphql.org/October2021#sec-Int
#[value(as_float, as_int)]
Int(i32),

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

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

/// [`Boolean` scalar][0] as a `true` or `false` value.
///
/// [0]: https://spec.graphql.org/June2018/#sec-Boolean
/// [0]: https://spec.graphql.org/October2021#sec-Boolean
#[value(as_bool)]
Boolean(bool),
}
Expand Down

0 comments on commit a32140c

Please sign in to comment.