You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
always-prettify: true #true is the default value, no need to specify it
420
+
```
421
+
422
+
The most important parameter is the base package. The starter will look for schema-relevant classes in the specified
423
+
package and its subpackages. `always-prettify` will "prettify" getter/setter methods - the get/set/is prefix will be
424
+
removed from GraphQL fields automatically.
425
+
426
+
### Root resolvers, directives, type extensions
427
+
428
+
The root resolvers must be marked by the `GraphQLQueryResolver`, `GraphQLMutationResolver` and `GraphQLSubscription`
429
+
interfaces (from the GraphQL Java Tools library).
430
+
431
+
**Important:**
432
+
433
+
Unlike GraphQL Java Tools, GraphQL Annotations only supports *one* of them each. Furthermore, GraphQL Annotations
434
+
only accepts a *class* as input, *not an instance*. It will either create a new instance of the class itself, or use
435
+
static methods. This means that Spring dependency injection will not work in the usual way. The companion example
436
+
project (which can be found in the [samples](https://github.com/graphql-java-kickstart/samples) repository)
437
+
demonstrates possible workarounds for this issue.
438
+
439
+
`GraphQLDirectiveDefinition` and `GraphQLTypeExtension`-annotated classes are subject to the same limitation regarding
440
+
dependency injection - but there can be any number of them.
441
+
442
+
### Custom scalars and type functions
443
+
444
+
Custom scalars can be defined in the same way as in the case of using GraphQL Java Tools - just define the
445
+
`GraphQLScalarType` beans.
446
+
447
+
The starter will also pick up `TypeFunction` beans and pass them to the schema builder.
448
+
449
+
In these cases the actual beans will be used, not just the classes. Spring dependency injection works as usual.
450
+
451
+
### Custom Relay and GraphQL Annotation Processor
452
+
453
+
It is possible to define a bean implementing `Relay` and/or `GraphQLAnnotations`. If present, these will be passed to
454
+
the schema builder. Spring dependency injection works as usual. Note that GraphQL Annotations provides default
455
+
implementation for these which should be sufficient is most cases.
456
+
401
457
# Tracing and Metrics
402
458
403
459
[Apollo style tracing](https://github.com/apollographql/apollo-tracing) along with two levels of metrics based on them are currently configurable.
Copy file name to clipboardExpand all lines: graphql-kickstart-spring-boot-autoconfigure-graphql-annotations/src/main/java/graphql/kickstart/graphql/annotations/GraphQLAnnotationsAutoConfiguration.java
0 commit comments