Skip to content

Rework Book #1230

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

Merged
merged 97 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
bbf5753
Bootstrap
tyranron Dec 1, 2023
a7eeaaf
Rework introduction
tyranron Dec 1, 2023
4a76162
Rework quickstart [skip ci]
tyranron Dec 1, 2023
b708b23
Reorganize "Type System" section [skip ci]
tyranron Dec 4, 2023
818072b
Rework "Scalars" chapter
tyranron Dec 5, 2023
2a7aecd
Move "Scalars" chapter down
tyranron Dec 5, 2023
a6a0aa6
Rework "Objects" chapter [skip ci]
tyranron Dec 5, 2023
352f17b
Rework "Enums" chapter [skip ci]
tyranron Dec 5, 2023
4a9578f
Apply typo
tyranron Dec 6, 2023
2cf2f03
Fix typo
tyranron Dec 6, 2023
d842576
Rephrase
tyranron Dec 6, 2023
9435c62
Rephrase
tyranron Dec 6, 2023
0ba9b69
Fix typo
tyranron Dec 6, 2023
8f51da3
Rephrase
tyranron Dec 6, 2023
23e2a58
Rephrase
tyranron Dec 6, 2023
dd1eb64
Fix typo
tyranron Dec 6, 2023
f749957
Rephrase [skip ci]
tyranron Dec 6, 2023
fda0ba7
Rephrase [skip ci]
tyranron Dec 7, 2023
14fb50f
Mention `Nullable` [skip ci]
tyranron Dec 7, 2023
5d410eb
Rework "Complex fields" chapter and rename "Using contexts" chapter a…
tyranron Dec 7, 2023
b598ad5
Rework "Input objects" chapter [skip ci]
tyranron Dec 7, 2023
c3c453c
Rework "Context" chapter [skip ci]
tyranron Dec 11, 2023
ba17509
Fix code examples [skip ci]
tyranron Dec 11, 2023
16acc8e
Merge branch 'master' into book-rework
tyranron Dec 12, 2023
753806b
Fix code examples [skip ci]
tyranron Dec 12, 2023
1aa970f
Rework "Interfaces" chapter, vol.1
tyranron Dec 12, 2023
511ea81
Rework "Interfaces" chapter, vol.2
tyranron Dec 13, 2023
46f46c3
Fix integration tests
tyranron Dec 13, 2023
ac3e28a
Rework "Unions" chapter
tyranron Dec 13, 2023
c2e4a09
Fix codegen tests
tyranron Dec 13, 2023
6abddc6
Rework "Introspection" chapter
tyranron Dec 14, 2023
0f18c88
Rework "Implicit and explicit `null`" chapter
tyranron Dec 14, 2023
0516ede
Fix
tyranron Dec 14, 2023
322c0a3
Move "Objects and generics" chapter under "Objects" section
tyranron Dec 15, 2023
fed92f0
Merge "Non-struct objects" chapter into "Objects > Error handling"
tyranron Dec 15, 2023
dedabe2
Move "Subscriptions" chapter under "Servers" section
tyranron Dec 15, 2023
41b5288
Rework "Servers" chapters
tyranron Dec 15, 2023
1cfbc09
Move "Subscription" chapter under "Schema" section
tyranron Dec 15, 2023
b9c2e78
Mention WebSocket integration in "Serving" chapter
tyranron Dec 15, 2023
698ae08
Rework "Multiple operations per request" chapter into "Batching"
tyranron Dec 21, 2023
6cf32f5
Rework "Error handling" chapter, vol.1
tyranron Dec 22, 2023
2090f4f
Update book/src/types/objects/error/field.md
tyranron Dec 25, 2023
6d64778
Update book/src/types/objects/error/field.md
tyranron Dec 25, 2023
c26c93c
Update book/src/types/objects/error/field.md
tyranron Dec 25, 2023
b16f506
Update book/src/serve/index.md
tyranron Dec 25, 2023
63c3bfd
Update book/src/serve/batching.md
tyranron Dec 25, 2023
a356c14
Update book/src/serve/batching.md
tyranron Dec 25, 2023
c8508f3
Update book/src/types/objects/context.md
tyranron Dec 25, 2023
315a522
Update book/src/types/enums.md
tyranron Dec 25, 2023
8b376f3
Update book/src/types/objects/complex_fields.md
tyranron Dec 25, 2023
f514397
Update book/src/types/objects/complex_fields.md [skip ci]
tyranron Dec 25, 2023
5856cc2
Update book/src/types/enums.md [skip ci]
tyranron Dec 25, 2023
8155c74
Fix [skip ci]
tyranron Dec 25, 2023
23046b9
Fix https://github.com/graphql-rust/juniper/pull/1230#discussion_r143…
tyranron Dec 25, 2023
f31049d
Fix https://github.com/graphql-rust/juniper/pull/1230#discussion_r143…
tyranron Dec 25, 2023
5434a0f
Fix https://github.com/graphql-rust/juniper/pull/1230#discussion_r143…
tyranron Dec 25, 2023
97c1f94
Fix https://github.com/graphql-rust/juniper/pull/1230#discussion_r143…
tyranron Dec 25, 2023
4fbf255
Fix https://github.com/graphql-rust/juniper/pull/1230#discussion_r143…
tyranron Dec 25, 2023
65536f6
Update book/src/types/enums.md [skip ci]
tyranron Dec 25, 2023
c0e9ed1
Update book/src/types/input_objects.md [skip ci]
tyranron Dec 25, 2023
536876e
Update book/src/types/input_objects.md [skip ci]
tyranron Dec 25, 2023
449886e
Update book/src/types/input_objects.md [skip ci]
tyranron Dec 25, 2023
5aacb5c
Fix https://github.com/graphql-rust/juniper/pull/1230#discussion_r143…
tyranron Dec 25, 2023
fac351f
Fix https://github.com/graphql-rust/juniper/pull/1230#discussion_r143…
tyranron Dec 25, 2023
58619fc
Update book/src/types/objects/complex_fields.md [skip ci]
tyranron Dec 25, 2023
578b308
Fix https://github.com/graphql-rust/juniper/pull/1230#discussion_r143…
tyranron Dec 25, 2023
6ad43b6
Fix https://github.com/graphql-rust/juniper/pull/1230#discussion_r143…
tyranron Dec 25, 2023
073016f
Rework "Error handling" chapter, vol.2
tyranron Dec 26, 2023
cc8d9bb
Rework "Type system" chapter
tyranron Dec 26, 2023
b7667fa
Merge branch 'master' into book-rework
tyranron Jan 5, 2024
a673c6a
Rework "Generics" chapter
tyranron Jan 5, 2024
f9bebdd
Rework "Schemas" chapter
tyranron Jan 5, 2024
1aeb9da
Disable `schema-language` feature by default
tyranron Jan 5, 2024
4770e31
Merge branch 'master' into book-rework
tyranron Jan 9, 2024
b0f0e95
Rework "Subscriptions" chapter
tyranron Jan 9, 2024
165079f
Reorganize "Dataloaders" chapter
tyranron Jan 9, 2024
d46d0bd
Describe "N+1 problem" chapter
tyranron Jan 9, 2024
b5623a6
Fix codegen failure tests
tyranron Jan 9, 2024
a2a7e41
Rework "Dataloaders" chapter
tyranron Jan 10, 2024
581c2d0
Add "Eager loading" chapter
tyranron Jan 11, 2024
b44d5b6
Merge branch 'master' into book-rework
tyranron Jan 11, 2024
558a0a7
Merge branch 'master' into book-rework
tyranron Jan 15, 2024
dbb838d
Merge branch 'master' into book-rework
tyranron Jan 19, 2024
8e406e6
Bootstrap "Look-ahead" chapter
tyranron Jan 19, 2024
b71677d
Merge branch 'master' into book-rework
tyranron Feb 2, 2024
b3119b8
Merge branch 'master' into book-rework
tyranron Feb 27, 2024
b6fb4fe
Describing look-ahead, vol.2
tyranron Mar 12, 2024
8ea9878
Merge branch 'master' into book-rework
tyranron Mar 12, 2024
a09a3e8
Fix N+1 look-ahead example
tyranron Mar 12, 2024
af3d892
Finish "Look-ahead" chapter
tyranron Mar 12, 2024
b5c3f87
Upd "Eager loading" chapter
tyranron Mar 12, 2024
ea3b7d3
Fix codegen failure tests
tyranron Mar 15, 2024
58e12b8
Fix codegen failure tests
tyranron Mar 15, 2024
e46dccb
Fix releasing `juniper` crate
tyranron Mar 15, 2024
a4aedaa
Fix releasing `juniper_subscriptions` crate
tyranron Mar 15, 2024
e50cb18
Fix links leading to Book
tyranron Mar 20, 2024
acdf3f4
Fix Book releasing
tyranron Mar 20, 2024
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
15 changes: 7 additions & 8 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@


