From d485fdf85b81fb6543871166cfde328616c1691b Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Thu, 20 Jul 2023 21:14:36 -0500 Subject: [PATCH] No warnings --- spring-graphql-docs/antora-playbook.yml | 11 +++++---- spring-graphql-docs/antora.yml | 16 ++++++++++++- spring-graphql-docs/build.gradle | 21 +++++++++++++++- .../modules/ROOT/examples/docs-src | 1 + spring-graphql-docs/modules/ROOT/nav.adoc | 1 - .../modules/ROOT/pages/attributes.adoc | 24 ------------------- .../ROOT/pages/includes/graalvm-native.adoc | 4 ++-- .../modules/ROOT/pages/includes/graphiql.adoc | 2 +- .../ROOT/pages/includes/transports.adoc | 8 +++---- 9 files changed, 50 insertions(+), 38 deletions(-) create mode 120000 spring-graphql-docs/modules/ROOT/examples/docs-src delete mode 100644 spring-graphql-docs/modules/ROOT/pages/attributes.adoc diff --git a/spring-graphql-docs/antora-playbook.yml b/spring-graphql-docs/antora-playbook.yml index 819b435b..bfce69cc 100644 --- a/spring-graphql-docs/antora-playbook.yml +++ b/spring-graphql-docs/antora-playbook.yml @@ -1,3 +1,6 @@ +# PACKAGES antora@3.2.0-alpha.2 @antora/atlas-extension:1.0.0-alpha.1 @antora/collector-extension@1.0.0-alpha.3 @springio/antora-extensions@1.1.0 @asciidoctor/tabs@1.0.0-beta.3 @opendevise/antora-release-line-extension@1.0.0 +# +# The purpose of this Antora playbook is to build the docs in the current branch. antora: extensions: - '@springio/antora-extensions/partial-build-extension' @@ -17,10 +20,10 @@ git: ensure_git_suffix: false content: sources: - - url: ./.. - branches: HEAD - start_path: spring-graphql-docs - worktrees: true + - url: ./.. + branches: HEAD + start_path: spring-graphql-docs + worktrees: true asciidoc: attributes: page-stackoverflow-url: https://stackoverflow.com/tags/spring-graphql diff --git a/spring-graphql-docs/antora.yml b/spring-graphql-docs/antora.yml index 977cfdd5..ee468af5 100644 --- a/spring-graphql-docs/antora.yml +++ b/spring-graphql-docs/antora.yml @@ -14,4 +14,18 @@ ext: asciidoc: attributes: attribute-missing: 'warn' - chomp: 'all' \ No newline at end of file + chomp: 'all' + docs-site: https://docs.spring.io + import-java: 'example$docs-src/main/java/org/springframework/graphql/docs' + github-tag: main + github-repo: spring-projects/spring-graphql + github-raw: https://raw.githubusercontent.com/{github-repo}/{github-tag} + github-issues: https://github.com/{github-repo}/issues/ + github-main-branch: https://github.com/{github-repo}/tree/main + github-10x-branch: https://github.com/{github-repo}/tree/1.0.x + github-wiki: https://github.com/{github-repo}/wiki + graphql-java-docs: https://www.graphql-java.com/documentation + javadoc: https://docs.spring.io/spring-graphql/docs/{spring-graphql-version}/api + # version attributes from main build.gradle + spring-framework-ref-docs: https://docs.spring.io/spring-framework/reference + spring-boot-ref-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/reference/html \ No newline at end of file diff --git a/spring-graphql-docs/build.gradle b/spring-graphql-docs/build.gradle index acb5600f..b629c586 100644 --- a/spring-graphql-docs/build.gradle +++ b/spring-graphql-docs/build.gradle @@ -76,9 +76,27 @@ task api(type: Javadoc) { destinationDir = file("$buildDir/docs/javadoc") } +//antora { +// playbook = 'cached-antora-playbook.yml' +// playbookProvider { +// repository = 'spring-projects/spring-security' +// branch = 'docs-build' +// path = 'lib/antora/templates/per-branch-antora-playbook.yml' +// checkLocalBranch = true +// } +// options = [clean: true, fetch: !project.gradle.startParameter.offline, stacktrace: true] +//} + + antora { + playbookProvider { + repository = 'spring-projects/spring-security' + branch = 'docs-build' + path = 'lib/antora/templates/per-branch-antora-playbook.yml' + checkLocalBranch = true + } options = [clean: true, fetch: !project.gradle.startParameter.offline, stacktrace: true] - environment = [ + environment = [ 'ALGOLIA_API_KEY': '9d489079e5ec46dbb238909fee5c9c29', 'ALGOLIA_APP_ID': 'WB1FQYI187', 'ALGOLIA_INDEX_NAME': 'springsecurity', @@ -89,6 +107,7 @@ antora { '@asciidoctor/tabs': '1.0.0-beta.3', '@springio/antora-extensions': '1.4.2', '@springio/asciidoctor-extensions': '1.0.0-alpha.8', + '@opendevise/antora-release-line-extension': '1.0.0', ] } diff --git a/spring-graphql-docs/modules/ROOT/examples/docs-src b/spring-graphql-docs/modules/ROOT/examples/docs-src new file mode 120000 index 00000000..a1d005e3 --- /dev/null +++ b/spring-graphql-docs/modules/ROOT/examples/docs-src @@ -0,0 +1 @@ +../../../src/ \ No newline at end of file diff --git a/spring-graphql-docs/modules/ROOT/nav.adoc b/spring-graphql-docs/modules/ROOT/nav.adoc index 295f2b0a..990d9b3d 100644 --- a/spring-graphql-docs/modules/ROOT/nav.adoc +++ b/spring-graphql-docs/modules/ROOT/nav.adoc @@ -1,5 +1,4 @@ * xref:index.adoc[] -* xref:attributes.adoc[] ** xref:includes/transports.adoc[] ** xref:includes/request-execution.adoc[] ** xref:includes/data.adoc[] diff --git a/spring-graphql-docs/modules/ROOT/pages/attributes.adoc b/spring-graphql-docs/modules/ROOT/pages/attributes.adoc deleted file mode 100644 index 968ba659..00000000 --- a/spring-graphql-docs/modules/ROOT/pages/attributes.adoc +++ /dev/null @@ -1,24 +0,0 @@ -:chomp: default headers packages -:docs-site: https://docs.spring.io -:idprefix: -:idseparator: - -:tabsize: 4 -:numbered: -:sectanchors: -:sectnums: -:hide-uri-scheme: -:docs-java: {docdir}/../../main/java/org/springframework/graphql/docs -:docs-kotlin: {docdir}/../../main/kotlin/org/springframework/graphql/docs -:docs-resources: {docdir}/../../main/resources -:github-tag: main -:github-repo: spring-projects/spring-graphql -:github-raw: https://raw.githubusercontent.com/{github-repo}/{github-tag} -:github-issues: https://github.com/{github-repo}/issues/ -:github-main-branch: https://github.com/{github-repo}/tree/main -:github-10x-branch: https://github.com/{github-repo}/tree/1.0.x -:github-wiki: https://github.com/{github-repo}/wiki -:graphql-java-docs: https://www.graphql-java.com/documentation -:javadoc: https://docs.spring.io/spring-graphql/docs/{spring-graphql-version}/api -// version attributes from main build.gradle -:spring-framework-ref-docs: https://docs.spring.io/spring-framework/reference -:spring-boot-ref-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/reference/html diff --git a/spring-graphql-docs/modules/ROOT/pages/includes/graalvm-native.adoc b/spring-graphql-docs/modules/ROOT/pages/includes/graalvm-native.adoc index b616b7a5..d0e32318 100644 --- a/spring-graphql-docs/modules/ROOT/pages/includes/graalvm-native.adoc +++ b/spring-graphql-docs/modules/ROOT/pages/includes/graalvm-native.adoc @@ -37,7 +37,7 @@ This is all done automatically for you if you are building a Spring Boot applica If your application is "manually" registering data fetchers, some types are not discoverable as a result. You should then register them with Spring Framework's `@RegisterReflectionForBinding`: -include::code:GraphQlConfiguration[] +include-code:GraphQlConfiguration[] <1> This application declares a `RuntimeWiringConfigurer` that "manually" adds a `DataFetcher` <2> Through this `DataFetcher`, the `BookRepository` will expose a `Book` type <3> `@RegisterReflectionForBinding` will register the relevant hints for the `Book` type and all types exposed as fields @@ -50,7 +50,7 @@ The `AotProcessor` strategy described in the section above cannot be used as a r For client support, Spring for GraphQL embeds the {github-main-branch}/spring-graphql/src/main/resources/META-INF/native-image/org.springframework.graphql/spring-graphql[relevant reachability metadata for the client infrastructure]. When it comes to Java types used by the application, applications should use a similar strategy as "manual" data fetchers using `@RegisterReflectionForBinding`: -include::code:ProjectService[] +include-code:ProjectService[] <1> In a Native image, we need to ensure that reflection can be performed on `Project` at runtime <2> `@RegisterReflectionForBinding` will register the relevant hints for the `Project` type and all types exposed as fields diff --git a/spring-graphql-docs/modules/ROOT/pages/includes/graphiql.adoc b/spring-graphql-docs/modules/ROOT/pages/includes/graphiql.adoc index fbd8a244..f76d609e 100644 --- a/spring-graphql-docs/modules/ROOT/pages/includes/graphiql.adoc +++ b/spring-graphql-docs/modules/ROOT/pages/includes/graphiql.adoc @@ -29,7 +29,7 @@ Alternatively, you can integrate the JavaScript build in your project as a separ Once a GraphiQL build is available on the classpath, you can expose it as an endpoint with the {spring-framework-ref-docs}/web/webmvc-functional.html#webmvc-fn-router-functions[functional web frameworks]. -include::code:GraphiQlConfiguration[] +include-code:GraphiQlConfiguration[] <1> Load the GraphiQL page from the classpath (here, we are using the version shipped with Spring for GraphQL) <2> Configure a web handler for processing HTTP requests; you can implement a custom `HandlerFunction` depending on your use case <3> Finally, map the handler to a specific HTTP endpoint diff --git a/spring-graphql-docs/modules/ROOT/pages/includes/transports.adoc b/spring-graphql-docs/modules/ROOT/pages/includes/transports.adoc index 1b7839b6..f635ba61 100644 --- a/spring-graphql-docs/modules/ROOT/pages/includes/transports.adoc +++ b/spring-graphql-docs/modules/ROOT/pages/includes/transports.adoc @@ -105,7 +105,7 @@ handled as `request-stream`. `GraphQlRSocketHandler` can be used a delegate from an `@Controller` that is mapped to the route for GraphQL requests. For example: -include::code:GraphQlRSocketController[] +include-code:GraphQlRSocketController[] @@ -132,13 +132,13 @@ incoming requests and do one of the following: For example, an interceptor can pass an HTTP request header to a `DataFetcher`: -include::code:RequestHeaderInterceptor[] +include-code:RequestHeaderInterceptor[] <1> Interceptor adds HTTP request header value into GraphQLContext <2> Data controller method accesses the value Reversely, an interceptor can access values added to the `GraphQLContext` by a controller: -include::code:ResponseHeaderInterceptor[] +include-code:ResponseHeaderInterceptor[] <1> Controller adds value to the `GraphQLContext` <2> Interceptor uses the value to add an HTTP response header @@ -146,7 +146,7 @@ include::code:ResponseHeaderInterceptor[] request validation errors that are raised before execution begins and which cannot be handled with a `DataFetcherExceptionResolver`: -include::code:RequestErrorInterceptor[] +include-code:RequestErrorInterceptor[] <1> Return the same if `ExecutionResult` has a "data" key with non-null value <2> Check and transform the GraphQL errors <3> Update the `ExecutionResult` with the modified errors