Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
LegNeato authored Aug 22, 2024
2 parents 1acc008 + 43c5888 commit 6a0a69c
Show file tree
Hide file tree
Showing 44 changed files with 1,415 additions and 210 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ jobs:
- { feature: chrono-clock, crate: juniper }
- { feature: chrono-tz, crate: juniper }
- { feature: expose-test-schema, crate: juniper }
- { feature: jiff, crate: juniper }
- { feature: rust_decimal, crate: juniper }
- { feature: schema-language, crate: juniper }
- { feature: time, crate: juniper }
Expand Down Expand Up @@ -144,13 +145,13 @@ jobs:
strategy:
fail-fast: false
matrix:
msrv: ["1.73.0"]
msrv: ["1.75.0"]
crate:
- juniper_codegen
- juniper
- juniper_subscriptions
- juniper_graphql_ws
#- juniper_actix
- juniper_actix
- juniper_axum
- juniper_hyper
- juniper_rocket
Expand All @@ -159,10 +160,10 @@ jobs:
- ubuntu
- macOS
- windows
include:
- { msrv: "1.75.0", crate: "juniper_actix", os: "ubuntu" }
- { msrv: "1.75.0", crate: "juniper_actix", os: "macOS" }
- { msrv: "1.75.0", crate: "juniper_actix", os: "windows" }
#include:
# - { msrv: "1.75.0", crate: "juniper_actix", os: "ubuntu" }
# - { msrv: "1.75.0", crate: "juniper_actix", os: "macOS" }
# - { msrv: "1.75.0", crate: "juniper_actix", os: "windows" }
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ your Schemas automatically.
- [url][url]
- [chrono][chrono]
- [chrono-tz][chrono-tz]
- [jiff][jiff]
- [time][time]
- [bson][bson]

