Skip to content

Commit 1a24e31

Browse files
committed
Polishing documentation
See gh-620
1 parent ee493ef commit 1a24e31

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

spring-graphql-docs/src/docs/asciidoc/index.adoc

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ GraphQlSource.schemaResourceBuilder()
668668
<1> Create type visitor with one or more ``ConnectionAdapter``s.
669669
<2> Resister the type visitor.
670670

671-
There are <<data.scroll.sort,built-in>> ``ConnectionAdapter``s for Spring Data's
671+
There are <<data.pagination.scroll,built-in>> ``ConnectionAdapter``s for Spring Data's
672672
`Window` and `Slice`. You can also create your own custom adapter. `ConnectionAdapter`
673673
implementations rely on a <<execution.pagination.cursor.strategy>> to
674674
create cursors for returned items. The same strategy is also used to support the
@@ -692,28 +692,19 @@ ensure that annotated controllers are <<controllers-declaration, configured>> fo
692692
them opaque to clients. `EncodingCursorStrategy` combines `CursorStrategy` with a
693693
`CursorEncoder`. You can use `Base64CursorEncoder`, `NoOpEncoder` or create your own.
694694

695-
There is a <<data.scroll.sort,built-in>> `CursorStrategy` for the Spring Data
695+
There is a <<data.pagination.scroll,built-in>> `CursorStrategy` for the Spring Data
696696
`ScrollPosition`. The <<boot-starter>> registers a `ScrollPositionCursorStrategy` with
697697
`Base64Encoder` when Spring Data is present.
698698

699699

700-
[[execution.pagination.arguments]]
701-
==== Arguments
702-
703-
Controller methods can declare a <<controllers.schema-mapping.subrange>>, or a
704-
`ScrollSubange` method argument when Spring Data is present, for pagination requests.
705-
The argument resolver is added when a <<execution.pagination.cursor.strategy>> bean is
706-
present in Spring configuration.
707-
708-
709700
[[execution.pagination.sort.strategy]]
710701
==== Sort
711702

712703
There is no standard way to provide sort information in a GraphQL request. However,
713-
pagination depends on a stable sort order. You can use a default order or extract, and
714-
keep it as an internal detail, or extract sort details from GraphQL arguments.
704+
pagination depends on a stable sort order. You can use a default order, or otherwise
705+
expose input types and extract sort details from GraphQL arguments.
715706

716-
There is <<data.scroll.sort,built-in>> support for Spring Data's `Sort` as a controller
707+
There is <<data.pagination.sort,built-in>> support for Spring Data's `Sort` as a controller
717708
method argument. For this to work, you need to have a `SortStrategy` bean.
718709

719710

@@ -1197,15 +1188,16 @@ required fields (or columns) are part of the database query result.
11971188

11981189

11991190

1200-
[[data.scroll.sort]]
1201-
=== Scroll and Sort
1191+
[[data.pagination.scroll]]
1192+
=== Scroll
12021193

12031194
As explained in <<execution.pagination>>, the GraphQL Cursor Connection spec defines a
1204-
mechanism for pagination with the `Connection`, `Edge`, and `PageInfo` schema type, while
1195+
mechanism for pagination with `Connection`, `Edge`, and `PageInfo` schema types, while
12051196
GraphQL Java provides the equivalent Java type representations.
12061197

1207-
Spring for GraphQL has built-in ``ConnectionAdapter``s to adapt the Spring Data pagination
1208-
types `Window` and `Slice` transparently. You can configure that as follows:
1198+
Spring for GraphQL provides built-in ``ConnectionAdapter`` implementations to adapt the
1199+
Spring Data pagination types `Window` and `Slice` transparently. You can configure that
1200+
as follows:
12091201

12101202
[source,java,indent=0,subs="verbatim,quotes"]
12111203
----
@@ -1232,13 +1224,22 @@ On the request side, a controller method can declare a
12321224
or backward. For this to work, you must declare a <<execution.pagination.cursor.strategy>>
12331225
supports `ScrollPosition` as a bean.
12341226

1227+
The <<boot-starter>> declares a `CursorStrategy<ScrollPosition>` bean, and registers the
1228+
`ConnectionFieldTypeVisitor` as shown above if Spring Data is on the classpath.
1229+
1230+
1231+
1232+
[[data.pagination.sort]]
1233+
=== Sort
1234+
12351235
Spring for GraphQL defines a `SortStrategy` to create `Sort` from GraphQL arguments.
12361236
`AbstractSortStrategy` implements the contract with abstract methods to extract the sort
12371237
direction and properties. To enable support for `Sort` as a controller method argument,
12381238
you need to declare a `SortStrategy` bean.
12391239

12401240

12411241

1242+
12421243
[[controllers]]
12431244
== Annotated Controllers
12441245

@@ -1411,12 +1412,12 @@ See <<controllers.schema-mapping.source>>.
14111412
| `Subrange` and `ScrollSubrange`
14121413
| For access to pagination arguments.
14131414

1414-
See <<execution.pagination>>, <<data.scroll.sort>>, <<controllers.schema-mapping.subrange>>.
1415+
See <<execution.pagination>>, <<data.pagination.scroll>>, <<controllers.schema-mapping.subrange>>.
14151416

14161417
| `Sort`
14171418
| For access to sort details.
14181419

1419-
See <<execution.pagination>>, <<data.scroll.sort>>, <<controllers.schema-mapping.sort>>.
1420+
See <<execution.pagination>>, <<controllers.schema-mapping.sort>>.
14201421

14211422
| `DataLoader`
14221423
| For access to a `DataLoader` in the `DataLoaderRegistry`.
@@ -1682,7 +1683,7 @@ public class BookController {
16821683
[[controllers.schema-mapping.sort]]
16831684
==== `Sort`
16841685

1685-
When there is a <<data.scroll.sort,SortStrategy>> bean in Spring configuration, controller
1686+
When there is a <<data.pagination.scroll,SortStrategy>> bean in Spring configuration, controller
16861687
methods support `Sort` as a method argument. For example:
16871688

16881689
[source,java,indent=0,subs="verbatim,quotes"]

0 commit comments

Comments
 (0)