- [Type System](types/index.md)

- [Defining objects](types/objects/defining_objects.md)
- [Objects](types/objects/index.md)
- [Complex fields](types/objects/complex_fields.md)
- [Using contexts](types/objects/using_contexts.md)
- [Error handling](types/objects/error_handling.md)
- [Other types](types/other-index.md)
- [Enums](types/enums.md)
- [Interfaces](types/interfaces.md)
- [Input objects](types/input_objects.md)
- [Scalars](types/scalars.md)
- [Unions](types/unions.md)
- [Interfaces](types/interfaces.md)
- [Unions](types/unions.md)
- [Enums](types/enums.md)
- [Input objects](types/input_objects.md)
- [Scalars](types/scalars.md)


- [Schemas and mutations](schema/schemas_and_mutations.md)

Expand Down
11 changes: 6 additions & 5 deletions book/src/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ juniper = "0.16.0"

Exposing simple enums and structs as [GraphQL] types is just a matter of adding a custom [derive attribute] to them. [Juniper] includes support for basic [Rust] types that naturally map to [GraphQL] features, such as `Option<T>`, `Vec<T>`, `Box<T>`, `Arc<T>`, `String`, `f64`, `i32`, references, slices and arrays.

For more advanced mappings, [Juniper] provides multiple macros to map your [Rust] types to a [GraphQL schema][schema]. The most important one is the [`#[graphql_object]` attribute][macro.graphql_object] that is used for declaring a [GraphQL object] with resolvers (typically used for declaring [`Query` and `Mutation` roots][1]).
For more advanced mappings, [Juniper] provides multiple macros to map your [Rust] types to a [GraphQL schema][schema]. The most important one is the [`#[graphql_object]` attribute][2] that is used for declaring a [GraphQL object] with resolvers (typically used for declaring [`Query` and `Mutation` roots][1]).

