Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy look_ahead #1212

Merged
merged 16 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion book/src/types/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ This requires to explicitly parametrize over [`ScalarValue`][3], as [`Executor`]

```rust
# extern crate juniper;
use juniper::{graphql_interface, graphql_object, Executor, LookAheadMethods as _, ScalarValue};
use juniper::{graphql_interface, graphql_object, Executor, ScalarValue};

#[graphql_interface(for = Human, Scalar = S)] // notice specifying `ScalarValue` as existing type parameter
trait Character<S: ScalarValue> {
Expand Down
18 changes: 14 additions & 4 deletions juniper/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,22 @@ All user visible changes to `juniper` crate will be documented in this file. Thi
- Removed `scalar-naivetime` [Cargo feature].
- Removed lifetime parameter from `ParseError`, `GraphlQLError`, `GraphQLBatchRequest` and `GraphQLRequest`. ([#1081], [#528])
- Upgraded [GraphiQL] to 3.1.0 version (requires new [`graphql-transport-ws` GraphQL over WebSocket Protocol] integration on server, see `juniper_warp/examples/subscription.rs`). ([#1188], [#1193], [#1235])
- Made `LookAheadMethods::children()` method to return slice instead of `Vec`. ([#1200])
- Abstracted `Spanning::start` and `Spanning::end` fields into separate struct `Span`. ([#1207], [#1208])
- Added `Span` to `Arguments` and `LookAheadArguments`. ([#1206], [#1209])
- Removed `graphql-parser-integration` and `graphql-parser` [Cargo feature]s by merging them into `schema-language` [Cargo feature]. ([#1237])
- Renamed `RootNode::as_schema_language()` method as `RootNode::as_sdl()`. ([#1237])
- Renamed `RootNode::as_parser_document()` method as `RootNode::as_document()`. ([#1237])
- Renamed `RootNode::as_parser_document()` method as `RootNode::as_document()`. ([#1237])
- Reworked look-ahead machinery: ([#1212])
- Turned from eagerly-evaluated into lazy-evaluated:
- Made `LookAheadValue::List` to contain new iterable `LookAheadList` type.
- Made `LookAheadValue::Object` to contain new iterable `LookAheadObject` type.
- Removed `LookAheadMethods` trait and redundant `ConcreteLookAheadSelection` type, making all APIs accessible as inherent methods on `LookAheadSelection` and `LookAheadChildren` decoupled types:
- Moved `LookAheadMethods::child_names()` to `LookAheadChildren::names()`.
- Moved `LookAheadMethods::has_children()` to `LookAheadChildren::is_empty()`.
- Moved `LookAheadMethods::select_child()` to `LookAheadChildren::select()`.
- Moved `LookAheadSelection::for_explicit_type()` to `LookAheadSelection::children_for_explicit_type()`.
- Made `LookAheadSelection::arguments()` returning iterator over `LookAheadArgument`.
- Made `LookAheadSelection::children()` returning `LookAheadChildren`.
- Added `Span` to `Arguments` and `LookAheadArguments`. ([#1206], [#1209])

### Added

Expand Down Expand Up @@ -145,11 +155,11 @@ All user visible changes to `juniper` crate will be documented in this file. Thi
[#1190]: /../../pull/1190
[#1193]: /../../pull/1193
[#1199]: /../../pull/1199
[#1200]: /../../pull/1200
[#1206]: /../../pull/1206
[#1207]: /../../pull/1207
[#1208]: /../../pull/1208
[#1209]: /../../pull/1209
[#1212]: /../../pull/1212
[#1215]: /../../pull/1215
[#1227]: /../../pull/1227
[#1228]: /../../pull/1228
Expand Down
Loading