No warnings
This commit is contained in:
committed by
Rossen Stoyanchev
parent
bb9aaaddc8
commit
d485fdf85b
1
spring-graphql-docs/modules/ROOT/examples/docs-src
Symbolic link
1
spring-graphql-docs/modules/ROOT/examples/docs-src
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../src/
|
||||
@@ -1,5 +1,4 @@
|
||||
* xref:index.adoc[]
|
||||
* xref:attributes.adoc[]
|
||||
** xref:includes/transports.adoc[]
|
||||
** xref:includes/request-execution.adoc[]
|
||||
** xref:includes/data.adoc[]
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user