```rust
# # ![allow(unused_variables)]
Expand Down Expand Up @@ -118,7 +118,8 @@ impl Query {

struct Mutation;

#[graphql_object(
#[graphql_object]
#[graphql(
context = Context,
// If we need to use `ScalarValue` parametrization explicitly somewhere
// in the object definition (like here in `FieldResult`), we could
Expand Down Expand Up @@ -167,7 +168,7 @@ use juniper::{
#[derive(GraphQLEnum, Clone, Copy)]
enum Episode {
// Note, that the enum value will be automatically converted to the
// `SCREAMING_CASE` variant, just as GraphQL conventions imply.
// `SCREAMING_SNAKE_CASE` variant, just as GraphQL conventions imply.
NewHope,
Empire,
Jedi,
Expand Down Expand Up @@ -221,9 +222,9 @@ fn main() {
[GraphQL]: https://graphql.org
[GraphQL object]: https://spec.graphql.org/October2021#sec-Objects
[Juniper]: https://docs.rs/juniper
[macro.graphql_object]: https://docs.rs/juniper/latest/juniper/macro.graphql_object.html
[Rust]: https://www.rust-lang.org
[schema]: https://graphql.org/learn/schema
[schema-first]: https://www.apollographql.com/blog/backend/architecture/schema-first-vs-code-only-graphql#schema-first

[1]: https://spec.graphql.org/October2021#sec-Root-Operation-Types
[1]: https://spec.graphql.org/October2021#sec-Root-Operation-Types
[2]: https://docs.rs/juniper/latest/juniper/macro.graphql_object.html
13 changes: 6 additions & 7 deletions book/src/types/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ as painless as possible.

Find out more in the individual chapters below.

- [Defining objects](objects/defining_objects.md)
- [Objects](objects/index.md)
- [Complex fields](objects/complex_fields.md)
- [Using contexts](objects/using_contexts.md)
- [Error handling](objects/error_handling.md)
- [Other types](other-index.md)
- [Enums](enums.md)
- [Interfaces](interfaces.md)
- [Input objects](input_objects.md)
- [Scalars](scalars.md)
- [Unions](unions.md)
- [Interfaces](interfaces.md)
- [Unions](unions.md)
- [Enums](enums.md)
- [Input objects](input_objects.md)
- [Scalars](scalars.md)
216 changes: 0 additions & 216 deletions book/src/types/objects/defining_objects.md

This file was deleted.

Loading