@@ -199,8 +199,8 @@ the following:
199
199
- Expose {spring-boot-ref-docs}/application-properties.html#appendix.application-properties.web[properties]
200
200
that apply to `GraphQlSource.Builder`.
201
201
- Detect <<execution-graphqlsource-runtimewiring-configurer>> beans.
202
- - Detect ` Instrumentation` beans for GraphQL
203
- {spring-boot-ref-docs}/actuator.html#actuator.metrics.supported.spring-graphql[metrics].
202
+ - Detect https://www.graphql-java.com/documentation/instrumentation[ Instrumentation] beans for
203
+ {spring-boot-ref-docs}/actuator.html#actuator.metrics.supported.spring-graphql[GraphQL metrics].
204
204
- Detect `DataFetcherExceptionResolver` beans for
205
205
<<execution-exceptions, exception resolution>>.
206
206
- Detect `GraphQlSourceBuilderCustomizer` beans for any other customizations.
@@ -329,6 +329,40 @@ builder.schemaResources(..)
329
329
----
330
330
331
331
332
+ [[execution-graphqlsource-directives]]
333
+ ==== Directives
334
+
335
+ The GraphQL language supports directives that "describe alternate runtime execution and
336
+ type validation behavior in a GraphQL document". Directives are similar to annotations in
337
+ Java but declared on types, fields, fragments and operations in a GraphQL document.
338
+
339
+ GraphQL Java provides the `SchemaDirectiveWiring` contract to help applications detect
340
+ and handle directives. For more details, see
341
+ {graphql-java-docs}/sdl-directives/[Schema Directives] in the
342
+ GraphQL Java documentation.
343
+
344
+ In Spring GraphQL you can register a `SchemaDirectiveWiring` through a
345
+ <<execution-graphqlsource-runtimewiring-configurer>>. The Spring Boot starter detects
346
+ such beans, so you might have something like:
347
+
348
+ [source,java,indent=0,subs="verbatim,quotes"]
349
+ ----
350
+ @Configuration
351
+ public class GraphQlConfig {
352
+
353
+ @Bean
354
+ public RuntimeWiringConfigurer runtimeWiringConfigurer() {
355
+ return builder -> builder.directiveWiring(new MySchemaDirectiveWiring());
356
+ }
357
+
358
+ }
359
+ ----
360
+
361
+ TIP: For an example of directives support check out the
362
+ https://github.com/graphql-java/graphql-java-extended-validation[Extended Validation for Graphql Java]
363
+ library.
364
+
365
+
332
366
333
367
[[execution-reactive-datafetcher]]
334
368
=== Reactive `DataFetcher`
0 commit comments