Skip to content

Commit 70afadc

Browse files
committed
Rewrite anchors in reference documentation
This commit ensures that all anchors in the reference documentation follow a `"section.sub.title"`-like pattern to better align with the spring-asciidoctor-backends best practices. This will allow an easier integration with code snippets. All rewritten anchors are listed in the anchor-rewrite.properties file for automatic redirection.
1 parent 0458f15 commit 70afadc

File tree

6 files changed

+249
-187
lines changed

6 files changed

+249
-187
lines changed

spring-graphql-docs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ asciidoctor {
8181
configurations 'asciidoctorExtensions'
8282
baseDirFollowsSourceDir()
8383
sources {
84-
include '*.adoc'
84+
include 'index.adoc'
8585
}
8686
logDocuments = true
8787
outputOptions {
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
server-transports=server.transports
2+
server-http=server.transports.http
3+
server-websocket=server.transports.websocket
4+
server-rsocket=server.transports.rsocket
5+
execution-graphqlsource=execution.graphqlsource
6+
execution-graphqlsource-schema-resources=execution.graphqlsource.schema-resources
7+
execution-graphqlsource-schema-creation=execution.graphqlsource.schema-creation
8+
execution-graphqlsource-schema-traversal=execution.graphqlsource.schema-traversal
9+
execution-graphqlsource-schema-transformation=execution.graphqlsource.schema-transformation
10+
execution-graphqlsource-runtimewiring-configurer=execution.graphqlsource.runtimewiring-configurer
11+
execution-graphqlsource-default-type-resolver=execution.graphqlsource.default-type-resolver
12+
execution-graphqlsource-operation-caching=execution.graphqlsource.operation-caching
13+
execution-graphqlsource-directives=execution.graphqlsource.directives
14+
execution-reactive-datafetcher=execution.reactive-datafetcher
15+
execution-context=execution.context
16+
execution-context-webmvc=execution.context.webmvc
17+
execution-context-webflux=execution.context.webflux
18+
execution-exceptions=execution.exceptions
19+
execution-exceptions-request=execution.exceptions.request
20+
execution-exceptions-subsctiption=execution.exceptions.subscription
21+
execution-batching=execution.batching
22+
execution-batching-dataloader=execution.batching.dataloader
23+
execution-batching-batch-loader-registry=execution.batching.batch-loader-registry
24+
execution-batching-testing=execution.batching.testing
25+
data-querydsl=data.querydsl
26+
data-querydsl-build=data.querydsl.build
27+
data-querydsl-customizations=data.querydsl.customizations
28+
data-querydsl-registration=data.querydsl.registration
29+
data-querybyexample=data.querybyexample
30+
data-querybyexample-build=data.querybyexample.build
31+
data-querybyexample-customizations=data.querybyexample.customizations
32+
data-querybyexample-registration=data.querybyexample.registration
33+
data-projections=data.projections
34+
controllers-schema-mapping=controllers.schema-mapping
35+
controllers-schema-mapping-signature=controllers.schema-mapping.signature
36+
controllers-schema-mapping-argument=controllers.schema-mapping.argument
37+
controllers-schema-mapping-argument-value=controllers.schema-mapping.argument-value
38+
controllers-schema-mapping-arguments=controllers.schema-mapping.arguments
39+
controllers-schema-mapping-projectedpayload-argument=controllers.schema-mapping.projectedpayload.argument
40+
controllers-schema-mapping-source=controllers.schema-mapping.source
41+
controllers-schema-mapping-data-loader=controllers.schema-mapping.data-loader
42+
controllers-schema-mapping-validation=controllers.schema-mapping.validation
43+
controllers-batch-mapping=controllers.batch-mapping
44+
controllers-batch-mapping-signature=controllers.batch-mapping.signature
45+
client-graphqlclient=client.graphqlclient
46+
client-httpgraphqlclient=client.httpgraphqlclient
47+
client-websocketgraphqlclient=client.websocketgraphqlclient
48+
client-websocketgraphqlclient-interceptor=client.websocketgraphqlclient.interceptor
49+
client-rsocketgraphqlclient=client.rsocketgraphqlclient
50+
client-graphqlclient-builder=client.graphqlclient.builder
51+
client-requests=client.requests
52+
client-requests-retrieve=client.requests.retrieve
53+
client-requests-execute=client.requests.execute
54+
client-requests-document-source=client.requests.document-source
55+
client-subscriptions=client.subscriptions
56+
client-subscriptions-retrieve=client.subscriptions.retrieve
57+
client-subscriptions-execute=client.subscriptions.execute
58+
client-interception=client.interception
59+
testing-graphqltester=testing.graphqltester
60+
testing-httpgraphqltester=testing.httpgraphqltester
61+
testing-websocketgraphqltester=testing.websocketgraphqltester
62+
testing-rsocketgraphqltester=testing.rsocketgraphqltester
63+
testing-graphqlservicetester=testing.graphqlservicetester
64+
testing-webgraphqltester=testing.webgraphqltester
65+
testing-graphqltester-builder=testing.graphqltester.builder
66+
testing-requests=testing.requests
67+
testing-subscriptions=testing.subscriptions
68+
testing-errors=testing.errors
Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1+
:chomp: default headers packages
2+
:docs-site: https://docs.spring.io
13
:idprefix:
2-
:idseparator: -
3-
:toc: left
4-
:toclevels: 4
5-
:tabsize: 4
4+
:idseparator: -
5+
:toc: left
6+
:toclevels: 4
7+
:tabsize: 4
68
:numbered:
79
:sectanchors:
810
:sectnums:
911
:hide-uri-scheme:
10-
:github-tag: main
11-
:github-repo: spring-projects/spring-graphql
12-
:github-raw: https://raw.githubusercontent.com/{github-repo}/{github-tag}
13-
:github-issues: https://github.com/{github-repo}/issues/
14-
:github-main-branch: https://github.com/{github-repo}/tree/main
15-
:github-10x-branch: https://github.com/{github-repo}/tree/1.0.x
16-
:github-wiki: https://github.com/{github-repo}/wiki
17-
:graphql-java-docs: https://www.graphql-java.com/documentation
18-
:javadoc: https://docs.spring.io/spring-graphql/docs/{spring-graphql-version}/api
19-
:spring-framework-ref-docs: https://docs.spring.io/spring-framework/docs/current/reference/html
20-
12+
:docs-java: {docdir}/../../main/java/org/springframework/graphql/docs
13+
:docs-kotlin: {docdir}/../../main/kotlin/org/springframework/graphql/docs
14+
:docs-resources: {docdir}/../../main/resources
15+
:github-tag: main
16+
:github-repo: spring-projects/spring-graphql
17+
:github-raw: https://raw.githubusercontent.com/{github-repo}/{github-tag}
18+
:github-issues: https://github.com/{github-repo}/issues/
19+
:github-main-branch: https://github.com/{github-repo}/tree/main
20+
:github-10x-branch: https://github.com/{github-repo}/tree/1.0.x
21+
:github-wiki: https://github.com/{github-repo}/wiki
22+
:graphql-java-docs: https://www.graphql-java.com/documentation
23+
:javadoc: https://docs.spring.io/spring-graphql/docs/{spring-graphql-version}/api
24+
:spring-framework-ref-docs: https://docs.spring.io/spring-framework/docs/current/reference/html
2125
// {spring-boot-version} attribute from build.gradle
22-
:spring-boot-ref-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/reference/html
26+
:spring-boot-ref-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/reference/html

spring-graphql-docs/src/docs/asciidoc/client.adoc renamed to spring-graphql-docs/src/docs/asciidoc/includes/client.adoc

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
include::attributes.adoc[]
2-
3-
4-
5-
61
[[client]]
72
= Client
83

@@ -11,7 +6,7 @@ WebSocket, and RSocket.
116

127

138

14-
[[client-graphqlclient]]
9+
[[client.graphqlclient]]
1510
== `GraphQlClient`
1611

1712
`GraphQlClient` is a contract that declares a common workflow for GraphQL requests that is
@@ -21,18 +16,18 @@ build time.
2116

2217
To create a `GraphQlClient` you need one of the following extensions:
2318

24-
- <<client-httpgraphqlclient, HttpGraphQlClient>>
25-
- <<client-websocketgraphqlclient, WebSocketGraphQlClient>>
26-
- <<client-rsocketgraphqlclient, RSocketGraphQlClient>>
19+
- <<client.httpgraphqlclient, HttpGraphQlClient>>
20+
- <<client.websocketgraphqlclient, WebSocketGraphQlClient>>
21+
- <<client.rsocketgraphqlclient, RSocketGraphQlClient>>
2722

2823
Each defines a `Builder` with options relevant to the transport. All builders extend
29-
from a common, base GraphQlClient <<client-graphqlclient-builder, `Builder`>> with options
24+
from a common, base GraphQlClient <<client.graphqlclient.builder, `Builder`>> with options
3025
relevant to all extensions.
3126

32-
Once you have a `GraphQlClient` you can begin to make <<client-requests, requests>>.
27+
Once you have a `GraphQlClient` you can begin to make <<client.requests, requests>>.
3328

3429

35-
[[client-httpgraphqlclient]]
30+
[[client.httpgraphqlclient]]
3631
=== HTTP
3732

3833
`HttpGraphQlClient` uses
@@ -46,7 +41,7 @@ HttpGraphQlClient graphQlClient = HttpGraphQlClient.create(webClient);
4641
----
4742

4843
Once `HttpGraphQlClient` is created, you can begin to
49-
<<client-requests, execute requests>> using the same API, independent of the underlying
44+
<<client.requests, execute requests>> using the same API, independent of the underlying
5045
transport. If you need to change any transport specific details, use `mutate()` on an
5146
existing `HttpGraphQlClient` to create a new instance with customized settings:
5247

@@ -70,7 +65,7 @@ existing `HttpGraphQlClient` to create a new instance with customized settings:
7065

7166

7267

73-
[[client-websocketgraphqlclient]]
68+
[[client.websocketgraphqlclient]]
7469
=== WebSocket
7570

7671
`WebSocketGraphQlClient` executes GraphQL requests over a shared WebSocket connection.
@@ -102,7 +97,7 @@ single, shared connection for all requests to that server. Each client instance
10297
establishes its own connection and that is typically not the intent for a single server.
10398

10499
Once `WebSocketGraphQlClient` is created, you can begin to
105-
<<client-requests, execute requests>> using the same API, independent of the underlying
100+
<<client.requests, execute requests>> using the same API, independent of the underlying
106101
transport. If you need to change any transport specific details, use `mutate()` on an
107102
existing `WebSocketGraphQlClient` to create a new instance with customized settings:
108103

@@ -126,7 +121,7 @@ existing `WebSocketGraphQlClient` to create a new instance with customized setti
126121
----
127122

128123

129-
[[client-websocketgraphqlclient-interceptor]]
124+
[[client.websocketgraphqlclient.interceptor]]
130125
==== Interceptor
131126

132127
The https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md[GraphQL over WebSocket]
@@ -154,13 +149,13 @@ For WebSocket transport specific interception, you can create a
154149
}
155150
----
156151

157-
<<client-interception,Register>> the above interceptor as any other
152+
<<client.interception,Register>> the above interceptor as any other
158153
`GraphQlClientInterceptor` and use it also to intercept GraphQL requests, but note there
159154
can be at most one interceptor of type `WebSocketGraphQlClientInterceptor`.
160155

161156

162157

163-
[[client-rsocketgraphqlclient]]
158+
[[client.rsocketgraphqlclient]]
164159
=== RSocket
165160

166161
`RSocketGraphQlClient` uses
@@ -192,33 +187,33 @@ single, shared session for all requests to that server. Each client instance
192187
establishes its own connection and that is typically not the intent for a single server.
193188

194189
Once `RSocketGraphQlClient` is created, you can begin to
195-
<<client-requests, execute requests>> using the same API, independent of the underlying
190+
<<client.requests, execute requests>> using the same API, independent of the underlying
196191
transport.
197192

198193

199194

200-
[[client-graphqlclient-builder]]
195+
[[client.graphqlclient.builder]]
201196
=== Builder
202197

203198
`GraphQlClient` defines a parent `Builder` with common configuration options for the
204199
builders of all extensions. Currently, it has lets you configure:
205200

206201
- `DocumentSource` strategy to load the document for a request from a file
207-
- <<client-interception>> of executed requests
202+
- <<client.interception>> of executed requests
208203

209204

210205

211206

212-
[[client-requests]]
207+
[[client.requests]]
213208
== Requests
214209

215-
Once you have a <<client-graphqlclient>>, you can begin to perform requests via
216-
<<client-requests-retrieve, retrieve()>> or <<client-requests-execute, execute()>>
210+
Once you have a <<client.graphqlclient>>, you can begin to perform requests via
211+
<<client.requests.retrieve, retrieve()>> or <<client.requests.execute, execute()>>
217212
where the former is only a shortcut for the latter.
218213

219214

220215

221-
[[client-requests-retrieve]]
216+
[[client.requests.retrieve]]
222217
=== Retrieve
223218

224219
The below retrieves and decodes the data for a query:
@@ -244,7 +239,7 @@ The below retrieves and decodes the data for a query:
244239

245240
The input document is a `String` that could be a literal or produced through a code
246241
generated request object. You can also define documents in files and use a
247-
<<client-requests-document-source>> to resole them by file name.
242+
<<client.requests.document-source>> to resole them by file name.
248243

249244
The path is relative to the "data" key and uses a simple dot (".") separated notation
250245
for nested fields with optional array indices for list elements, e.g. `"project.name"`
@@ -269,10 +264,10 @@ response and the field:
269264

270265

271266

272-
[[client-requests-execute]]
267+
[[client.requests.execute]]
273268
=== Execute
274269

275-
<<client-requests-retrieve>> is only a shortcut to decode from a single path in the
270+
<<client.requests.retrieve>> is only a shortcut to decode from a single path in the
276271
response map. For more control, use the `execute` method and handle the response:
277272

278273
For example:
@@ -307,7 +302,7 @@ For example:
307302

308303

309304

310-
[[client-requests-document-source]]
305+
[[client.requests.document-source]]
311306
=== Document Source
312307

313308
The document for a request is a `String` that may be defined in a local variable or
@@ -346,26 +341,26 @@ You can then:
346341

347342
The "JS GraphQL" plugin for IntelliJ supports GraphQL query files with code completion.
348343

349-
You can use the `GraphQlClient` <<client-graphqlclient-builder>> to customize the
344+
You can use the `GraphQlClient` <<client.graphqlclient.builder>> to customize the
350345
`DocumentSource` for loading documents by names.
351346

352347

353348

354349

355-
[[client-subscriptions]]
350+
[[client.subscriptions]]
356351
== Subscription Requests
357352

358353
`GraphQlClient` can execute subscriptions over transports that support it. Currently, only
359354
the WebSocket transport supports GraphQL streams, so you'll need to create a
360-
<<client-websocketgraphqlclient,WebSocketGraphQlClient>>.
355+
<<client.websocketgraphqlclient,WebSocketGraphQlClient>>.
361356

362357

363358

364-
[[client-subscriptions-retrieve]]
359+
[[client.subscriptions.retrieve]]
365360
=== Retrieve
366361

367362
To start a subscription stream, use `retrieveSubscription` which is similar to
368-
<<client-requests-retrieve,retrieve>> for a single response but returning a stream of
363+
<<client.requests.retrieve,retrieve>> for a single response but returning a stream of
369364
responses, each decoded to some data:
370365

371366
[source,java,indent=0,subs="verbatim,quotes"]
@@ -389,10 +384,10 @@ the connection and start the subscription again.
389384

390385

391386

392-
[[client-subscriptions-execute]]
387+
[[client.subscriptions.execute]]
393388
=== Execute
394389

395-
<<client-subscriptions-retrieve>> is only a shortcut to decode from a single path in each
390+
<<client.subscriptions.retrieve>> is only a shortcut to decode from a single path in each
396391
response map. For more control, use the `executeSubscription` method and handle each
397392
response directly:
398393

@@ -422,7 +417,7 @@ response directly:
422417

423418

424419

425-
[[client-interception]]
420+
[[client.interception]]
426421
== Interception
427422

428423
You create a `GraphQlClientInterceptor` to intercept all requests through a client:

0 commit comments

Comments
 (0)