Expand Down Expand Up @@ -119,6 +120,7 @@ Juniper has not reached 1.0 yet, thus some API instability should be expected.
[url]: https://crates.io/crates/url
[chrono]: https://crates.io/crates/chrono
[chrono-tz]: https://crates.io/crates/chrono-tz
[jiff]: https://crates.io/crates/jiff
[time]: https://crates.io/crates/time
[bson]: https://crates.io/crates/bson
[juniper-from-schema]: https://github.com/davidpdrsn/juniper-from-schema
2 changes: 2 additions & 0 deletions book/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Introduction
- [`bigdecimal`]
- [`bson`]
- [`chrono`], [`chrono-tz`]
- [`jiff`]
- [`rust_decimal`]
- [`time`]
- [`url`]
Expand Down Expand Up @@ -63,6 +64,7 @@ Introduction
[`bson`]: https://docs.rs/bson
[`chrono`]: https://docs.rs/chrono
[`chrono-tz`]: https://docs.rs/chrono-tz
[`jiff`]: https://docs.rs/jiff
[`juniper`]: https://docs.rs/juniper
[`juniper_actix`]: https://docs.rs/juniper_actix
[`juniper_axum`]: https://docs.rs/juniper_axum
Expand Down
61 changes: 39 additions & 22 deletions book/src/types/scalars.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,30 +385,35 @@ mod date_scalar {

[Juniper] provides out-of-the-box [GraphQL scalar][0] implementations for some very common [Rust] crates. The types from these crates will be usable in your schemas automatically after enabling the correspondent self-titled [Cargo feature].

| [Rust] type | [GraphQL] scalar | [Cargo feature] |
|-----------------------------|------------------|------------------|
| [`BigDecimal`] | `BigDecimal` | [`bigdecimal`] |
| [`bson::oid::ObjectId`] | `ObjectId` | [`bson`] |
| [`bson::DateTime`] | `UtcDateTime` | [`bson`] |
| [`chrono::NaiveDate`] | [`Date`] | [`chrono`] |
| [`chrono::NaiveTime`] | [`LocalTime`] | [`chrono`] |
| [`chrono::NaiveDateTime`] | `LocalDateTime` | [`chrono`] |
| [`chrono::DateTime`] | [`DateTime`] | [`chrono`] |
| [`chrono_tz::Tz`] | `TimeZone` | [`chrono-tz`] |
| [`Decimal`] | `Decimal` | [`rust_decimal`] |
| [`time::Date`] | [`Date`] | [`time`] |
| [`time::Time`] | [`LocalTime`] | [`time`] |
| [`time::PrimitiveDateTime`] | `LocalDateTime` | [`time`] |
| [`time::OffsetDateTime`] | [`DateTime`] | [`time`] |
| [`time::UtcOffset`] | [`UtcOffset`] | [`time`] |
| [`Url`] | `Url` | [`url`] |
| [`Uuid`] | `Uuid` | [`uuid`] |
| [Rust] type | [GraphQL] scalar | [Cargo feature] |
|-----------------------------|-------------------|------------------|
| [`bigdecimal::BigDecimal`] | `BigDecimal` | [`bigdecimal`] |
| [`bson::oid::ObjectId`] | [`ObjectID`] | [`bson`] |
| [`bson::DateTime`] | [`DateTime`] | [`bson`] |
| [`chrono::NaiveDate`] | [`LocalDate`] | [`chrono`] |
| [`chrono::NaiveTime`] | [`LocalTime`] | [`chrono`] |
| [`chrono::NaiveDateTime`] | [`LocalDateTime`] | [`chrono`] |
| [`chrono::DateTime`] | [`DateTime`] | [`chrono`] |
| [`chrono_tz::Tz`] | [`TimeZone`] | [`chrono-tz`] |
| [`rust_decimal::Decimal`] | `Decimal` | [`rust_decimal`] |
| [`jiff::civil::Date`] | [`LocalDate`] | [`jiff`] |
| [`jiff::civil::Time`] | [`LocalTime`] | [`jiff`] |
| [`jiff::civil::DateTime`] | [`LocalDateTime`] | [`jiff`] |
| [`jiff::Timestamp`] | [`DateTime`] | [`jiff`] |
| [`jiff::Span`] | [`Duration`] | [`jiff`] |
| [`time::Date`] | [`LocalDate`] | [`time`] |
| [`time::Time`] | [`LocalTime`] | [`time`] |
| [`time::PrimitiveDateTime`] | [`LocalDateTime`] | [`time`] |
| [`time::OffsetDateTime`] | [`DateTime`] | [`time`] |
| [`time::UtcOffset`] | [`UtcOffset`] | [`time`] |
| [`url::Url`] | [`URL`] | [`url`] |
| [`uuid::Uuid`] | [`UUID`] | [`uuid`] |




[`bigdecimal`]: https://docs.rs/bigdecimal
[`BigDecimal`]: https://docs.rs/bigdecimal/latest/bigdecimal/struct.BigDecimal.html
[`bigdecimal::BigDecimal`]: https://docs.rs/bigdecimal/latest/bigdecimal/struct.BigDecimal.html
[`bson`]: https://docs.rs/bson
[`bson::DateTime`]: https://docs.rs/bson/latest/bson/struct.DateTime.html
[`bson::oid::ObjectId`]: https://docs.rs/bson/latest/bson/oid/struct.ObjectId.html
Expand All @@ -419,11 +424,20 @@ mod date_scalar {
[`chrono::NaiveTime`]: https://docs.rs/chrono/latest/chrono/naive/struct.NaiveTime.html
[`chrono-tz`]: https://docs.rs/chrono-tz
[`chrono_tz::Tz`]: https://docs.rs/chrono-tz/latest/chrono_tz/enum.Tz.html
[`Date`]: https://graphql-scalars.dev/docs/scalars/date
[`DateTime`]: https://graphql-scalars.dev/docs/scalars/date-time
[`Decimal`]: https://docs.rs/rust_decimal/latest/rust_decimal/struct.Decimal.html
[`Duration`]: https://graphql-scalars.dev/docs/scalars/duration
[`ID`]: https://spec.graphql.org/October2021#sec-ID
[`jiff`]: https://docs.rs/jiff
[`jiff::civil::Date`]: https://docs.rs/jiff/latest/jiff/civil/struct.Date.html
[`jiff::civil::DateTime`]: https://docs.rs/jiff/latest/jiff/civil/struct.DateTime.html
[`jiff::civil::Time`]: https://docs.rs/jiff/latest/jiff/civil/struct.Time.html
[`jiff::Span`]: https://docs.rs/jiff/latest/jiff/struct.Span.html
[`jiff::Timestamp`]: https://docs.rs/jiff/latest/jiff/struct.Timestamp.html
[`LocalDate`]: https://graphql-scalars.dev/docs/scalars/local-date
[`LocalDateTime`]: https://graphql-scalars.dev/docs/scalars/local-date-time
[`LocalTime`]: https://graphql-scalars.dev/docs/scalars/local-time
[`ObjectID`]: https://the-guild.dev/graphql/scalars/docs/scalars/object-id
[`rust_decimal`]: https://docs.rs/rust_decimal
[`ScalarValue`]: https://docs.rs/juniper/0.16.1/juniper/trait.ScalarValue.html
[`serde`]: https://docs.rs/serde
Expand All @@ -433,11 +447,14 @@ mod date_scalar {
[`time::Time`]: https://docs.rs/time/latest/time/struct.Time.html
[`time::UtcOffset`]: https://docs.rs/time/latest/time/struct.UtcOffset.html
[`time::OffsetDateTime`]: https://docs.rs/time/latest/time/struct.OffsetDateTime.html
[`TimeZone`]: https://graphql-scalars.dev/docs/scalars/time-zone
[`url`]: https://docs.rs/url
[`Url`]: https://docs.rs/url/latest/url/struct.Url.html
[`url::Url`]: https://docs.rs/url/latest/url/struct.Url.html
[`URL`]: https://graphql-scalars.dev/docs/scalars/url
[`UtcOffset`]: https://graphql-scalars.dev/docs/scalars/utc-offset
[`uuid`]: https://docs.rs/uuid
[`Uuid`]: https://docs.rs/uuid/latest/uuid/struct.Uuid.html
[`uuid::Uuid`]: https://docs.rs/uuid/latest/uuid/struct.Uuid.html
[`UUID`]: https://graphql-scalars.dev/docs/scalars/uuid
[Cargo feature]: https://doc.rust-lang.org/cargo/reference/features.html
[GraphQL]: https://graphql.org
[Juniper]: https://docs.rs/juniper
Expand Down
43 changes: 38 additions & 5 deletions juniper/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,52 @@ All user visible changes to `juniper` crate will be documented in this file. Thi



## [0.17.0] · 2024-04-?? (unreleased)
[0.17.0]: /../../tree/juniper-v0.17.0/juniper
## master

[Diff](/../../compare/juniper-v0.16.1...juniper-v0.17.0) | [Milestone](/../../milestone/7)
[Diff](/../../compare/juniper-v0.16.1...master) | [Milestone](/../../milestone/7)

### BC Breaks

- Upgraded [`chrono-tz` crate] integration to [0.9 version](https://github.com/chronotope/chrono-tz/releases/tag/v0.9.0). ([#1252])
- Bumped up [MSRV] to 1.75. ([#1272])
- Corrected compliance with newer [graphql-scalars.dev] specs: ([#1275], [#1277])
- Switched `LocalDateTime` scalars to `yyyy-MM-ddTHH:mm:ss` format in types:
- `chrono::NaiveDateTime`.
- `time::PrimitiveDateTime`.
- Switched from `Date` scalar to `LocalDate` scalar in types:
- `chrono::NaiveDate`.
- `time::Date`.
- Switched from `UtcDateTime` scalar to `DateTime` scalar in types:
- `bson::DateTime`.
- Corrected `TimeZone` scalar in types:
- `chrono_tz::Tz`.
- Renamed `Url` scalar to `URL` in types:
- `url::Url`.
- Renamed `Uuid` scalar to `UUID` in types:
- `uuid::Uuid`.
- Renamed `ObjectId` scalar to `ObjectID` in types: ([#1277])
- `bson::oid::ObjectId`.

### Added

- [`jiff` crate] integration behind `jiff` [Cargo feature]: ([#1271], [#1270])
- `jiff::civil::Date` as `LocalDate` scalar.
- `jiff::civil::Time` as `LocalTime` scalar.
- `jiff::civil::DateTime` as `LocalDateTime` scalar. ([#1275])
- `jiff::Timestamp` as `DateTime` scalar.
- `jiff::Span` as `Duration` scalar.

### Changed

- Updated [GraphiQL] to [3.4.0 version](https://github.com/graphql/graphiql/blob/graphiql%403.4.0/packages/graphiql/CHANGELOG.md#340). ([#1269])
- Updated [GraphiQL] to [3.7.0 version](https://github.com/graphql/graphiql/blob/graphiql%403.7.0/packages/graphiql/CHANGELOG.md#370). ([#1279])

[#1252]: /../../pull/1252
[#1269]: /../../pull/1269
[#1270]: /../../issues/1270
[#1271]: /../../pull/1271
[#1272]: /../../pull/1272
[#1275]: /../../pull/1275
[#1277]: /../../pull/1277
[#1279]: /../../pull/1279



Expand Down Expand Up @@ -221,12 +252,14 @@ See [old CHANGELOG](/../../blob/juniper-v0.15.12/juniper/CHANGELOG.md).
[`bson` crate]: https://docs.rs/bson
[`chrono` crate]: https://docs.rs/chrono
[`chrono-tz` crate]: https://docs.rs/chrono-tz
[`jiff` crate]: https://docs.rs/jiff
[`time` crate]: https://docs.rs/time
[Cargo feature]: https://doc.rust-lang.org/cargo/reference/features.html
[`graphql-transport-ws` GraphQL over WebSocket Protocol]: https://github.com/enisdenjo/graphql-ws/v5.14.0/PROTOCOL.md
[GraphiQL]: https://github.com/graphql/graphiql
[GraphQL Playground]: https://github.com/prisma/graphql-playground
[graphql-scalars.dev]: https://graphql-scalars.dev
[MSRV]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field
[October 2021]: https://spec.graphql.org/October2021
[object safety]: https://doc.rust-lang.org/reference/items/traits.html#object-safety
[orphan rules]: https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
Expand Down
6 changes: 4 additions & 2 deletions juniper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "juniper"
version = "0.16.1"
edition = "2021"
rust-version = "1.73"
rust-version = "1.75"
description = "GraphQL server library."
license = "BSD-2-Clause"
authors = [
Expand Down Expand Up @@ -33,6 +33,7 @@ chrono = ["dep:chrono"]
chrono-clock = ["chrono", "chrono/clock"]
chrono-tz = ["dep:chrono-tz", "dep:regex"]
expose-test-schema = ["dep:anyhow", "dep:serde_json"]
jiff = ["dep:jiff"]
js = ["chrono?/wasmbind", "time?/wasm-bindgen", "uuid?/js"]
rust_decimal = ["dep:rust_decimal"]
schema-language = ["dep:graphql-parser", "dep:void"]
Expand All @@ -45,13 +46,14 @@ anyhow = { version = "1.0.47", optional = true }
async-trait = "0.1.39"
auto_enums = "0.8"
bigdecimal = { version = "0.4", optional = true }
bson = { version = "2.4", features = ["chrono-0_4"], optional = true }
bson = { version = "2.4", optional = true }
chrono = { version = "0.4.30", features = ["alloc"], default-features = false, optional = true }
chrono-tz = { version = "0.9", default-features = false, optional = true }
fnv = "1.0.5"
futures = { version = "0.3.22", features = ["alloc"], default-features = false }
graphql-parser = { version = "0.4", optional = true }
indexmap = { version = "2.0", features = ["serde"] }
jiff = { version = "0.1.5", features = ["alloc"], default-features = false, optional = true }
juniper_codegen = { version = "0.16.0", path = "../juniper_codegen" }
rust_decimal = { version = "1.20", default-features = false, optional = true }
ryu = { version = "1.0", optional = true }
Expand Down
4 changes: 0 additions & 4 deletions juniper/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ graphiql:
https://raw.githubusercontent.com/graphql/graphiql/graphiql%40$(GRAPHIQL_VER)/examples/graphiql-cdn/index.html
$(sed-i) 's|unpkg.com/graphiql/|unpkg.com/graphiql@$(GRAPHIQL_VER)/|g' \
src/http/graphiql.html
$(sed-i) 's|react.development.js|react.production.min.js|g' \
src/http/graphiql.html
$(sed-i) 's|react-dom.development.js|react-dom.production.min.js|g' \
src/http/graphiql.html
$(sed-i) "s|'https://swapi-graphql.netlify.app/.netlify/functions/index'|JUNIPER_URL|g" \
src/http/graphiql.html
$(sed-i) "s|url: JUNIPER_URL,|url: JUNIPER_URL,\n subscriptionUrl: normalizeSubscriptionEndpoint(JUNIPER_URL, JUNIPER_SUBSCRIPTIONS_URL)|" \
Expand Down
4 changes: 3 additions & 1 deletion juniper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Juniper (GraphQL server library for Rust)
[![Crates.io](https://img.shields.io/crates/v/juniper.svg?maxAge=2592000)](https://crates.io/crates/juniper)
[![Documentation](https://docs.rs/juniper/badge.svg)](https://docs.rs/juniper)
[![CI](https://github.com/graphql-rust/juniper/workflows/CI/badge.svg?branch=master "CI")](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster)
[![Rust 1.73+](https://img.shields.io/badge/rustc-1.73+-lightgray.svg "Rust 1.73+")](https://blog.rust-lang.org/2023/10/05/Rust-1.73.0.html)
[![Rust 1.75+](https://img.shields.io/badge/rustc-1.75+-lightgray.svg "Rust 1.75+")](https://blog.rust-lang.org/2023/12/28/Rust-1.75.0.html)

- [Juniper Book] ([current][Juniper Book] | [edge][Juniper Book edge])
- [Changelog](https://github.com/graphql-rust/juniper/blob/juniper-v0.16.1/juniper/CHANGELOG.md)
Expand Down Expand Up @@ -48,6 +48,7 @@ As an exception to other [GraphQL] libraries for other languages, [Juniper] buil
- [`bigdecimal`]
- [`bson`]
- [`chrono`], [`chrono-tz`]
- [`jiff`]
- [`rust_decimal`]
- [`time`]
- [`url`]
Expand Down Expand Up @@ -85,6 +86,7 @@ This project is licensed under [BSD 2-Clause License](https://github.com/graphql
[`bson`]: https://docs.rs/bson
[`chrono`]: https://docs.rs/chrono
[`chrono-tz`]: https://docs.rs/chrono-tz
[`jiff`]: https://docs.rs/jiff
[`juniper_actix`]: https://docs.rs/juniper_actix
[`juniper_axum`]: https://docs.rs/juniper_axum
[`juniper_hyper`]: https://docs.rs/juniper_hyper
Expand Down
2 changes: 1 addition & 1 deletion juniper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"postinstall": "make graphiql graphql-playground"
},
"dependencies": {
"graphiql": "3.4.0",
"graphiql": "3.7.0",
"graphql-playground-react": "1.7.28"
}
}
1 change: 1 addition & 0 deletions juniper/src/executor_tests/interfaces_unions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mod interface {
GraphQLObject,
};

#[allow(dead_code)] // TODO: Consider this for the GraphQL interfaces in the expansion.
#[graphql_interface(for = [Cat, Dog])]
trait Pet {
fn name(&self) -> &str;
Expand Down
1 change: 1 addition & 0 deletions juniper/src/executor_tests/introspection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ enum Sample {
struct Scalar(i32);

/// A sample interface
#[allow(dead_code)] // TODO: Consider this for the GraphQL interfaces in the expansion.
#[graphql_interface(name = "SampleInterface", for = Root)]
trait Interface {
/// A sample field in the interface
Expand Down
4 changes: 2 additions & 2 deletions juniper/src/http/graphiql.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
favored resource bundler.
-->
<script
src="https://unpkg.com/graphiql@3.4.0/graphiql.min.js"
src="https://unpkg.com/graphiql@3.7.0/graphiql.min.js"
type="application/javascript"
></script>
<link rel="stylesheet" href="https://unpkg.com/graphiql@3.4.0/graphiql.min.css" />
<link rel="stylesheet" href="https://unpkg.com/graphiql@3.7.0/graphiql.min.css" />
<!--
These are imports for the GraphIQL Explorer plugin.
-->
Expand Down
Loading

0 comments on commit 6a0a69c

Please sign in to comment.